From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24254 invoked by alias); 13 Jun 2014 15:02:54 -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 24195 invoked by uid 48); 13 Jun 2014 15:02:50 -0000 From: "fweimer at redhat dot com" To: glibc-bugs@sourceware.org Subject: [Bug libc/15661] posix_fallocate fallback code buggy and dangerous Date: Fri, 13 Jun 2014 15:02: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: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: fweimer at redhat 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: security- X-Bugzilla-Changed-Fields: cc flagtypes.name 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: 2014-06/txt/msg00731.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=15661 Florian Weimer changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fweimer at redhat dot com Flags| |security- --- Comment #2 from Florian Weimer --- (In reply to Rich Felker from comment #1) > If keeping the emulation is desirable, I do have one potential fix that > would avoid the race condition. fork a child process (because this might > SIGBUS if another thread or process truncates the file), possibly using > clone to avoid the parent receiving signals from the child's termination. In > the child, mmap the file and use atomic compare-and-swap on each page that > should be allocated, with the comparison and new values being equal. This > will touch each page with a write in a way that's non-destructive. This needs a way to transparently create child processes, without delivering SIGCHLD. I don't think we have that at present. -- You are receiving this mail because: You are on the CC list for the bug.