Received: by 10.223.185.116 with SMTP id b49csp2344413wrg; Thu, 15 Feb 2018 10:08:20 -0800 (PST) X-Google-Smtp-Source: AH8x225p8wtk+B+F4hBu00wglzwARRG6vJ+WeZjdXqW4OxVl8glZ0HgsXzw/SHElM0On9/HZqU8Q X-Received: by 2002:a17:902:2845:: with SMTP id e63-v6mr3252797plb.438.1518718100145; Thu, 15 Feb 2018 10:08:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518718100; cv=none; d=google.com; s=arc-20160816; b=XyWQ09lFpmyFt912I7lVpi0/S6XM0HO5u5VJOpXTJ9sry4jpNzwlNBi5Pj3jle69V6 SPJmK0I/BG3tdNRjrGGJTBO7lR4LIbK+ar/mQKwSVECsjeg4V5MN3V+3Oe1EEq+K7HCq /dKdQhgqxYqp+mMP9Vu7Z5IzV8jfzoG6A1kjUEy/fPgXMk4T/ZbRgBj/JRf9ulia0/Eb L3/OPJh58GpWTDFYwT5pNMOpXbAGK+y8lwmhQe1CPOEJ2Exa0FzcpbpyEGruSt+0aNtA vRjfku7DNLEZXb2KAuYd2Q2K8Q/TgRd4W5Ketb8Tmb0dNsFsrVKAJCsi8O7QBo4y2ww7 kIVg== 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=1duEUWwgqa3sA/4G+wS6wTETtawBh8ltI/SDqKqxFE8=; b=LgNdzsyl4znS+V8bKPiFBxiEOM+P/gI71zVRo9HJX1zfGWVhWkn896ZuM+PMBTNhzy /q0SNbCv1H/XR9Ihuv6at4lay/8OfH/3ZRa1M1yMwnKLrzRA50VaRPqDYITXFl8ApoXe 0W9kg9JW8a4Fcv/VCnmdFRwt1Oh1j9JyqKdjvH69d8YWQtnEHQkliq7H3/nReDkWMOis gsUVPWBNrtuvr2vdopU3b8aAGgCSYpa6mjYmavRF8DJeGF+FuECMdW9ola0I+oiG6uGy 41+xsLN7dJ4GcKy6YeXtB8Ux8CjEtoLa2arcybgQC8ef67zTcS9HNosw1vDeVOprBX8D MC5Q== 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 1-v6si3369951ply.348.2018.02.15.10.08.03; Thu, 15 Feb 2018 10:08:20 -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 S1946277AbeBOSF3 (ORCPT + 99 others); Thu, 15 Feb 2018 13:05:29 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:54396 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1164033AbeBOP3Z (ORCPT ); Thu, 15 Feb 2018 10:29:25 -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 0F39910B1; Thu, 15 Feb 2018 15:29:24 +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.9 87/88] mn10300/misalignment: Use SIGSEGV SEGV_MAPERR to report a failed user copy Date: Thu, 15 Feb 2018 16:17:54 +0100 Message-Id: <20180215151234.496094414@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151222.437136975@linuxfoundation.org> References: <20180215151222.437136975@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.9-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;