Received: by 10.223.176.46 with SMTP id f43csp4698246wra; Tue, 23 Jan 2018 13:10:35 -0800 (PST) X-Google-Smtp-Source: AH8x227ijGrw2r7zM7sGwbOQF7moFv8Lc6CRH6Z0JxC9K0suWCJVOdNzoisKmSsia8IMrVpMGV70 X-Received: by 10.36.122.79 with SMTP id a76mr5881190itc.36.1516741835223; Tue, 23 Jan 2018 13:10:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516741835; cv=none; d=google.com; s=arc-20160816; b=r54PsrTiHyOEd3e/tRQ6nyNkK2/i4sXJNz14XeelhjmeUpl85fEtpW0R0XKPKyRXGy NIOwe2u28vX+A44hvvIYJrzktYl+X9cfUBPt19OrVpNjYHV375mT4gZFy+wWrZbyPJpn F+wNnb3jJk7EFcBM9r+ySLaRM/bQwN5JNA8q77MQ22hZ1GVpPLeOqIGHb4PxL9ik68Ya /2Ajgb96F/r+Ielra89+a/f/TpKCgeWz4CHH+naml5oKpQYBDaaOkWQoW1rj34RNJkqR +eDiW9Y0zAa0+YKAcD0UGMnCbiCJtSoIc9ofXRboo6ZRQX6iQB/epxAJvVq3tNvSRbjD IjrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=Z8e97MN5ipWR2L0MTW6k+REsdOomY7xMYmuJabDGocE=; b=DuJm5ytOHX6NSFrrZsLz7ZtqJG2iBUVU4oaWJRR9q1Yk64BPFiP4WUfnQ7BuZqcjZJ f9hej39madmX7OYbSAir1gRZQt4hKb4tjI1jgd4/hVUf8yG5RlYwfCa3S5IoGYxB5u62 Dcdmj9Wd58ookk0W/6Gb4unm3/ObKuNshMrdz6oG9+u5oOYO96XJubds8uz1Kk706p7p FgnJyjiWUnTgT+1vmJhG4zsIyobu9wunCJd4qdQGPsTP2uCgc8h+cRb96wBgcmJaFX68 g8EzKyFSg3SLnML6bK73pW/9dhMUIphGjEnniZNMIgTr6hH29uLbbAQsiDzCWeQhqsAf 6MJA== 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 x10si8912303iti.171.2018.01.23.13.10.22; Tue, 23 Jan 2018 13:10:35 -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 S932356AbeAWVJn (ORCPT + 99 others); Tue, 23 Jan 2018 16:09:43 -0500 Received: from out02.mta.xmission.com ([166.70.13.232]:46066 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932195AbeAWVJY (ORCPT ); Tue, 23 Jan 2018 16:09:24 -0500 Received: from in01.mta.xmission.com ([166.70.13.51]) by out02.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1ee5op-0007wk-2N; Tue, 23 Jan 2018 14:09:23 -0700 Received: from 97-121-88-104.omah.qwest.net ([97.121.88.104] helo=x220.int.ebiederm.org) by in01.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1ee5on-0003u7-GS; Tue, 23 Jan 2018 14:09:22 -0700 From: "Eric W. Biederman" To: linux-kernel@vger.kernel.org Cc: Al Viro , Oleg Nesterov , linux-arch@vger.kernel.org, Ram Pai , "Eric W. Biederman" Date: Tue, 23 Jan 2018 15:07:19 -0600 Message-Id: <20180123210719.10456-10-ebiederm@xmission.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <87607s5lra.fsf_-_@xmission.com> References: <87607s5lra.fsf_-_@xmission.com> X-XM-SPF: eid=1ee5on-0003u7-GS;;;mid=<20180123210719.10456-10-ebiederm@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=97.121.88.104;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX18TVpGpulRHIH+kofIhsa1okb9wdZ3LwUo= X-SA-Exim-Connect-IP: 97.121.88.104 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa07.xmission.com X-Spam-Level: ** X-Spam-Status: No, score=2.0 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,TVD_RCVD_IP,T_TooManySym_01,T_TooManySym_02,XMNoVowels, XMSubLong autolearn=disabled version=3.4.1 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.7 XMSubLong Long Subject * 1.5 XMNoVowels Alpha-numberic number with no vowels * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa07 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_02 5+ unique symbols in subject * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa07 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: **;linux-kernel@vger.kernel.org X-Spam-Relay-Country: X-Spam-Timing: total 1187 ms - load_scoreonly_sql: 0.04 (0.0%), signal_user_changed: 2.6 (0.2%), b_tie_ro: 1.85 (0.2%), parse: 0.72 (0.1%), extract_message_metadata: 10 (0.8%), get_uri_detail_list: 1.10 (0.1%), tests_pri_-1000: 6 (0.5%), tests_pri_-950: 1.19 (0.1%), tests_pri_-900: 1.44 (0.1%), tests_pri_-400: 19 (1.6%), check_bayes: 18 (1.5%), b_tokenize: 6 (0.5%), b_tok_get_all: 6 (0.5%), b_comp_prob: 1.68 (0.1%), b_tok_touch_all: 2.4 (0.2%), b_finish: 0.64 (0.1%), tests_pri_0: 1140 (96.0%), check_dkim_signature: 0.46 (0.0%), check_dkim_adsp: 2.8 (0.2%), tests_pri_500: 4.4 (0.4%), rewrite_mail: 0.00 (0.0%) Subject: [PATCH 10/10] signal/memory-failure: Use force_sig_mceerr and send_sig_mceerr X-Spam-Flag: No 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) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Delegate filling out struct siginfo to functions in kernel/signal.c to simplify the code. Signed-off-by: "Eric W. Biederman" --- mm/memory-failure.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index c5f5f31bd979..4b80ccee4535 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -181,19 +181,16 @@ EXPORT_SYMBOL_GPL(hwpoison_filter); static int kill_proc(struct task_struct *t, unsigned long addr, unsigned long pfn, struct page *page, int flags) { - struct siginfo si; + short addr_lsb; int ret; pr_err("Memory failure: %#lx: Killing %s:%d due to hardware memory corruption\n", pfn, t->comm, t->pid); - si.si_signo = SIGBUS; - si.si_errno = 0; - si.si_addr = (void *)addr; - si.si_addr_lsb = compound_order(compound_head(page)) + PAGE_SHIFT; + addr_lsb = compound_order(compound_head(page)) + PAGE_SHIFT; if ((flags & MF_ACTION_REQUIRED) && t->mm == current->mm) { - si.si_code = BUS_MCEERR_AR; - ret = force_sig_info(SIGBUS, &si, current); + ret = force_sig_mceerr(BUS_MCEERR_AR, (void __user *)addr, + addr_lsb, current); } else { /* * Don't use force here, it's convenient if the signal @@ -201,8 +198,8 @@ static int kill_proc(struct task_struct *t, unsigned long addr, * This could cause a loop when the user sets SIGBUS * to SIG_IGN, but hopefully no one will do that? */ - si.si_code = BUS_MCEERR_AO; - ret = send_sig_info(SIGBUS, &si, t); /* synchronous? */ + ret = send_sig_mceerr(BUS_MCEERR_AO, (void __user *)addr, + addr_lsb, t); /* synchronous? */ } if (ret < 0) pr_info("Memory failure: Error sending signal to %s:%d: %d\n", -- 2.14.1