Received: by 10.192.165.148 with SMTP id m20csp144081imm; Thu, 19 Apr 2018 18:08:16 -0700 (PDT) X-Google-Smtp-Source: AIpwx49CB4WyqRndZunPZNLYoQGGWzP4086ERr66MERm/CNuU226p+1pWoSXCePsmygbnW2XiTvN X-Received: by 10.99.111.200 with SMTP id k191mr6828575pgc.330.1524186496464; Thu, 19 Apr 2018 18:08:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524186496; cv=none; d=google.com; s=arc-20160816; b=bgrHzZ3nBerebDpgfYH+9OXBzJ7QJldd0ZCXkrseEai4pmlFOksLiPvsvVKs3dF4fs a5iUPWh9wNm5QNjU+VbSAHCR/izWJW3JQgnrf8pRzf6T1blwSsMYcPp5fqE74GYFISFV JVQ2KtFJwDzOFTnNeqD740ReF7amL1hyrvtiWL3YvVbMkOghf0McBclvv4aqLNp2vO7E 3HtjcFUq3HmRDTZmxUYSaVcsfjpK+tx7+NzuMWzXEkk36nIR0yzARGod5FvOqrfSLBJY 7N7rOz3+1iXcsoJ4BYCKQMeBoDRWdqijzHXDYA0G1cESbwhAxmlIW4Wj4We/RkZgaSOd SBJA== 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=JywrLgLSUGlpCSASV5OcWVRTEqUVjJv3i+MnwSrxqRI=; b=mWnHSWbzwgnwYOTcBFK7lc3Yo6I3W+sANACmM/j23qTHi1j9BCWaJ5wZjYjOZOenbv V7zoN2MiUVrRNv8XI2J4Wa7Kjf8L8agwtFvzD3ARTIdZNPb6wg4TjfjpDeHYhx1+ZUNC lq4XCGAYhb3miYBcLlcExoif/2EsaRg2AlPiHChQ7cHWuiqXhOq6Dc6+R3l1SJBImppp NSfAdpZ3JC8PP+slRJQdf2SkMeqfBz9ydCNPiPiKt5IjdDPPp92yF7NY7pNNdzUfAHt4 czNMuACuCHScX0uQFTEe+pw2zVsF4vh8sBkSQCd8haTDQQ6indp573D2U/86Ej/gsVBu Zk4w== 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 g11si3862957pgq.329.2018.04.19.18.08.01; Thu, 19 Apr 2018 18:08:16 -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 S1754088AbeDTBGt (ORCPT + 99 others); Thu, 19 Apr 2018 21:06:49 -0400 Received: from out01.mta.xmission.com ([166.70.13.231]:35746 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753825AbeDTBGp (ORCPT ); Thu, 19 Apr 2018 21:06:45 -0400 Received: from in01.mta.xmission.com ([166.70.13.51]) by out01.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1f9KVg-0003S3-46; Thu, 19 Apr 2018 19:06:44 -0600 Received: from [97.119.174.25] (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 1f9KVf-00014u-HY; Thu, 19 Apr 2018 19:06:43 -0600 From: "Eric W. Biederman" To: linux-arch@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, "Eric W. Biederman" , Yoshinori Sato , Rich Felker , Paul Mundt , linux-sh@vger.kernel.org Date: Thu, 19 Apr 2018 20:03:54 -0500 Message-Id: <20180420010408.24438-3-ebiederm@xmission.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <878t9ilmhv.fsf@xmission.com> References: <878t9ilmhv.fsf@xmission.com> X-XM-SPF: eid=1f9KVf-00014u-HY;;;mid=<20180420010408.24438-3-ebiederm@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=97.119.174.25;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1/Pnk6f5A8wP3DPlfyerBDQ9jP7w1RmasY= X-SA-Exim-Connect-IP: 97.119.174.25 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa06.xmission.com X-Spam-Level: *** X-Spam-Status: No, score=3.5 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,TR_Symld_Words,T_TM2_M_HEADER_IN_MSG,T_TooManySym_01, XMNoVowels,XMSubLong autolearn=disabled version=3.4.1 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 1.5 TR_Symld_Words too many words that have symbols inside * 0.7 XMSubLong Long Subject * 1.5 XMNoVowels Alpha-numberic number with no vowels * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa06 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa06 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ***;linux-arch@vger.kernel.org X-Spam-Relay-Country: X-Spam-Timing: total 215 ms - load_scoreonly_sql: 0.03 (0.0%), signal_user_changed: 2.6 (1.2%), b_tie_ro: 1.71 (0.8%), parse: 0.66 (0.3%), extract_message_metadata: 17 (8.1%), get_uri_detail_list: 1.43 (0.7%), tests_pri_-1000: 9 (4.4%), tests_pri_-950: 1.17 (0.5%), tests_pri_-900: 0.97 (0.5%), tests_pri_-400: 22 (10.3%), check_bayes: 21 (9.8%), b_tokenize: 6 (2.7%), b_tok_get_all: 7 (3.4%), b_comp_prob: 1.70 (0.8%), b_tok_touch_all: 2.9 (1.3%), b_finish: 0.57 (0.3%), tests_pri_0: 151 (70.2%), check_dkim_signature: 0.45 (0.2%), check_dkim_adsp: 2.8 (1.3%), tests_pri_500: 7 (3.3%), rewrite_mail: 0.00 (0.0%) Subject: [REVIEW][PATCH 03/17] signal/sh: Use force_sig_fault in hw_breakpoint_handler 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 The call chain is: breakpoint notify_die hw_breakpoint_exceptions_notify hw_breakpoint_handler So the signal number can only be SIGTRAP. In hw_breakpoint_handler rc is either NOTIFY_STOP or NOTIF_DONE both of which notifier_to_errno converts to 0. So si_errno is 0. Historically si_addr was left unitialized in struct siginfo which is a bug. There appears to be no consensus among the various architectures which value should be in si_addr. So since no usable value has been returned up to this point return NULL in si_addr. Fixes: 4352fc1b12fa ("sh: Abstracted SH-4A UBC support on hw-breakpoint core.") Fixes: 34d0b5af50a0 ("sh: Convert ptrace to hw_breakpoint API.") Cc: Yoshinori Sato Cc: Rich Felker Cc: Paul Mundt Cc: linux-sh@vger.kernel.org Signed-off-by: "Eric W. Biederman" --- arch/sh/kernel/hw_breakpoint.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/arch/sh/kernel/hw_breakpoint.c b/arch/sh/kernel/hw_breakpoint.c index afe965712a69..8648ed05ccf0 100644 --- a/arch/sh/kernel/hw_breakpoint.c +++ b/arch/sh/kernel/hw_breakpoint.c @@ -347,13 +347,8 @@ static int __kprobes hw_breakpoint_handler(struct die_args *args) /* Deliver the signal to userspace */ if (!arch_check_bp_in_kernelspace(bp)) { - siginfo_t info; - - info.si_signo = args->signr; - info.si_errno = notifier_to_errno(rc); - info.si_code = TRAP_HWBKPT; - - force_sig_info(args->signr, &info, current); + force_sig_fault(SIGTRAP, TRAP_HWBKPT, + (void __user *)NULL, current); } rcu_read_unlock(); -- 2.14.1