aufs shipped with Ubuntu does not properly handle aufs does not properly support dlopen() + unlink()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Saucy |
Won't Fix
|
Undecided
|
Unassigned | ||
Trusty |
Fix Released
|
Medium
|
Unassigned |
Bug Description
I have found aufs not supporting application performing the following steps in order to download a .so embedded in the binary. The code does:
1/ open() a temp file, write() contents of .so to the file and close() it
2/ perform dlopen() on the file and dlsym() to find one or more symbols
3/ perform unlink() to remove it, while keeping handle from dlopen() open - NOT calling dlclose() - since the code calls APIs from the temp .so
4/ this library works, but subsequent calls fail
The issue applies to Ubuntu 12.04, 13.04 and 13.10 from the ones that I have checked. I can provide the additional Linux kernel details, however, as it is not specific to Linux version, but issue is not applying one of the patches from aufs and quite a long investigation has already been made, I hope it is not needed.
After checking with aufs author, it seems the problem is caused by Ubuntu build process not applying aufs3-proc_
"Ubuntu doesn't apply aufs3-proc_
enable CONFIG_
I have to confess that I didn't test aufs _without_
aufs3-proc_
reason I could not reproduce the problem on my test machine.
Now your test program succeeds on my ubuntu machine with appllying
aufs3-proc_
The purpose of aufs3-proc_
/proc/PID/maps. So this is a problem of aufs definitly. I will try
fixing this bug as soon as possible, but I am going to be busy and it
may take some time. So the first and simplest solution for you is to ask
ubuntu people to apply aufs3-proc_
objection."
Would it be possible to apply the patch in Ubuntu? Since this is the most common way to build it and this is what the aufs author does, it should be safest to also apply it. Without it it seems that lifetime of file object is not correct and it causes inode numbers to be reused, like in this case.
Original bug report against aufs:
http://
Discussion related to the bug report:
http://
The bug report also includes sample code to reproduce the problem - the /tmp has to be mounted as aufs to reproduce it.
---
Architecture: i386
DistroRelease: Ubuntu 13.04
MarkForUpload: True
Package: linux (not installed)
ProcEnviron:
TERM=linux
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
Uname: Linux 3.8.0-31-generic i686
UserGroups:
Changed in linux (Ubuntu): | |
status: | Incomplete → Confirmed |
This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:
apport-collect 1243591
and then change the status of the bug to 'Confirmed'.
If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.
This change has been made by an automated script, maintained by the Ubuntu Kernel Team.