Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp446890ybe; Wed, 4 Sep 2019 02:14:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqwbT351mrvs927ajVRi0uGYhI8qL4nGE337WswSqCHAm7SKmXvQTUVO2jM2wP/YKIPYTyCd X-Received: by 2002:a17:90a:2e86:: with SMTP id r6mr3858873pjd.67.1567588485249; Wed, 04 Sep 2019 02:14:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567588485; cv=none; d=google.com; s=arc-20160816; b=XiewagL9mj5uYmYSVJ+ux5lakka6Cg96nFAAoMXr88cymdPAgOhXRExwDkfe7ByA3J bsaoC2syofV5LTEL37yxAuEpgtYIfBFsFsliZkHpuwcFbo082lQ/rhWlzxJYn0CLwC1p 5rpTZy3SCsKK8Bf6AVtsplGoZZ9bI1JXEDOohgxYyXicncngVecPyvtfDhiOwUwv7D2M 9Wd6w99SVeNfcZHNwQ4PbP/3OAAYetZiyHDcT2Mach2pSuO/u19BFqYmnoVZvD+odotK 1ALZ+/IfLRTxL9HYbk2un7BVu6mqt/LMZCuun6aOzYWVlfX7EhassSF45+csJBeWaMmt 1SVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :user-agent:mime-version:in-reply-to:references:cc:to:subject:from :date; bh=7osxmKO2r1tH5xARmfQPI903iqVe1XZpShlFZSQwh5E=; b=VaWVNsFhAx7SktjviFa8bD5JLicvqrax9LiSb88WWvy/cPcfZWDXO0dLutIOQ5MXE5 eepfIUfFlEWtkyY7ax1ShQdpLZdD6o/WduNLWFrgf4euB1t1h19DniRF0WsNAuriyuDN y/IrQaMGw6FgQz4D02ecpIQfj/5r1kQY/875rexoOqUtl1Lj/kZQqn6y0j14fEkAGAOy BqLPP+uTlThTVpxUMPa3exr6lWsYai5z0MXlhZjh1ZiZVVbIpCflldrcKGmI288/Z41E 5rN6CX2W8S+YmPL7mLz2M0BC6tBrbIhjf9FDQeHdDGJWizVEiLDR49T0nx0wP9Bh6S0x M9rw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s13si8503595pfh.70.2019.09.04.02.14.29; Wed, 04 Sep 2019 02:14:45 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728999AbfIDJNg convert rfc822-to-8bit (ORCPT + 99 others); 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