From patchwork Tue May 15 19:11:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 10401805 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 12307601C8 for ; Tue, 15 May 2018 19:13:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F372E283CA for ; Tue, 15 May 2018 19:13:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E4CE9283FE; Tue, 15 May 2018 19:13:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 627DC283CA for ; Tue, 15 May 2018 19:13:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kdIvzLR/O730NrNPUqLz15jEJt+lYOCbzBl0cV8sXTM=; b=S63e5IZTa94XTg lJXECCBzJ+eDqzlxPr9GkD5k6y5ew+IR+v2f3VjxPrQ7Osa3L96FQlF0sIUSYyzZob0W/jtX0GWgC mpSeczsN2zJFc+MDFnsSJqHu2f85r4u/r1LaAz24uJmt6mv/PKttxUNm7GjwcWZPupoBsXtpiLAbY khmjosDdYBjAUeF0WEMvnxtn8LDlEv3sub06kTMw9AjXgK5oQFGIySB8mu9tqnaq0vpvM7JPgH0RK Vu4oPEqTRUSGUVJNCf0xs8a/OPd4GnfOd6rOdiZfCU1Xn7oXGr2vjcZZs2ZekETEw6EPOjrA9Y8WK 2WB1+msZ06yvUa0Th2aw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fIfOK-0003ia-Fl; Tue, 15 May 2018 19:13:44 +0000 Received: from mail-dm3nam03on061e.outbound.protection.outlook.com ([2a01:111:f400:fe49::61e] helo=NAM03-DM3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fIfNy-0003TB-0O for linux-arm-kernel@lists.infradead.org; Tue, 15 May 2018 19:13:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ma0XO2HWpcljBiR7egq6djO2xKQ5/XsPHuHr91JSZNg=; b=QOvClRbsouM7QMzn3MlaR7Vk4OjmN+YoNgvD/XRYFY66g6tLM/CJOePAHy8+hYfN7KsHLuiNcVvIWlngSZiDJgneW4KtylAeCja6jNgMr8y2F/fAiwmPjppRFuB9Rcw0UwWGCTJixgR46Tavl+DA2ludSdZZlg0v/OkKtkubowk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@cavium.com; Received: from localhost (176.59.40.107) by SN6PR07MB4382.namprd07.prod.outlook.com (2603:10b6:805:58::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.755.16; Tue, 15 May 2018 19:13:06 +0000 From: Yury Norov To: Catalin Marinas , Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org Subject: [PATCH 02/24] ptrace: Add compat PTRACE_{G,S}ETSIGMASK handlers Date: Tue, 15 May 2018 22:11:52 +0300 Message-Id: <20180515191214.5045-3-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180515191214.5045-1-ynorov@caviumnetworks.com> References: <20180515191214.5045-1-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [176.59.40.107] X-ClientProxiedBy: HE1PR0301CA0013.eurprd03.prod.outlook.com (2603:10a6:3:76::23) To SN6PR07MB4382.namprd07.prod.outlook.com (2603:10b6:805:58::13) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB4382; X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB4382; 3:p5WU0iYBjGAJcBiVxFUOOf4eDTye6HVXFjQcS6B3j+2wA8FMO4M7cLndhwf5vY4IJjls7r9LzVq4patHeYpuXVDKbWveLYg5PaOXdghS1l5+/6s9m3rVNMgV7qjVo0nf+61qJ11Rlhli2QHDp85sRbRqkMpmUYUO0Ez3a02TmSRCKAjChbiqjZbygThHIZtf5/KqTncdkK3Rr6kN+SID/F44kh9l5Xnj+kahFy5hkp5u3GCI1aVtx5ndVMAHMTVd; 25:9udHVZS12KmKAwITnRACsR5pYPug8w0QYPSWEuB2gS5IhYqeDvKoGf0I2eS7IjKa2tjzRv/qVtT7AfxsdOSyQRVt94SvwvEnheuWMNqBQ/uiz9r3o8BWUpCUq8hZnLv3koD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yhjcGo77aDtyfRnPGu9dEcctE6BminUlddneMAtzwe/7/Nym+VDXANOI= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(50582790962513)(788757137089); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(93006095)(3002001)(10201501046)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(6072148)(201708071742011); SRVR:SN6PR07MB4382; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB4382; X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB4382; 4:xV30ieoZhuBubCsxITLWKQDEPotAcHU9RC0gHYDk0E7xKQjNLZmmMh0msIdK0zolmz0RuHmSvYpN0y56k3Yr8DFPgJGr9xamawZmJqzB33LWT97GkNkkQWOkiL3wtU2A850I4wpk6d8DpywZxCsSjlfPUnjBSX6BYhN2fwc7D8VLfngI0YRDg0BiDZqMAcZ8w1yBU5joEJnbaj2xSzHjftznbcg7ke8IfwulQTUXavbxT3PryFCFSfPYOCRHu1Er87dd90YFqQbaAK42VFbKZYhtPJhMYOFhVHuNTzebm7cBJrkBOFdyQuMpSUwA4R0XLRMcgUon98dROY80pfIrL3Qj+4y15IVYr0PxDFZdSjJq9Om0UptGpouzTUzGs/Bf X-Forefront-PRVS: 0673F5BE31 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(396003)(39380400002)(376002)(39850400004)(346002)(366004)(189003)(199004)(97736004)(476003)(6496006)(486006)(42882007)(50466002)(7406005)(53936002)(7416002)(3846002)(6116002)(26005)(1076002)(956004)(2616005)(6666003)(11346002)(66066001)(446003)(47776003)(48376002)(4326008)(39060400002)(76506005)(2906002)(68736007)(51416003)(54906003)(305945005)(50226002)(110136005)(16586007)(105586002)(7736002)(478600001)(72206003)(106356001)(52116002)(5660300001)(186003)(16526019)(6486002)(25786009)(36756003)(8936002)(81156014)(81166006)(8676002)(59450400001)(316002)(386003)(76176011)(142933001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB4382; H:localhost; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN6PR07MB4382; 23:586exUqqGPlQQXRV38ogAet9jZ66w0aCbaGhpaLQa?= =?us-ascii?Q?1xSMI9+PYl9Zh9XkD3wPn3AP0bleQrx8qBd9YSgYZeyk1a3oJL1baR78oq2i?= =?us-ascii?Q?sFt9HjaBDk2fZuaqFIDF3r9S5smIo+bccDjRzCTV3Uhu8lxfKCEcjBGx/B0v?= =?us-ascii?Q?DpsTaamnLc9rF0LWrdqKM3tZeYFynfsXbvmahOtgINCxj9xa6h0kmZgWLf//?= =?us-ascii?Q?fn1Vkg5klKca7TmjHZbXgpU6LTbiRgmeDDbObj9W+z/gV3TUjKNq01itH4Zx?= =?us-ascii?Q?7wHuXimD6qbCKXdBr5WfLSGCx9xixLi3JhixGs6HwI1Hlm+bYEQciuVjoCXq?= =?us-ascii?Q?4QXGEcA0fZCmXPkIdfdUaYUzMHFwKK7IUNeXYlklLbugkBG/qnjzWU4DkYVk?= =?us-ascii?Q?ssHP8WPsyLtRNmVtcPD/dV9d9se/WVWF+ww9if+puFASr9+ZFwe+7HfroyIu?= =?us-ascii?Q?MZG+CRbzxaLlkXQj90INHLQsaXbi1Z+HwFXmfkWpWATp6SJg5QUj9FAHU1T9?= =?us-ascii?Q?cDr4dIv1DQGyxTM/UkqOg7T3qzQzEzoSnaImSTsGoGM93X4oh9PMPFTmuMsf?= =?us-ascii?Q?xln5jtG4YsmDBG8lDGliqeyJKmTP3Z0ySQBqTFhUmI5fuq0nLuRdmf3dMoFs?= =?us-ascii?Q?Za4fpU/0oKX0fC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igVG3yCBG7p49kZ+PegFVwszFQnPP2k28wpqpPhE X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB4382; 6:MYjWK3v224mFc2xMHmQnce4QVaOueJdiIMOwbpgTF9GzhmPOevUqK9sX8B9z54WF/2Clfd94WEbGkdb9Fd9OtCIqqGYiL1Df5pkZwNq+Pv5H6isYqg02H+wmseD3nCVX67KIQ6VqlaorxhDd6gcVeee1Nwk47NWv3MNdkgyk0oC1gwm6ODXWySl70HyD0OQSLwf1gPE5Te7vYAM61eyhWbMTNebwWXWDvkSGsPyE6QAOQApBNG/8sEkbvTQuJn6udQo2LHFwZ4Z7lYPNL80zfaWvEO9PbsPn3mlpLzLZ5GpUNGAyfUwj4E3vhwDuHrCrz6Eu+yoOgrWEaCesHF6lXE/F4OmGNX6h5g9/x+acVN62l64AKo93Pr69jOJTKgXPDTugd/HUr1WC3+XldlsjHqx21+a9R5PwN7t0/ghrltKuRaaSWuzpz7KEiAh/6HnUw4VuQEyU31M4q0ie7ItsnA==; 5:ytqIJrzI7X24Mc74qHanOTltfpfCkn2ICC1DuRhoktHJ9LzelxfiTWX4iTH4uo40Xzu94J1XMTkoi8nQBBorvxOu9I+y7gWSiXOVHQ7XibgrPEW8Q3PLKXSJLLV+/jrB2XjRs/usjkTjPvNxFfgiIgYxTJYr9bEtM2YLRQTxj6E=; 24:zwOIV1fcXXJjKSdPnmddQMLFualwdg5cqBAzrciT7arfnsedAa4IDAMCI/cfN14C5cO81AT0bY2mq6++qVM+tUqm8TLqHOuqbvC7kJBnxVY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB4382; 7:EpzlGLa6mYskLqedSKGdz6XSPb7Dy9iPYWzCzhjXrAy/ssE0+pWMHhkeL8WjFaPZst6GZBop+xac7xFlgQtgqtp1sss+lFOKf2FZ4116l7jxNSqriAIAvckhVWYZaPnGYbZkp0iX0HxGkDlFAFbCuANnnHEiR2O5xAYBtsFNUGxSp8jMQwrxnNVRY3AaIw6f4UN6ezE8YroNfSHc2VqaaqE82wznQWrD9zslGbWmscOyQB3YVZtZ8SKen7dk8jvH X-MS-Office365-Filtering-Correlation-Id: a754a454-dd22-4c66-9360-08d5ba97e438 X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 May 2018 19:13:06.7439 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a754a454-dd22-4c66-9360-08d5ba97e438 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB4382 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180515_121322_157119_21425614 X-CRM114-Status: GOOD ( 11.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Szabolcs Nagy , Heiko Carstens , Yury Norov , Philipp Tomsich , Joseph Myers , Zhou Chengming , Steve Ellcey , Prasun Kapoor , Andreas Schwab , Alexander Graf , Bamvor Zhangjian , Geert Uytterhoeven , Dave Martin , Adam Borowski , Manuel Montezelo , James Hogan , Chris Metcalf , Andrew Pinski , Lin Yongting , Alexey Klimov , Mark Brown , Maxim Kuvyrkov , Florian Weimer , Andrey Vagin , Nathan_Lynch , James Morse , Ramana Radhakrishnan , Martin Schwidefsky , "David S . Miller" , Christoph Muellner Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: James Morse compat_ptrace_request() lacks handlers for PTRACE_{G,S}ETSIGMASK, instead using those in ptrace_request(). The compat variant should read a compat_sigset_t from userspace instead of ptrace_request()s sigset_t. While compat_sigset_t is the same size as sigset_t, it is defined as 2xu32, instead of a single u64. On a big-endian CPU this means that compat_sigset_t is passed to user-space using middle-endianness, where the least-significant u32 is written most significant byte first. If ptrace_request()s code is used userspace will read the most significant u32 where it expected the least significant. Instead of duplicating ptrace_request()s code as a special case in the arch code, handle it here. Fixes: 29000caecbe87 ("ptrace: add ability to get/set signal-blocked mask") CC: Andrey Vagin Reported-by: Zhou Chengming Signed-off-by: James Morse Yury: Replace sigset_{to,from}_compat() with new {get,put}_compat_sigset() Signed-off-by: Yury Norov --- kernel/ptrace.c | 48 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/kernel/ptrace.c b/kernel/ptrace.c index 21fec73d45d4..214944d7c268 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c @@ -880,6 +880,22 @@ static int ptrace_regset(struct task_struct *task, int req, unsigned int type, EXPORT_SYMBOL_GPL(task_user_regset_view); #endif +static int ptrace_setsigmask(struct task_struct *child, sigset_t *new_set) +{ + sigdelsetmask(new_set, sigmask(SIGKILL)|sigmask(SIGSTOP)); + + /* + * Every thread does recalc_sigpending() after resume, so + * retarget_shared_pending() and recalc_sigpending() are not + * called here. + */ + spin_lock_irq(&child->sighand->siglock); + child->blocked = *new_set; + spin_unlock_irq(&child->sighand->siglock); + + return 0; +} + int ptrace_request(struct task_struct *child, long request, unsigned long addr, unsigned long data) { @@ -951,18 +967,7 @@ int ptrace_request(struct task_struct *child, long request, break; } - sigdelsetmask(&new_set, sigmask(SIGKILL)|sigmask(SIGSTOP)); - - /* - * Every thread does recalc_sigpending() after resume, so - * retarget_shared_pending() and recalc_sigpending() are not - * called here. - */ - spin_lock_irq(&child->sighand->siglock); - child->blocked = new_set; - spin_unlock_irq(&child->sighand->siglock); - - ret = 0; + ret = ptrace_setsigmask(child, &new_set); break; } @@ -1181,6 +1186,7 @@ int compat_ptrace_request(struct task_struct *child, compat_long_t request, { compat_ulong_t __user *datap = compat_ptr(data); compat_ulong_t word; + sigset_t new_set; siginfo_t siginfo; int ret; @@ -1221,6 +1227,24 @@ int compat_ptrace_request(struct task_struct *child, compat_long_t request, else ret = ptrace_setsiginfo(child, &siginfo); break; + case PTRACE_GETSIGMASK: + if (addr != sizeof(compat_sigset_t)) + return -EINVAL; + + ret = put_compat_sigset((compat_sigset_t __user *) datap, + &child->blocked, sizeof(compat_sigset_t)); + break; + case PTRACE_SETSIGMASK: + if (addr != sizeof(compat_sigset_t)) + return -EINVAL; + + ret = get_compat_sigset(&new_set, + (compat_sigset_t __user *) datap); + if (ret) + break; + + ret = ptrace_setsigmask(child, &new_set); + break; #ifdef CONFIG_HAVE_ARCH_TRACEHOOK case PTRACE_GETREGSET: case PTRACE_SETREGSET: