From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22596 invoked by alias); 20 Jul 2013 18:45:19 -0000 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org Received: (qmail 19149 invoked by uid 48); 20 Jul 2013 18:43:17 -0000 From: "corbellini.andrea at gmail dot com" To: glibc-bugs@sourceware.org Subject: [Bug libc/15763] shm_open/unlink let you write outside SHMDIR Date: Sat, 20 Jul 2013 18:45:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: 2.18 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: corbellini.andrea at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-07/txt/msg00127.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=15763 --- Comment #2 from Andrea Corbellini --- 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.