Received: by 10.223.164.202 with SMTP id h10csp497462wrb; Thu, 9 Nov 2017 09:31:15 -0800 (PST) X-Google-Smtp-Source: ABhQp+Q7j0zyqMoOtKzCj44LWNLb6sJCmUaey5rn+UJ6cbUNt1GgR79cHc36llRPMqer7b+jHsaw X-Received: by 10.84.240.70 with SMTP id h6mr1105244plt.109.1510248675595; Thu, 09 Nov 2017 09:31:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510248675; cv=none; d=google.com; s=arc-20160816; b=sB7zzUAK8UkQ6rA4M/VPRFzBe2em7Q+MU/+NzeIgNs6D00eTWbIbGlgYOsmG9LGqpY QAvtsrkGaU0tslnBr+J3GlBM8CMu5Xo56jvyjra6Vyo+g8U4sjayOs54Km8WLOCaJ6yl zNCR72WdqyJpK2o4+yTPOkE2D3rUihBF290T6OyJWlQirvyIwESHBiMycwyiMv59WAVi lSkVHS+rzVCW98uwlEAIFHJb3lLrobXHBAnD2DIX4il1Ro0sBgo3rhIwUp13+XxbNgDJ WRXtRX/6KfRA0sLH2lGSUreputf0kyk3NCRhdReVTuHVMD1RicNesWSMUCFFfK6FCkxw 1jFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:subject:cc:to :from:date:arc-authentication-results; bh=lpSu0YJmp/LNVswwnBAe2aiGIf4BogmD53279UsWPec=; b=L8nk85xmfhTPFg07X2TXO+f83pgMc0Wy/o+v+AwGdtcN9Zuv3oiOO1g0HePHdCSeDI zi/eYnyRsdQZV5Su7+RX1LwN0f/UKvTFpgsrWgik1b+VZyuJMfBeTfv7B1+lP/jT2noM iGQ/pZB2ddo5tLjNt+aSORsAeSYrKP/p0e2eVlTK1MUhzGaF1nKFqbLAsU/6hDQueQzN 09kvPo2dBbzKeWEx0vd0DnSM3fC3ZSrwrOvIBGcwCEvJtMyk1h0Y1VVfc1iynS4hckTH eMwDC3Wo+diyR//VWNSednPoLf3/ZChidKHFKvuoVHgFJAQp2ymuDblKQTIEWCQ0uKsS 9Hkw== 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 s59si6818080plb.658.2017.11.09.09.31.04; Thu, 09 Nov 2017 09:31:15 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751346AbdKIRa2 (ORCPT + 81 others); Thu, 9 Nov 2017 12:30:28 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:33756 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750940AbdKIRa0 (ORCPT ); Thu, 9 Nov 2017 12:30:26 -0500 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vA9HTUrR003161 for ; Thu, 9 Nov 2017 12:30:26 -0500 Received: from e19.ny.us.ibm.com (e19.ny.us.ibm.com [129.33.205.209]) by mx0a-001b2d01.pphosted.com with ESMTP id 2e4rftar0x-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 09 Nov 2017 12:30:26 -0500 Received: from localhost by e19.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 9 Nov 2017 12:30:24 -0500 Received: from b01cxnp22034.gho.pok.ibm.com (9.57.198.24) by e19.ny.us.ibm.com (146.89.104.206) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 9 Nov 2017 12:30:21 -0500 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id vA9HUKwI45875450; Thu, 9 Nov 2017 17:30:21 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4F055AC058; Thu, 9 Nov 2017 12:31:11 -0500 (EST) Received: from thinktux.localdomain (unknown [9.85.145.172]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP id B016CAC03F; Thu, 9 Nov 2017 12:31:10 -0500 (EST) Received: by thinktux.localdomain (Postfix, from userid 1000) id 251CB102FF2; Thu, 9 Nov 2017 23:00:12 +0530 (IST) Date: Thu, 9 Nov 2017 23:00:12 +0530 From: Ananth N Mavinakayanahalli To: David Howells Cc: alexei.starovoitov@gmail.com, Anil S Keshavamurthy , "David S. Miller" , Masami Hiramatsu , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC][PATCH] Lock down kprobes Reply-To: ananth@linux.vnet.ibm.com References: <11786.1510246325@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <11786.1510246325@warthog.procyon.org.uk> User-Agent: Mutt/1.9.1 (2017-09-22) X-TM-AS-GCONF: 00 x-cbid: 17110917-0056-0000-0000-000003E6FF99 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008039; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000239; SDB=6.00943472; UDB=6.00476021; IPR=6.00723756; BA=6.00005682; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017937; XFM=3.00000015; UTC=2017-11-09 17:30:24 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17110917-0057-0000-0000-0000081E1975 Message-Id: <20171109173012.GA23619@in.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-11-09_06:,, 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 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1711090236 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 09, 2017 at 04:52:05PM +0000, David Howells wrote: > Hi, > > I need to lock down kprobes under secure boot conditions as part of the patch > series that can be found here: > > https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=efi-lock-down > > Can you tell me that if the attached patch is sufficient to the cause? Yes, this patch will prevent any kprobe registration. Ananth > > Thanks, > David > --- > commit ffb3484d6e0f1d625f8e84a6a19c139a28a52499 > Author: David Howells > Date: Wed Nov 8 16:14:12 2017 +0000 > > Lock down kprobes > > Disallow the creation of kprobes when the kernel is locked down by > preventing their registration. This prevents kprobes from being used to > access kernel memory, either to make modifications or to steal crypto data. > > Reported-by: Alexei Starovoitov > Signed-off-by: David Howells > > diff --git a/kernel/kprobes.c b/kernel/kprobes.c > index a1606a4224e1..f06023b0936c 100644 > --- a/kernel/kprobes.c > +++ b/kernel/kprobes.c > @@ -1530,6 +1530,9 @@ int register_kprobe(struct kprobe *p) > struct module *probed_mod; > kprobe_opcode_t *addr; > > + if (kernel_is_locked_down("Use of kprobes")) > + return -EPERM; > + > /* Adjust probe address from symbol */ > addr = kprobe_addr(p); > if (IS_ERR(addr)) From 1583608236099329477@xxx Thu Nov 09 16:55:02 +0000 2017 X-GM-THRID: 1583515606617523183 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread