Received: by 10.223.176.5 with SMTP id f5csp975137wra; Sat, 3 Feb 2018 14:55:32 -0800 (PST) X-Google-Smtp-Source: AH8x226iyDcdbAr48l2MkCdqSiaNQenn59ch6OzliyigRoeFXFeC6FE0InVyNu/vBBHvTNTYOeDA X-Received: by 10.98.222.198 with SMTP id h189mr44864117pfg.150.1517698532083; Sat, 03 Feb 2018 14:55:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517698532; cv=none; d=google.com; s=arc-20160816; b=zx0r6HitWBS4St4zGN68Jf7mSj9zPHdIqext+NoWLqujGYeSGlKod3K/iKqmujyPXm 1RIkNAzUPT9DXMzpAldUSixhrOWYJpRG8Zz+QovjmnL6J4RNKHFhS9YdcSY4cG5TSAoZ 04k4zL7yPZPdun1ryOHuqLl3dtaHpdYI4QvKzWavBuITTGSEJOEsdFrf59Iotx8pd4/q GCyIg06PyDvNQ1W7pd01aqyvsEF/HDoheArO8WuAPtppNWvB9ReNtEdPRWiAE9WG1mj4 hH3LDSrqFRzzSNffFghwMuMwkRTxUE8J/UAkKB0/osjGArdDC6cnKmzCcYWoyNfBi/CL DW/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=6njxDIPcFziSstrzVBdN6ej4VdumDKtniU3N6nlgk7M=; b=R5sQcegjvnBQgIs9c+ARUveG7VgcAdVGJd1nc08xUSViR10JhmymB1UEgRN+KnyViq cshMJaWpKJfy4mdpc2Sc9X1BF8OemYrujfx0/OrIf7mUM4x1U4nr4OJMMv8MsA1S37xd YMdx2wJraBFDYFurgAP700Rjwb779jN48Xk0kxqVJeCMrDD9hYRNyI0T2S66m0f7042m TLlBO6X8xYb/IV8lgpiHqrZZvpq8GbxeGC2lFuEOEux30qYdXgcbOW0RpPPn/N0bUC1L 0iw9d8/fBfAtof0ERKdOEKV2hI+j1x6Z1pdV8EnOwsAPeodPePAwkHdOxsq7xo2xGQc5 /uSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=R5QK4GIl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d8si4314123pfh.120.2018.02.03.14.55.17; Sat, 03 Feb 2018 14:55:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=R5QK4GIl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755427AbeBCStE (ORCPT + 99 others); Sat, 3 Feb 2018 13:49:04 -0500 Received: from mail-bn3nam01on0138.outbound.protection.outlook.com ([104.47.33.138]:24890 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752910AbeBCSBa (ORCPT ); Sat, 3 Feb 2018 13:01:30 -0500 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=6njxDIPcFziSstrzVBdN6ej4VdumDKtniU3N6nlgk7M=; b=R5QK4GIlygrN3Ll5OnNShiz2jOqZaGIVxokBmdh52W4U+S4zQQjNJY/bcjkhqxCb4Nfsub44/o/vhKQWbcnHCv+9pcpIwi25tbGsJB0FAcwwKcDzuvKpYTXU5cCPClDTPtZGtdm4dRLoKeLVWUldeJUXTZVqjn4VDpWlbpiBXgE= Received: from BL0PR2101MB1027.namprd21.prod.outlook.com (52.132.20.161) by BL0PR2101MB1043.namprd21.prod.outlook.com (52.132.24.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.506.3; Sat, 3 Feb 2018 18:00:37 +0000 Received: from BL0PR2101MB1027.namprd21.prod.outlook.com ([fe80::a8da:b5d9:d710:9bf9]) by BL0PR2101MB1027.namprd21.prod.outlook.com ([fe80::a8da:b5d9:d710:9bf9%3]) with mapi id 15.20.0485.006; Sat, 3 Feb 2018 18:00:37 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Chunyan Zhang , Lvqiang Huang , Russell King , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 017/110] ARM: 8731/1: Fix csum_partial_copy_from_user() stack mismatch Thread-Topic: [PATCH AUTOSEL for 4.14 017/110] ARM: 8731/1: Fix csum_partial_copy_from_user() stack mismatch Thread-Index: AQHTnRjjTbkAdJrzLEmc1dyOk2NAug== Date: Sat, 3 Feb 2018 18:00:34 +0000 Message-ID: <20180203180015.29073-17-alexander.levin@microsoft.com> References: <20180203180015.29073-1-alexander.levin@microsoft.com> In-Reply-To: <20180203180015.29073-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;BL0PR2101MB1043;7:Zf+RGXWafjSWKvVstWhYEtlQUuQYS2DG2+V3LY3Jt1IEwuspfPiDrko6th/E9V83hWzN03rJovMSlSiqERUzzcMOCydzMwDed/X11jRSxi6fqZbb6wJKWhRUInkwFBGvh5eMON1HaAM6r/PqkmN1EuJ1uKMl1949q5peWtO2Yuy7H394KEMUPEXew9/LSd94XGj9cWW9JRcitcOVDHuOttYYVoT/IqJ8VNujfTlk0SZBy82FJlP1LzgEiyIbm+zY x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 4999b8dc-70b6-4548-49e6-08d56b3007a2 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(2017052603307)(7193020);SRVR:BL0PR2101MB1043; x-ms-traffictypediagnostic: BL0PR2101MB1043: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(85827821059158); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(6040501)(2401047)(5005006)(8121501046)(3231101)(2400082)(944501161)(93006095)(93001095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(6072148)(201708071742011);SRVR:BL0PR2101MB1043;BCL:0;PCL:0;RULEID:;SRVR:BL0PR2101MB1043; x-forefront-prvs: 05724A8921 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39380400002)(376002)(39860400002)(366004)(346002)(396003)(189003)(199004)(59450400001)(10290500003)(186003)(6486002)(14454004)(1076002)(102836004)(6506007)(76176011)(26005)(6346003)(66066001)(10090500001)(5250100002)(36756003)(6512007)(2501003)(110136005)(99286004)(54906003)(478600001)(53936002)(72206003)(6436002)(316002)(305945005)(7736002)(6666003)(2950100002)(2906002)(5660300001)(4326008)(106356001)(575784001)(86362001)(97736004)(25786009)(22452003)(39060400002)(2900100001)(3846002)(107886003)(8676002)(8936002)(6116002)(3280700002)(105586002)(81156014)(81166006)(3660700001)(86612001)(68736007)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:BL0PR2101MB1043;H:BL0PR2101MB1027.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: KwjSuhvJ1V5t3tGR/o4XXKMJ8d+OygZ2nXun+daUu3JYjrLa9qwzqyGeNoJIjZJKS9CLtbjdmtyIFJ3M2JixJw== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4999b8dc-70b6-4548-49e6-08d56b3007a2 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Feb 2018 18:00:34.9721 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR2101MB1043 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chunyan Zhang [ Upstream commit 36b0cb84ee858f02c256d26f0cb4229c78e3399e ] An additional 'ip' will be pushed to the stack, for restoring the DACR later, if CONFIG_CPU_SW_DOMAIN_PAN defined. However, the fixup still get the err_ptr by add #8*4 to sp, which results in the fact that the code area pointed by the LR will be overwritten, or the kernel will crash if CONFIG_DEBUG_RODATA is enabled. This patch fixes the stack mismatch. Fixes: a5e090acbf54 ("ARM: software-based priviledged-no-access support") Signed-off-by: Lvqiang Huang Signed-off-by: Chunyan Zhang Signed-off-by: Russell King Signed-off-by: Sasha Levin --- arch/arm/lib/csumpartialcopyuser.S | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/lib/csumpartialcopyuser.S b/arch/arm/lib/csumpartialc= opyuser.S index 1712f132b80d..b83fdc06286a 100644 --- a/arch/arm/lib/csumpartialcopyuser.S +++ b/arch/arm/lib/csumpartialcopyuser.S @@ -85,7 +85,11 @@ .pushsection .text.fixup,"ax" .align 4 9001: mov r4, #-EFAULT +#ifdef CONFIG_CPU_SW_DOMAIN_PAN + ldr r5, [sp, #9*4] @ *err_ptr +#else ldr r5, [sp, #8*4] @ *err_ptr +#endif str r4, [r5] ldmia sp, {r1, r2} @ retrieve dst, len add r2, r2, r1 --=20 2.11.0