From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9108 invoked by alias); 17 Feb 2012 16:37:55 -0000 Received: (qmail 8961 invoked by uid 22791); 17 Feb 2012 16:37:53 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 17 Feb 2012 16:37:42 +0000 From: "carlos at systemhalted dot org" To: glibc-bugs@sources.redhat.com Subject: [Bug nptl/13690] pthread_mutex_unlock potentially cause invalid access Date: Fri, 17 Feb 2012 16:37: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-Keywords: glibc_2.15 X-Bugzilla-Severity: normal X-Bugzilla-Who: carlos at systemhalted dot org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: carlos at systemhalted dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2012-02/txt/msg00164.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=13690 Carlos O'Donell changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at redhat dot com --- Comment #14 from Carlos O'Donell 2012-02-17 16:36:54 UTC --- Nemoto-san, The patch looks good to me. My only worry is that the performance of the robust unlock fast path is impacted. I notice that PTHREAD_ROBUST_MUTEX_PSHARED always returns LLL_SHARED. Therefore it would be optimal if instead of a temporary we just passed down LLL_SHARED (a constant). I don't know why glibc has the PTHREAD_ROBUST_MUTEX_PSHARED macro. The code comment says: ~~~ /* The kernel when waking robust mutexes on exit never uses FUTEX_PRIVATE_FLAG FUTEX_WAKE. */ #define PTHREAD_ROBUST_MUTEX_PSHARED(m) LLL_SHARED ~~~ Which appears to imply that at some point in the future it might not always return LLL_SHARED. Therefore your patch is correct. Can you verify that the instruction sequences generated are identical given the optimization level -O2 used to compile glibc? -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.