From patchwork Mon Mar 19 16:13:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 10293035 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 CD2FB60385 for ; Mon, 19 Mar 2018 16:15:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4F892925F for ; Mon, 19 Mar 2018 16:15:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A9B652949A; Mon, 19 Mar 2018 16:15:24 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham 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 1D5582925F for ; Mon, 19 Mar 2018 16:15:23 +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:In-Reply-To:References: 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=ZMWfncQQWBwHjGnZc8Hmdu8OkuJJFkoU13PGKegzTPY=; b=C8zmq1DA2rrysx lNwk18yZuYM2tMDIgIBBUweIAcGca661oye8Jzyi1i39v0JotNVrDrDdrQbMN1cki5asiVxa+6HD0 9O6acTkl6ZLCyj6Wnql/Ll/sv1Fa8/bl0qrOPyWPRD9ecG/qu1ABvab421ATIVhKVQO8u1rbYDG2y PMkcniQSxH/je2u0i6c+GqpGyxfED8bt86qAtrrMhpekdEq3ziI3n7i4GECm3+2y/BssXp/WuItDy t8SaEWOl99vnNJHX43HF/XdivQp7S8hnmu9rS7pCQmOltUFLKPR+X6g35ICi0ztIQbqyYTnm//VcX E78reFiiPC3Fz7UB82ew==; 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 1exxRN-0007UV-0n; Mon, 19 Mar 2018 16:15:17 +0000 Received: from mail-dm3nam03on0092.outbound.protection.outlook.com ([104.47.41.92] helo=NAM03-DM3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1exxRB-00072d-1h for linux-arm-kernel@lists.infradead.org; Mon, 19 Mar 2018 16:15:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=58tzf2iRp4fJ+BwukcCLyyKBXTNkmyQ/SkJxEKQeI24=; b=cG1w5nYJ768HUsl3jVvelVK2Sq9Os5s0QO5i2wxZNSS17APrIbjwdvdZMqXHKztlqQrueVwLPmtp+w8vYz4UUU4w1NkNi6Lk+oZImAnniL+JD4erk223ZumW4deqoBiBa5TO1PrA0PA1Eifj60gLQka3xY+6oF89ENqSCqMBCMc= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0869.namprd21.prod.outlook.com (10.167.110.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.631.0; Mon, 19 Mar 2018 16:14:52 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62%5]) with mapi id 15.20.0631.004; Mon, 19 Mar 2018 16:14:52 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH AUTOSEL for 3.18 102/102] signal/arm: Document conflicts with SI_USER and SIGFPE Thread-Topic: [PATCH AUTOSEL for 3.18 102/102] signal/arm: Document conflicts with SI_USER and SIGFPE Thread-Index: AQHTv50/QTxftLfaWkKDDzBuWmgfpg== Date: Mon, 19 Mar 2018 16:13:41 +0000 Message-ID: <20180319161117.17833-102-alexander.levin@microsoft.com> References: <20180319161117.17833-1-alexander.levin@microsoft.com> In-Reply-To: <20180319161117.17833-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM5PR2101MB0869; 7:bO9M2eVIpWpcSy8bXK8PXlTukXmVvgbf/KV3mestg0aZvthGkH2eVwWq5q2nJZ3vXabcMz+X6U08QMdQHsP8ednn/OYhfS5jSRm0blkfOQrFzTTO2KLFcTHXrUE8vmkFgHGnAxROnZOFuPzeqT2/tExCOi0iceAATZNCGEAQzI2a2QFCH2gEH37C6FS5OaKaxN4265nksUrW9hFG2VL+LrG4PbsOTcUwhbj9rB+rHD4HlezrBdZsa1opI7vQ1068; 20:tBNF43jFNIKRxij9FSV8zcoqYolS2ShUexdG0mIPJxLHezWKT7XiQXtEqR4YrF+MlwFoIr4PXZNxx9yXRyQryHMUViJ5aGF2D0xgsuAi3eVMV12h5R3iYLkP8nKAlpsjwYF9KB87bDAduy0r2sptuuaFLhyzGIEzOG+P0ySDRFw= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 4bda4577-e78e-4fdb-a8d7-08d58db48c2c x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020); SRVR:DM5PR2101MB0869; x-ms-traffictypediagnostic: DM5PR2101MB0869: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(258649278758335)(84791874153150); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(3231221)(944501300)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011); SRVR:DM5PR2101MB0869; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB0869; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39860400002)(346002)(366004)(39380400002)(396003)(376002)(189003)(199004)(3846002)(6116002)(186003)(1076002)(53936002)(97736004)(26005)(86612001)(105586002)(2900100001)(575784001)(86362001)(66066001)(6512007)(81156014)(81166006)(68736007)(102836004)(8676002)(72206003)(966005)(4326008)(36756003)(6506007)(478600001)(3660700001)(316002)(8936002)(54906003)(14454004)(5660300001)(110136005)(76176011)(2906002)(6666003)(6486002)(2950100002)(25786009)(6306002)(10090500001)(6436002)(99286004)(107886003)(10290500003)(106356001)(22452003)(2501003)(7736002)(305945005)(59450400001)(5250100002)(3280700002)(22906009)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB0869; H:DM5PR2101MB1032.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: Jo9elsNyiHSIidEf/k4gOBFB5l4WhWatuej+F5B+Q03cYYo3UNaaAsQZehVDvqWBMDlaDJioe77sxasvya5gNSCkRDpYn56LCrmE9aaQDqFDFD67W4lmifYDi2VYirrPus7rcI00pjqW+XXRCl4iUWH3I9wQ06te15HgZeHByRsuD1hj2jaowDHSICcf0NNbY8bIQt8xXxBV/To8HguPT986phV2EReOori00rTT4t0n9t8gOMz5PzHSDsRNDA3o2VaqNx7fyZbZMv2cBJ/aIR5sYussL2MXVOtxIpoovgoBrNj2hS3F8TiPCe7DIvZUQknUO1OcXsy4F0iYVciIdw== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4bda4577-e78e-4fdb-a8d7-08d58db48c2c X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 16:13:41.5427 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0869 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180319_091505_390665_D5CEE64D X-CRM114-Status: GOOD ( 17.21 ) 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: Sasha Levin , Russell King , "Eric W. Biederman" , "linux-arm-kernel@lists.infradead.org" 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: "Eric W. Biederman" [ Upstream commit 7771c66457004977b616bab785209f49d164f527 ] Setting si_code to 0 results in a userspace seeing an si_code of 0. This is the same si_code as SI_USER. Posix and common sense requires that SI_USER not be a signal specific si_code. As such this use of 0 for the si_code is a pretty horribly broken ABI. Further use of si_code == 0 guaranteed that copy_siginfo_to_user saw a value of __SI_KILL and now sees a value of SIL_KILL with the result that uid and pid fields are copied and which might copying the si_addr field by accident but certainly not by design. Making this a very flakey implementation. Utilizing FPE_FIXME, siginfo_layout will now return SIL_FAULT and the appropriate fields will be reliably copied. Possible ABI fixes includee: - Send the signal without siginfo - Don't generate a signal - Possibly assign and use an appropriate si_code - Don't handle cases which can't happen Cc: Russell King Cc: linux-arm-kernel@lists.infradead.org Ref: 451436b7bbb2 ("[ARM] Add support code for ARM hardware vector floating point") History Tree: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git Signed-off-by: "Eric W. Biederman" Signed-off-by: Sasha Levin --- arch/arm/include/uapi/asm/siginfo.h | 13 +++++++++++++ arch/arm/vfp/vfpmodule.c | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 arch/arm/include/uapi/asm/siginfo.h diff --git a/arch/arm/include/uapi/asm/siginfo.h b/arch/arm/include/uapi/asm/siginfo.h new file mode 100644 index 000000000000..d0513880be21 --- /dev/null +++ b/arch/arm/include/uapi/asm/siginfo.h @@ -0,0 +1,13 @@ +#ifndef __ASM_SIGINFO_H +#define __ASM_SIGINFO_H + +#include + +/* + * SIGFPE si_codes + */ +#ifdef __KERNEL__ +#define FPE_FIXME 0 /* Broken dup of SI_USER */ +#endif /* __KERNEL__ */ + +#endif diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c index 2f37e1d6cb45..b646400bfb0e 100644 --- a/arch/arm/vfp/vfpmodule.c +++ b/arch/arm/vfp/vfpmodule.c @@ -261,7 +261,7 @@ static void vfp_raise_exceptions(u32 exceptions, u32 inst, u32 fpscr, struct pt_ if (exceptions == VFP_EXCEPTION_ERROR) { vfp_panic("unhandled bounce", inst); - vfp_raise_sigfpe(0, regs); + vfp_raise_sigfpe(FPE_FIXME, regs); return; }