Received: by 10.223.164.202 with SMTP id h10csp2518305wrb; Mon, 27 Nov 2017 19:05:44 -0800 (PST) X-Google-Smtp-Source: AGs4zMbXwJRU9j8Y1IaiW3D4S6aGlR4S80dBUD3aBWkNiZvZSz1G7B78uqzH7Vbh5nQqTYsp+0I5 X-Received: by 10.99.151.2 with SMTP id n2mr38856192pge.382.1511838344602; Mon, 27 Nov 2017 19:05:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511838344; cv=none; d=google.com; s=arc-20160816; b=QY+Jb3SSI/+SxWXf9tnx0INJV99aO9rANJV2Lm9g9M7nz1WRzgR8CV9kW9IpBJklgV bB09jy2ENrN3kZSmjcyI7jXRYUXAqKshwEfNmwwyurF73QDQ8Yqgvrc+DprKIOnXIjQ/ DRa/zf+zj8jkL8/xt1WdGR1fjXCXeV4Lyu9f9eKcpNPBnKdj0aUtTj6qW91NM2JWTeYe J657JQsKU8osEEK0fTkc9bGSeGunjJr6yGbdyUZbKt9xw4yVwIAdnU0M+4+N+KX4jSU+ XfW9uArr7mKMs2WODGIpuMtjAFfCPiCks0FC8yor2+vfV2ivRWkX3Rr8mQ1zSeA8n1qt Y2bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=FmTHOV3otFtb4wdqFRmgNjh1PFIcvPwBbzX3HG7hAyU=; b=JK4F9NGP9DmoHljKsHzwCmzt60Wj+egfwjNORPk8iFgFtw6YBnFkPLLkRvQFFwnelJ GDiMYEOmTmK3IgHwmES2xOOwHzHiusg5Ql8Z6N4eMg7P9YY7onCXWThB/Q/qzNj+lSTy pbwGk/mCQHknNo1VEeJNiwSOn3iCWiSH8LC5IathXh50MCfphNbt+wvH3JpN0qSA+dJ8 lL17rDA3tlxmgrWHLOQ8166faSS1uwVe8AEwoZ7ezBavlR+pfklC85a5QYH2CPpzIdVv zyZBCHm3MlZ+mVKBJhPW1AKelBdHQHJWl6FEscIgnEC/y9HgvAQAgAMaK6u/6y7hoKzE /6OA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y34si3222641plb.377.2017.11.27.19.05.30; Mon, 27 Nov 2017 19:05:44 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751717AbdK1DEu (ORCPT + 78 others); Mon, 27 Nov 2017 22:04:50 -0500 Received: from sci-ig2.spreadtrum.com ([222.66.158.135]:61407 "EHLO SHSQR01.spreadtrum.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751350AbdK1DEt (ORCPT ); Mon, 27 Nov 2017 22:04:49 -0500 Received: from ig2.spreadtrum.com (shmbx02.spreadtrum.com [10.0.1.204]) by SHSQR01.spreadtrum.com with ESMTP id vAS30vkR070329 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO); Tue, 28 Nov 2017 11:00:57 +0800 (CST) (envelope-from Chunyan.Zhang@spreadtrum.com) Received: from SHCAS02.spreadtrum.com (10.0.1.202) by SHMBX02.spreadtrum.com (10.0.1.204) with Microsoft SMTP Server (TLS) id 15.0.847.32; Tue, 28 Nov 2017 11:01:26 +0800 Received: from localhost (10.0.73.143) by SHCAS02.spreadtrum.com (10.0.1.250) with Microsoft SMTP Server (TLS) id 15.0.847.32 via Frontend Transport; Tue, 28 Nov 2017 11:01:25 +0800 From: Chunyan Zhang To: Russell King CC: , , Lvqiang Huang , Orson Zhai , Chunyan Zhang Subject: [RESEND PATCH] ARM: Fix csum_partial_copy_from_user() stack mismatch Date: Tue, 28 Nov 2017 10:55:52 +0800 Message-ID: <20171128025552.24927-1-chunyan.zhang@spreadtrum.com> X-Mailer: git-send-email 2.12.2 MIME-Version: 1.0 Content-Type: text/plain X-MAIL: SHSQR01.spreadtrum.com vAS30vkR070329 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lvqiang Huang 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. Signed-off-by: Lvqiang Huang Signed-off-by: Chunyan Zhang --- arch/arm/lib/csumpartialcopyuser.S | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/lib/csumpartialcopyuser.S b/arch/arm/lib/csumpartialcopyuser.S index 1712f13..b83fdc0 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 -- 2.7.4 From 1584810804887147539@xxx Wed Nov 22 23:29:20 +0000 2017 X-GM-THRID: 1584810539171318777 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread