This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/15763] shm_open/unlink let you write outside SHMDIR
- From: "corbellini.andrea at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Sat, 20 Jul 2013 20:38:12 +0000
- Subject: [Bug libc/15763] shm_open/unlink let you write outside SHMDIR
- Auto-submitted: auto-generated
- References: <bug-15763-131 at http dot sourceware dot org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=15763
--- Comment #4 from Andrea Corbellini <corbellini.andrea at gmail dot com> ---
I agree with you about EISDIR being a bad error number.
I raised the problem of directories because I do have a directory in my
/dev/shm. It's a directory created by Byobu (http://byobu.co/) used as cache.
Byobu is written in Bash, so it's not affected by the behavior of shm_open().
However it shows that the possibility of encountering directories in /dev/shm
is not remote and also shows that such directories aren't created maliciously
(although we might say Byobu is buggy).
Whether it makes sense to create directories in /dev/shm or not, I still think
that shm_open() with O_RDONLY should not open them: otherwise every call to
read() will fail with EISDIR (which, as you noted, is not a good error number).
If we allow shm_open() to return directories, then we are returning broken file
descriptors.
About fstat: you might use it just for O_RDONLY. I think this is a feasible
approach as people expect some delay when accessing resources. Also, fstat
should not be noticeably slow.
--
You are receiving this mail because:
You are on the CC list for the bug.