Received: by 10.223.185.116 with SMTP id b49csp8410003wrg; Fri, 2 Mar 2018 00:58:44 -0800 (PST) X-Google-Smtp-Source: AG47ELvXI31kF3OlqIkEJV22bX7NQL9/o6EQkdOc0D4O3w7R7wLvo9E2vMnvqor5wNE4RmTW0KfL X-Received: by 10.98.139.18 with SMTP id j18mr4994022pfe.179.1519981124785; Fri, 02 Mar 2018 00:58:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519981124; cv=none; d=google.com; s=arc-20160816; b=a9hVLSd/iX+aF8hMgFax/LU3tCmYqkNEwQ0xBuAOUnoY6wpFIjQTXBzlK3ppZDacNm EHA26WSYQux7FcCyw0ZP1yQ5J4AG08AmJdv2bnHeZbpGUzZ/QMkbMROS/2NDuq638tTc DKH03sIv4pVd3N3hmD5oYyKV5YCNeUPAN/Q0LiYyqXfkdSgFF22KqElmJeCg2tm4CewA AsT40cecihZ6/5dTJqIqmkU7HW48V0binIJZEoVhmyy99dpwEuy+CRyBZJiReHjef2BD O/tsonh4GSWSUAAsBRzMUIRnnVe3El4IE/m8R0FQ1Vqertvlm5GqonXPTRG7yQLB5D1k jMDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=ft8r5qEG190OYAEhxT4yEOWuWcU+eZj9EBonQKx5JVY=; b=vk9H3bBc9zJuoNJ+bmtA/gEzSMqjiSmBh9CvWJiB495n2mqoGBU+wiklbdeDFnJReW C9WwMtp526T1U9qlcIl+mVifhNwTjslXGqBNbscpJgtQZijQfzDTVPTGOArNHqYk6wR1 y7nwskndChVWnIfWX2iklX+7u5DxFeEHeEL/iwbpDkrRtD/ewFqHqJ/iOK2R9eiy6JAz 1bRyU3ql0QkBaeaZb3rghIA5z/xw73C0Fip0ZiRwfAPl+B600ZNYxowgomrDsqLEpKWO yW8NmSYMRKD1Puo/iB7V3P5ywMA1YYcMzI+3HVYU1mFHGi72/HOniMtBcD8BBfPS6v3o ZNeg== 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 38-v6si4485591pln.397.2018.03.02.00.58.30; Fri, 02 Mar 2018 00:58: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 S1423664AbeCBIzZ (ORCPT + 99 others); Fri, 2 Mar 2018 03:55:25 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:50754 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423654AbeCBIzV (ORCPT ); Fri, 2 Mar 2018 03:55:21 -0500 Received: from localhost (clnet-b04-243.ikbnet.co.at [83.175.124.243]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 2D2FC121D; Fri, 2 Mar 2018 08:55:20 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lvqiang Huang , Chunyan Zhang , Russell King , Sasha Levin Subject: [PATCH 4.4 05/34] ARM: 8731/1: Fix csum_partial_copy_from_user() stack mismatch Date: Fri, 2 Mar 2018 09:51:01 +0100 Message-Id: <20180302084436.333276338@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180302084435.842679610@linuxfoundation.org> References: <20180302084435.842679610@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ 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 Signed-off-by: Greg Kroah-Hartman --- arch/arm/lib/csumpartialcopyuser.S | 4 ++++ 1 file changed, 4 insertions(+) --- 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