Received: by 10.223.185.116 with SMTP id b49csp237527wrg; Thu, 15 Feb 2018 20:49:31 -0800 (PST) X-Google-Smtp-Source: AH8x226Q6+8mBoUKO0d0FaGlnfDuQsCJ+bkaH2MT5c+HSiIq5jLpdyvUO84ABGbtP56r0sb3gdai X-Received: by 10.101.101.149 with SMTP id u21mr4234105pgv.251.1518756571670; Thu, 15 Feb 2018 20:49:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518756571; cv=none; d=google.com; s=arc-20160816; b=CeCvSZchP9jx7DJVoJMy+eOju7hGfCANzldjajWUoBiBlirZA+Gt6kyuPSvgyqrRlV RkaKMDNcdue8M8NjJmm91UTu/6zOyuuT0zzrjMx2ngs5BtD3z85wnR4gpMOEsp7kODVJ wHZMCcUVRTJdwd5HPPMk9MXWKtK2gg2m0Lr4VGtvnspazgAoJpAmNwPhO7zCYUpEkmh0 0lETfM1JmpnnnnUcJSgitgR+3iwOJ+NxP2RPInGp1oJltE0b6YuSEVPLeizYeLXCbpHu P9uTpy1BeA9EEwC2WD4AxIG7Fdxoqt2Q3K5nECy0jEKqEwzUjxioZaISBYsdHeOU8pu0 ixSQ== 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=FndqYL9xI84qPPq1vdQ3JwHw0fAbvp5q+ytUUn376oc=; b=RwfmcNn3km0a88ksWj6IL6vO7I0lHRGyq02wZVfqJQnu5RGVFylQqQgeHPomnBL0dn ofisxRTag6ZRHn7HJu97uTIcKKRQd6vxd0KQYH9+Aag67b1tLAtI9AhbsMKmYmvnmI1X bvFpxJI737o3rEMDpcpMBFBCK00dbD1E9FuNV0OaUv8yj/vTRw9GON2x/ZD3qZlYdwCX K76YtzHDk2thKm20iFqOU37BUmOqPMOD8t/qBkmNMsxx5yQceF0RxvACf+s2njshAt2z DB8f+HRpHhnVgWIjnnjUP1INAXej4OGFqL4X1ck5KamRqihfau2WbMOfj2XDGqjwoC/P 905w== 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 b10si3884935pgf.613.2018.02.15.20.49.17; Thu, 15 Feb 2018 20:49:31 -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 S1424961AbeBOPrq (ORCPT + 99 others); Thu, 15 Feb 2018 10:47:46 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:36316 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424947AbeBOPrm (ORCPT ); Thu, 15 Feb 2018 10:47:42 -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 8A407107D; Thu, 15 Feb 2018 15:47:41 +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.15 197/202] mn10300/misalignment: Use SIGSEGV SEGV_MAPERR to report a failed user copy Date: Thu, 15 Feb 2018 16:18:17 +0100 Message-Id: <20180215151722.967123072@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151712.768794354@linuxfoundation.org> References: <20180215151712.768794354@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.15-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;