From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6895 invoked by alias); 13 Jan 2014 01:52:38 -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 6576 invoked by uid 48); 13 Jan 2014 01:52:34 -0000 From: "carlos at redhat dot com" To: glibc-bugs@sourceware.org Subject: [Bug nptl/12683] Race conditions in pthread cancellation Date: Mon, 13 Jan 2014 01:52:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: nptl X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: carlos 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: 2.19 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: 2014-01/txt/msg00219.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=12683 --- Comment #15 from Carlos O'Donell --- (In reply to Rich Felker from comment #14) Thanks for the recap. > Anyway, this race condition is the whole matter at hand here. The two > possibilities allowed (again, due to the limitations imposed by the first > paragrah) are acting on the event while leaving cancellation pending, or > acting on cancellation while leaving the event pending. But glibc also has a > race window where it can act on both the event, producing side effects > (because the kernel already has), and act on cancellation. This makes it > non-conforming and makes it impossible to use cancellation safely. So does this imply that the cancellation *must* happen at some point after errno is known? Thus if a cancellation arrives and we're already in the syscall there is nothing to do but let the syscall return and let the syscall wrapper handle the cancellation. That seems reasonable to me. -- You are receiving this mail because: You are on the CC list for the bug.