Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2244218imm; Thu, 7 Jun 2018 07:37:03 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIbC9tmNWe5f4Gx3nUbC7MhjeH2AFxQwkXLIFWBbqnqxnlldnZKDuzfg44oxA5NKMsjVKTo X-Received: by 2002:a62:a09c:: with SMTP id p28-v6mr2058884pfl.9.1528382223844; Thu, 07 Jun 2018 07:37:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528382223; cv=none; d=google.com; s=arc-20160816; b=HDyWmKbU72gxrTZZRrBbCYWFMMxzTXSx7IbJbaKwBcg2kArqAjyP3ONy1Vj3tUDKc9 pe90NRAr4/50n/RfHUkjgTxaVVqrC8DlHzrsmGv92SnzVjZm+giJPXWFbintUzLh41bX 6tCU0/mOLRl9+rQazrn1FazYk0De9jxPvnD5aoUykvNn7XYbLGAyIjE+XfMkF04cXVeb 8oPywaJs+CdEQbbSDbz8XeqXOXT/djPhbsnR8ZIfNc8hdp++3fJSP5+YAgXvTVMXCYm7 wvMYtwZKx/HZyuDN1lC+xs7+BKBNdRPyjaJh4n5NpXb6aUfIVrYAuFrgbI7fmTUJpPW2 JZuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=1s0ccsOZbd9EuVCO2AJNMWlizqCcNhRmrHB4R0nUZn0=; b=Er7JNlGPUiP550tKH7ynIf13k2Kt87C8YdYtk8QRtzJmeqPTt4sP/io2wMzap0Jc/A GEnuZK6hnSIcDxfn+L4uNdmldby26EG6ooX8tQGDOj+W9gZxbFeMsUgU7tISMRWO16Xu W04Ebjbq+DucI2+8c9G7sabQ80h0T6IfiEM1EU0xPKwnp3nlARqKRe3Kw1umStDhfVQG qDTLsH99LMTdaQEuubNUlYK2eyo5pSUwcKww1zGFl6ebk5alTCLBGuPs1Hp8QOXX2trZ io61X6/50i0NtszIaukeVDiIotgaJOV7HLrjlfAgmNv6K3OgWS716YqzYSU8jj6RxReJ imxw== 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 b2-v6si10029208pgt.611.2018.06.07.07.36.49; Thu, 07 Jun 2018 07:37:03 -0700 (PDT) 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 S934065AbeFGOft (ORCPT + 99 others); Thu, 7 Jun 2018 10:35:49 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:40393 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933394AbeFGOfc (ORCPT ); Thu, 7 Jun 2018 10:35:32 -0400 Received: from [148.252.241.226] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1fQvbp-0005dI-8M; Thu, 07 Jun 2018 15:09:49 +0100 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1fQvb2-0002rQ-EB; Thu, 07 Jun 2018 15:09:00 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "David Howells" , "Eric W. Biederman" , "Masakazu Urade" , "Koichi Yasutake" Date: Thu, 07 Jun 2018 15:05:21 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 126/410] mn10300/misalignment: Use SIGSEGV SEGV_MAPERR to report a failed user copy In-Reply-To: X-SA-Exim-Connect-IP: 148.252.241.226 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.57-rc1 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: Ben Hutchings --- 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;