From patchwork Wed Oct 7 16:23:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 527365 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id CBF5B1402B4 for ; Thu, 8 Oct 2015 03:24:41 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=NkspG/xC; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=ir5kTDanJOGkMdcNOT6PLdiLH3hom/m cXjtB0mr8VA0dhZ8z7cHWVHLzpteyLBX7SBx2KtS8V4KisgazIVSdPp1+oopj0Mr YG2dU8Y6EuqZvBvcsnL0FlWwaz2utAAdNS0/quFGzGqz5oRvOnRSy8DjmuSWLJ6a eTjSvYkuaThE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=5i07upL2Pydfx8KlYX96Gan74IE=; b=NkspG /xCoRxSUe2+vikMGvGIjM+YngLCACsipLazVPd3kxKqFlS0xoehbQFPuHNa+D9QQ W3GMORm/caajH/7Dn02Ex9gRy7bFIIhoTaC5Z4VK8FBz15WH6IbbOGq6QehHFlCb 7dRmy1JCUfbdhyspZF0rOfo7sa1xZ3IW4Vzdr4= Received: (qmail 105678 invoked by alias); 7 Oct 2015 16:23:38 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 105591 invoked by uid 89); 7 Oct 2015 16:23:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yk0-f177.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DSE2+ReOR+D9ih1vSnDn7Ptf1Bop2BHua1Q7MulTgSo=; b=jsqqd1SvhasiFYGLqCX7yVRkiV/pjUThQ5JZPU/DzdtW1qXUNDouc6MKQjNI3j/0u9 cGtNAXnS4JfvaCXYRQnpKxuGyqO0iN/hNv6JWvZ+aKH0/HN0VfLqOps+atjef/QYkLZI X6smOkbgjPy+eQFBERnFxISfuzuLz5gA8T7OFNgtd++5NPkn/gweRJ0JeebCcI6Rte0L vb/7SEieGw5yFvP3uFWV7F2zJLSXHueGvrHLhZ9lo0TLoI9CAxx43BqdG2iNi/Jo7RxG 76OHSTIFJl4rr1oNWBCf20GyhUMgUNd1uF/2Hb2Tz5C3bJ5dbT/FgQUcXafrhQtgIRZL eZPQ== X-Gm-Message-State: ALoCoQnjqxbsJXYj46mdbz3b5D0ImGs80xsn/DAbU6KbvZuInLXPh44vG6ZgpJhDAdaNP3ljjGbV X-Received: by 10.129.133.195 with SMTP id v186mr1578419ywf.40.1444235012392; Wed, 07 Oct 2015 09:23:32 -0700 (PDT) From: Adhemerval Zanella X-Google-Original-From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Adhemerval Zanella Subject: [PATCH 07/13] nptl: x32: Fix Race conditions in pthread cancellation (BZ#12683) Date: Wed, 7 Oct 2015 13:23:09 -0300 Message-Id: <1444234995-9542-8-git-send-email-adhemerval.zanella@linaro.com> In-Reply-To: <1444234995-9542-1-git-send-email-adhemerval.zanella@linaro.com> References: <1444234995-9542-1-git-send-email-adhemerval.zanella@linaro.com> From: Adhemerval Zanella This patches adds the x32 modification required for the BZ#12683 fix. It basically adjust the syscall size used to pass the arguments to the syscall cancel wrappers. Checked on x32. * sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h (__syscall_arg_t): Define type for x32. (__SSC): Add platform specific macro. --- ChangeLog | 4 ++++ sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/ChangeLog b/ChangeLog index 54dfca3..b71c168 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2015-10-07 Adhemerval Zanella + * sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h (__syscall_arg_t): + Define type for x32. + (__SSC): Add platform specific macro. + * sysdeps/unix/sysv/linux/x86_64/cancellation.S: Remove file. * sysdeps/unix/sysv/linux/x86_64/libc-cancellation.S: Remove file. * sysdeps/unix/sysv/linux/x86_64/librt-cancellation.S: Remove file. diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h b/sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h index 2324168..f2dc8f0 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h +++ b/sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h @@ -18,6 +18,27 @@ #ifndef _LINUX_X32_SYSDEP_H #define _LINUX_X32_SYSDEP_H 1 +#ifndef __ASSEMBLER__ +#include + +typedef long long int __syscall_arg_t; + +/* Syscall arguments for x32 follows x86_64 size, however pointers are 32 + bits in size. This suppress the GCC warning "cast from pointer to + integer of different size" when calling __syscall_cancel with + pointer as arguments. */ +# define __SSC(__x) \ + ({ \ + __syscall_arg_t __ret; \ + DIAG_PUSH_NEEDS_COMMENT; \ + DIAG_IGNORE_NEEDS_COMMENT (4.7, "-Wpointer-to-int-cast"); \ + __ret = (sizeof(1 ? (__x) : 0ULL) < 8 ? \ + (unsigned long int) (__x) : (long long int) (__x)); \ + DIAG_POP_NEEDS_COMMENT; \ + __ret; \ + }) +#endif + /* There is some commonality. */ #include #include