From patchwork Mon Sep 24 09:07:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Eric W. Biederman" X-Patchwork-Id: 10612091 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5FB0E913 for ; Mon, 24 Sep 2018 09:26:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 46E1D28E93 for ; Mon, 24 Sep 2018 09:26:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3711D28F48; Mon, 24 Sep 2018 09:26:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AB96528E93 for ; Mon, 24 Sep 2018 09:26:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:Message-ID:Date:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=sZH/MqzDY0MK99J2Z3Wvv+ccnp4k4YylY2PwkJOyYGw=; b=cYInbwkO5Z+I53 HFNVHJ30tTtAQj4hi6JEYMyoI5xr7wgb7WmwTQIQODzxv9RP4iB2uDBiI2BEe0GhJciaPxKAqz+xT RjweaBEKO2zJ7Xhhwe/U5qMYM23tlyyHOfq3EVC+eL4BuH2Z2rF1o8zRQQkDci8Bn7J9sxcV7XmmE FAaLZ01rG25Y8e8QiLottw/FGAaCrQwHoodf6YI4xw62qybCwgxIPKCEqPamVyfubsu5MCtio6LCW kgfLHpiomm0fYIVEi7AokhAQOcrw7lK2waW8+VXiYT/AAPa0jtQzG5NdKRzmXN8aTF48Y5I3kaScy jh/EY05vv0XiFKpAdq6w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g4N8G-0006Sf-Qh; Mon, 24 Sep 2018 09:26:20 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g4N8E-0006RP-3B for linux-arm-kernel@bombadil.infradead.org; Mon, 24 Sep 2018 09:26:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Subject:Content-Type:MIME-Version: Message-ID:Date:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ExmTIm2/Bv+JhUNftum4Z/5K+01CR2YLT+Qk5lnZcV4=; b=S/nxsqJZ1qMiTK2/KmNjzZFE/ VHjMrZgWM6+j7FIXhwCBqOFEbKZUV3qfLQd7SErHDND8xFU3FclWsh+lA9VCaZbTVJ10uw764I4Z3 JABnh0eGIj0XN147cCEzZokt9ZaFs+tWIi1wxJzOWu3MFgSdipk8bxeAGez8mtYgJupxiL1bJe9c5 P+zo46nWH3LkuV/0vAzT9w+POYJmCr8vu/4DT+ByLq7csVBYxUSLa3xrQ4PYtEBwBScsHIpeWPKLv uHpJ83s6ZuL8L0jDDUxiP4Cv9nJptno2hyLomxB1iKmhX4oApV7Or0OoasU1udGHO3qi2EU2l6Cyl Ky0PcXthA==; Received: from out03.mta.xmission.com ([166.70.13.233]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g4Mqa-0008V1-04 for linux-arm-kernel@lists.infradead.org; Mon, 24 Sep 2018 09:08:05 +0000 Received: from in01.mta.xmission.com ([166.70.13.51]) by out03.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1g4Mpp-0007sr-Qa; Mon, 24 Sep 2018 03:07:17 -0600 Received: from [105.184.227.67] (helo=x220.xmission.com) by in01.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1g4Mpo-0002hC-Gw; Mon, 24 Sep 2018 03:07:17 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: Date: Mon, 24 Sep 2018 11:07:05 +0200 Message-ID: <871s9j462u.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 X-XM-SPF: eid=1g4Mpo-0002hC-Gw; ; ; mid=<871s9j462u.fsf@xmission.com>; ; ; hst=in01.mta.xmission.com; ; ; ip=105.184.227.67; ; ; frm=ebiederm@xmission.com; ; ; spf=neutral X-XM-AID: U2FsdGVkX1/DUS+ekOhIEP6aLX8+6/ON+BYbXIbcuq4= X-SA-Exim-Connect-IP: 105.184.227.67 X-SA-Exim-Mail-From: ebiederm@xmission.com Subject: [REVIEW][PATCH 00/15] signal/arm64: siginfo cleanups X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180924_050804_116050_CE793EA0 X-CRM114-Status: GOOD ( 15.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This is the continuation of my work to sort out signaling of exceptions with siginfo. The old signal sending functions by taking a siginfo argument resulted in their callers having to deal with the fiddly nature of siginfo directly. In small numbers of callers this is not a problem but in the number of callers in the kernel this resulted in cases where fields were not initialized or improperly initialized before being passed to userspace. To avoid having to worry about those issues I have added new signal sending functions that each deal wit a different siginfo case. When using these functions there is no room for the fiddly nature of siginfo to cause mistakes. This is my set of changes to update arm64 to use those functions. Along with some refactoring so those functions can be cleanly used. Folks please review and double check me. I think I have kept these changes simple and obviously correct but I am human and mess up sometimes. After these patches have had a chance to be reviewed I plan to merge them by my siginfo tree. If you would rather take them in the arm64 tree let me know. All of the prerequisites should have been merged through Linus's tree several releases ago. Eric W. Biederman (15): signal/arm64: Push siginfo generation into arm64_notify_die signal/arm64: Remove unneeded tsk parameter from arm64_force_sig_info signal/arm64: Factor out arm64_show_signal from arm64_force_sig_info signal/arm64: Factor set_thread_esr out of __do_user_fault signal/arm64: Consolidate the two hwpoison cases in do_page_fault signal/arm64: For clarity separate the 3 signal sending cases in do_page_fault signal/arm64: Expand __do_user_fault and remove it signal/arm64: Only perform one esr_to_fault_info call in do_page_fault signal/arm64: Only call set_thread_esr once in do_page_fault signal/arm64: Add and use arm64_force_sig_fault where appropriate signal/arm64: Add and use arm64_force_sig_mceerr as appropriate signal/arm64: Remove arm64_force_sig_info signal/arm64: In ptrace_hbptriggered name the signal description string signal/arm64: Add and use arm64_force_sig_ptrace_errno_trap signal/arm64: Use send_sig_fault where appropriate arch/arm64/include/asm/system_misc.h | 3 +- arch/arm64/include/asm/traps.h | 5 +- arch/arm64/kernel/debug-monitors.c | 11 ++--- arch/arm64/kernel/fpsimd.c | 10 ++-- arch/arm64/kernel/ptrace.c | 16 +++--- arch/arm64/kernel/sys_compat.c | 13 ++--- arch/arm64/kernel/traps.c | 67 ++++++++++++------------- arch/arm64/mm/fault.c | 94 +++++++++++++----------------------- 8 files changed, 90 insertions(+), 129 deletions(-) Reviewed-by: Catalin Marinas Tested-by: Catalin Marinas