From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 49916 invoked by alias); 7 May 2018 02:49:22 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 49756 invoked by uid 89); 7 May 2018 02:49:12 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=presents, HContent-Transfer-Encoding:8bit X-HELO: mailbackend.panix.com From: Zack Weinberg To: libc-alpha@sourceware.org Cc: adhemerval.zanella@linaro.org Subject: Re: [PATCH v2 06/21] nptl: i386: Fix Race conditions in pthread cancellation (BZ#12683) Date: Mon, 07 May 2018 02:49:00 -0000 Message-Id: <20180507024909.5598-5-zackw@panix.com> In-Reply-To: <20180507024909.5598-1-zackw@panix.com> References: <20180507024909.5598-1-zackw@panix.com> MIME-Version: 1.0 In-Reply-To: <1519679016-12241-7-git-send-email-adhemerval.zanella@linaro.org> References: <1519679016-12241-7-git-send-email-adhemerval.zanella@linaro.org> Content-Transfer-Encoding: 8bit X-SW-Source: 2018-05/txt/msg00161.txt.bz2 On 26 Feb 2018, Adhemerval Zanella wrote: > This patch adds the i386 modifications required for the BZ#12683. > It basically provides the required ucontext_get_pc symbol, add the > cancelable syscall wrapper and fix a thread atomic update macro. This also seems fine. > On i386 an arch-specific cancellation implementation is required > because depending of the glibc configuration and underlying kernel > the syscall may be done using a vDSO symbol (__kernel_vsyscall). ... > Also, since glibc supports i486, the old 'int 0x80' should be used > in the syscall wrapper. One option could make minimum default chip > to pentium II (which implements sysenter) or add a runtime check > on syscall_cancel.S to use 'int 0x80' or sysenter. If I remember correctly, there can be only one 'sysenter' instruction in the entire user address space, due to awkward limitations of the interface it presents to the kernel. That was why __kernel_vsyscall was added in the first place. We can probably live with using int 0x80 for these syscalls that may well be blocking anyway. > Similar to x86_64, it also remove bogus arch-specific > THREAD_ATOMIC_BIT_SET where it always reference to current thread > instead of the one referenced by input 'descr' argument. Same comment as for x86_64 -- shouldn't we get rid of or repair _all_ of the THREAD_ATOMIC_ macros that don't honor their arguments? zw