From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1CC3CC3A5A7 for ; Wed, 4 Sep 2019 09:13:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EEAC921670 for ; Wed, 4 Sep 2019 09:13:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729336AbfIDJNg convert rfc822-to-8bit (ORCPT ); Wed, 4 Sep 2019 05:13:36 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:63566 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725938AbfIDJNg (ORCPT ); Wed, 4 Sep 2019 05:13:36 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x849ASp0112429 for ; Wed, 4 Sep 2019 05:13:35 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ut9dhtba4-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 04 Sep 2019 05:13:34 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 4 Sep 2019 10:13:32 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 4 Sep 2019 10:13:30 +0100 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x849DTRj27590714 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 4 Sep 2019 09:13:29 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B7A94A4069; Wed, 4 Sep 2019 09:13:29 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 66CF0A405F; Wed, 4 Sep 2019 09:13:29 +0000 (GMT) Received: from localhost (unknown [9.124.35.94]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 4 Sep 2019 09:13:29 +0000 (GMT) Date: Wed, 04 Sep 2019 14:43:26 +0530 From: "Naveen N. Rao" Subject: Re: [PATCH -tip v2] kprobes: Prohibit probing on BUG() and WARN() address To: Masami Hiramatsu , Ingo Molnar Cc: Anil S Keshavamurthy , "David S . Miller" , linux-kernel@vger.kernel.org, Steven Rostedt References: <156750890133.19112.3393666300746167111.stgit@devnote2> In-Reply-To: <156750890133.19112.3393666300746167111.stgit@devnote2> MIME-Version: 1.0 User-Agent: astroid/0.15.0 (https://github.com/astroidmail/astroid) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8BIT X-TM-AS-GCONF: 00 x-cbid: 19090409-0016-0000-0000-000002A68489 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19090409-0017-0000-0000-00003306F0F0 Message-Id: <1567588343.zi51gn8p0w.naveen@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-09-04_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=933 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1909040093 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Masami Hiramatsu wrote: > Since BUG() and WARN() may use a trap (e.g. UD2 on x86) to > get the address where the BUG() has occurred, kprobes can not > do single-step out-of-line that instruction. So prohibit > probing on such address. > > Without this fix, if someone put a kprobe on WARN(), the > kernel will crash with invalid opcode error instead of > outputing warning message, because kernel can not find > correct bug address. > > Signed-off-by: Masami Hiramatsu > --- > Changes in v2: > - Add find_bug() stub function for !CONFIG_GENERIC_BUG > - Cast the p->addr to unsigned long. > --- > include/linux/bug.h | 5 +++++ > kernel/kprobes.c | 3 ++- > 2 files changed, 7 insertions(+), 1 deletion(-) Acked-by: Naveen N. Rao - Naveen