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 18:43:16 +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 #2 from Andrea Corbellini <corbellini.andrea at gmail dot com> ---
There should be a third constraint: no directories. Consider:
shm_open (".", O_RDONLY, 0666);
It contains no slashes, it's lower than NAME_MAX but is still an invalid name.
errno should be EINVAL in this case.
Also consider this code:
mkdir ("/dev/shm/some-name", 0666);
shm_open ("some-name", O_RDONLY, 0666);
Currently it works. If you specify O_WRONLY and O_RDWR you get EINVAL from
open(2).
In my opinion, errno should be EISDIR in any case (O_RDONLY, O_WRONLY and
O_RDWR).
--
You are receiving this mail because:
You are on the CC list for the bug.