Received: by 10.223.185.116 with SMTP id b49csp2369067wrg; Thu, 15 Feb 2018 10:31:24 -0800 (PST) X-Google-Smtp-Source: AH8x225ZA6Azo5C20noWq2PuH4xAAM+/qvDH6ab2M31o9RcSIB6TjaxDFYg57tNHHxJv7Mn9okMS X-Received: by 10.101.97.81 with SMTP id o17mr2874955pgv.31.1518719484504; Thu, 15 Feb 2018 10:31:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518719484; cv=none; d=google.com; s=arc-20160816; b=yvvcRO1aG7TeWEYB+jLR13sEFKg+FELXTi3t0IK1XGPiKumxmqH2XKYcEOY3F9naRN OUTPJuTC1FFRg18F63wLRGSN29vJey8Dg7HRqGUJbyjfQ0XQ50AVBH8GPXRgOG5K9vSA 8H+tSoG8fHd6VsdWe5RJLimlYaqwL/bMhKw1RPpS2RK2m2jKQk7oF/XwaNA4HJEyOTvT YPMZF7ohnf+7buzN8ikUNu0VmnLsFe3AhVbcX1vRiKfI/jwsj3x3vpAbYnGjomx9df8A 0WSL2Yfz/wuFG3bIBhHUbG2IyfrnDaXotnZC/EudjFewztlCctdiDGNaC7sgNJgx+5KH amMA== 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=zgG5+DH2mMY/7InAI7lSSJrJt8BEHrskkV/djSrJei8=; b=baVje4THPoN3Ql0Zmmunf2S9XFKHptjvBMjRMT/VyIxITrGNWaR5LvyuX9Kjo/tEPG Dqmz3xTUYE43dWW07RO2YNSSWlnDduchS/M+AjTpdkmlhfbrLpDxeCIjvF+kccOQpce+ v/cGH7Chvp0m5a6Ow+/7M3Y6JLWmXD26e/a48DGJ6w78hpvC+X9JsSAe2FCK2Or5X5dH D8Elm+ccYY9bVxZGfhoQ3dRSDG2MTRAO25VoTQSIaNiE9CRNt/UqowQtkz3TPj6c8VWp zOI5itSgz8zTb6QTrlNoph6yAFocFrWBUavqeYs+me7WNCUX3GPlNhDOEkEGbIUTUl1V moEA== 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 x9-v6si65953plv.317.2018.02.15.10.31.10; Thu, 15 Feb 2018 10:31:24 -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 S1163136AbeBOPZP (ORCPT + 99 others); Thu, 15 Feb 2018 10:25:15 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:52128 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162134AbeBOPZM (ORCPT ); Thu, 15 Feb 2018 10:25:12 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id BAD8510D1; Thu, 15 Feb 2018 15:25:11 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Howells , Masakazu Urade , Koichi Yasutake , "Eric W. Biederman" Subject: [PATCH 4.4 107/108] mn10300/misalignment: Use SIGSEGV SEGV_MAPERR to report a failed user copy Date: Thu, 15 Feb 2018 16:17:44 +0100 Message-Id: <20180215151237.186524095@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151222.267507937@linuxfoundation.org> References: <20180215151222.267507937@linuxfoundation.org> User-Agent: quilt/0.65 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: Eric W. Biederman commit 6ac1dc736b323011a55ecd1fc5897c24c4f77cbd upstream. Setting si_code to 0 is the same a setting si_code to SI_USER which is definitely not correct. With si_code set to SI_USER si_pid and si_uid will be copied to userspace instead of si_addr. Which is very wrong. So fix this by using a sensible si_code (SEGV_MAPERR) for this failure. Fixes: b920de1b77b7 ("mn10300: add the MN10300/AM33 architecture to the kernel") Cc: David Howells Cc: Masakazu Urade Cc: Koichi Yasutake Signed-off-by: "Eric W. Biederman" Signed-off-by: Greg Kroah-Hartman --- arch/mn10300/mm/misalignment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/mn10300/mm/misalignment.c +++ b/arch/mn10300/mm/misalignment.c @@ -437,7 +437,7 @@ transfer_failed: info.si_signo = SIGSEGV; info.si_errno = 0; - info.si_code = 0; + info.si_code = SEGV_MAPERR; info.si_addr = (void *) regs->pc; force_sig_info(SIGSEGV, &info, current); return;