From patchwork Mon Aug 31 21:11:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 52901 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by patches.linaro.org (Postfix) with ESMTPS id B22C32127E for ; Mon, 31 Aug 2015 21:11:30 +0000 (UTC) Received: by lbck9 with SMTP id k9sf42369273lbc.0 for ; Mon, 31 Aug 2015 14:11:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mailing-list:precedence:list-id :list-unsubscribe:list-subscribe:list-archive:list-post:list-help :sender:delivered-to:from:subject:to:message-id:date:user-agent :mime-version:content-type:content-transfer-encoding :x-original-sender:x-original-authentication-results; bh=3DDovIRc5sAQV0u3NDYif48imW/PEKlWyxEOmarYyIQ=; b=MqdUyo1IhCD1LLoXafxKqWT0SV8nS4kOn9FFOtl3SfT6W5hboKuzQoosiL7NS2ytKG 8VNWUyLeFO5VMVZroiHPH1por8G+zqaBUBlEJRQQQiQIM1Ommxzvu/hhoe3g90IUSI0+ H8ERdndJ7uJ73JAhs0w0AuEk33ZZ6jmA2cBYv2LsHkyjiKpdY8LmwDFVLOCfW54ejjlh F7AZkToDflq8TrSlTPtrAm/CekMQodNrD4XVR8VmtxN1AWjNfbW/f2Pb3K9GcmIeHIIF jtj0g3+dr9YUlZR/E7iYPxYOwqK634FneCk2dYHffCIMmyhG9fD/t2DaEweEqH667q0I 3pIw== X-Gm-Message-State: ALoCoQkNJH73H+R+CzeOVuQ6qi4jGsNbdJPduQVru/QwpByuQ/+1gZHw21e8ysXplPk0VgHmIb78 X-Received: by 10.180.83.101 with SMTP id p5mr149202wiy.2.1441055489676; Mon, 31 Aug 2015 14:11:29 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.201 with SMTP id s9ls523598laj.40.gmail; Mon, 31 Aug 2015 14:11:29 -0700 (PDT) X-Received: by 10.152.219.3 with SMTP id pk3mr11464374lac.114.1441055489508; Mon, 31 Aug 2015 14:11:29 -0700 (PDT) Received: from mail-la0-x22f.google.com (mail-la0-x22f.google.com. [2a00:1450:4010:c03::22f]) by mx.google.com with ESMTPS id pf2si14522638lbc.2.2015.08.31.14.11.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Aug 2015 14:11:29 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::22f as permitted sender) client-ip=2a00:1450:4010:c03::22f; Received: by laba3 with SMTP id a3so79533977lab.1 for ; Mon, 31 Aug 2015 14:11:29 -0700 (PDT) X-Received: by 10.112.219.70 with SMTP id pm6mr11210376lbc.41.1441055489407; Mon, 31 Aug 2015 14:11:29 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.164.42 with SMTP id yn10csp91793lbb; Mon, 31 Aug 2015 14:11:28 -0700 (PDT) X-Received: by 10.67.30.232 with SMTP id kh8mr41423548pad.36.1441055488383; Mon, 31 Aug 2015 14:11:28 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id s1si26081436pdo.147.2015.08.31.14.11.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Aug 2015 14:11:28 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-62839-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 53025 invoked by alias); 31 Aug 2015 21:11:18 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list 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 52874 invoked by uid 89); 31 Aug 2015 21:11:16 -0000 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-qk0-f177.google.com X-Received: by 10.129.86.5 with SMTP id k5mr23829545ywb.156.1441055470889; Mon, 31 Aug 2015 14:11:10 -0700 (PDT) From: Adhemerval Zanella Subject: [PATCH 04/08] nptl: x32: Fix Race conditions in pthread cancellation, (BZ#12683) To: GNU C Library Message-ID: <55E4C2EC.9070902@linaro.org> Date: Mon, 31 Aug 2015 18:11:08 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 X-Original-Sender: adhemerval.zanella@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::22f as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@sourceware.org X-Google-Group-Id: 836684582541 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. --- * sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h (__syscall_arg_t): Define type for x32. (__SSC): Add platform specific macro. -- 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