Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1756784imu; Sun, 16 Dec 2018 08:08:35 -0800 (PST) X-Google-Smtp-Source: AFSGD/V/i9F+LMrNRYRE/S51vix9nZhHc2BEVOeOBabDV80Jvt+F3ttof+S5pNYF4E6LcHzzoePc X-Received: by 2002:a62:ca9c:: with SMTP id y28mr9778221pfk.236.1544976515350; Sun, 16 Dec 2018 08:08:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544976515; cv=none; d=google.com; s=arc-20160816; b=QLPp5GYO6iSNgl16UOae7EUq6rXcoNby3vJmNpsaRLkGQdjSiB/88OlYEAfOD/r4S2 yBKZU5XQSVf5F9Fnq9yQiLUIq67xHZkuiZnNWY6r6XNOtDQ74i2/LvP7ZDJe1wpd8WCJ C4lCxhXsJkeeymJ8FRU0Wsp1T0r/5T+ZtXDcYs3CH862ZW8RIcwU9i4PP3O7lqrctPKo xH4pcA1V2SHAs5FnsE5PQl64iBQyU3NmERHCIksy8wmafJO2jBWMYFVLF7e0xGEye+mL GAtkXYR0p6jUmA+bhceVNV4klKCD294R5ZvUjnCXSD2QHWZR92FgPub+fcbCva5/Bp6N DmPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=2dihmWGA/7+tZJnfpZupMiyL6Bi+XFBM5LDfJK9AkGM=; b=IR2henT8IeCOnmd6DbhyDWKdURueRHknrFRoiJEp4mG+mpD+W6jwgESatL+WsicIWw hnUTsunZVFZjPwDaJS6mKsk6Pgrp2BPDlq5qf3BnZQJo95TV/kYSUhAgiMsJV0BIiorL jJWmEr8A25F1YmaycjYLdT+iYEpuFE87wqKhoViXjLychstrzoJZsm2ZvjlLeQ6/cOac 7GUYWUTsx96YCikU9t2yFk2q/CXjNg96ifQrtCHbAyMsG+iFUf4ZA0ICwOyTgKWtn4Qg huFqIT8GLDo5Jc6p25FpxkfEtkHfoJ4RKeTCH7kpLLcUd/hgbJwWUhCd/4s+SxSaee4Z V6RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LA8ksHNI; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p12si9006120pgj.56.2018.12.16.08.08.19; Sun, 16 Dec 2018 08:08: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; dkim=pass header.i=@kernel.org header.s=default header.b=LA8ksHNI; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730614AbeLPQHW (ORCPT + 99 others); Sun, 16 Dec 2018 11:07:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:43342 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729822AbeLPQHV (ORCPT ); Sun, 16 Dec 2018 11:07:21 -0500 Received: from devbox (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3CFF52082F; Sun, 16 Dec 2018 16:07:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544976441; bh=lyKRg9/b1wVrj+meWpJmMuuoqXajiGQfejjwx4lpltU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=LA8ksHNI0EZF9yM2082dz85x9zysSJPJqNF4gppxU3x52WHwZ+s5vxnidwvXD4uyD 41aqXNhfZu7FREosjwZOoNmo1fR22LGsgM/8IG4T2sfqrd/OwOro+WRDoTI2P68j3D 8pYp7QQrNJPK0EofJx4RS63vKN41O73452pyUTew= Date: Mon, 17 Dec 2018 01:07:16 +0900 From: Masami Hiramatsu To: Andrea Righi Cc: "Naveen N. Rao" , Anil S Keshavamurthy , "David S. Miller" , Yonghong Song , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] kprobes: x86_64: blacklist non-attachable interrupt functions Message-Id: <20181217010716.34552c2f21f3dfa5e07ff1b5@kernel.org> In-Reply-To: <20181208070922.GB2237@Dell> References: <20181206095648.GA8249@Dell> <20181207234731.f52a8c1eff6c0e72c073ad40@kernel.org> <20181208010120.c3eda9042912068aecc68317@kernel.org> <20181207175805.GA1369@Dell> <20181208124859.7318e32abfab4cc6dc2da3a8@kernel.org> <20181208070922.GB2237@Dell> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 8 Dec 2018 08:09:22 +0100 Andrea Righi wrote: > On Sat, Dec 08, 2018 at 12:48:59PM +0900, Masami Hiramatsu wrote: > > On Fri, 7 Dec 2018 18:58:05 +0100 > > Andrea Righi wrote: > > > > > On Sat, Dec 08, 2018 at 01:01:20AM +0900, Masami Hiramatsu wrote: > > > > Hi Andrea and Ingo, > > > > > > > > Here is the patch what I meant. I just ran it on qemu-x86, and seemed working. > > > > After introducing this patch, I will start adding arch_populate_kprobe_blacklist() > > > > to some arches. > > > > > > > > Thank you, > > > > > > > > [RFC] kprobes: x86/kprobes: Blacklist symbols in arch-defined prohibited area > > > > > > > > From: Masami Hiramatsu > > > > > > > > Blacklist symbols in arch-defined probe-prohibited areas. > > > > With this change, user can see all symbols which are prohibited > > > > to probe in debugfs. > > > > > > > > All archtectures which have custom prohibit areas should define > > > > its own arch_populate_kprobe_blacklist() function, but unless that, > > > > all symbols marked __kprobes are blacklisted. > > > > > > What about iterating all symbols and use arch_within_kprobe_blacklist() > > > to check if we need to blacklist them or not. > > > > Sorry, I don't want to iterate all ksyms since it may take a long time > > (especially embedded small devices.) > > > > > > > > In this way we don't have to introduce an > > > arch_populate_kprobe_blacklist() for each architecture. > > > > Hmm, I had a same idea, but there are some arch which prohibit probing > > extable entries (e.g. arm64.) For correctness of the blacklist, I think > > it should be listed (not entire the function body). Aah, my bad memory. I remember that the extable should not be in blacklist, since it is a kind of "unsupported instruction to be probed" on some arch. I'll move that in arch_prepare_kprobe() on arm64. > > I also rather like to remove arch_within_kprobe_blacklist() instead. Anyway, this is true. If I could make a complete list, I will remove this function. Thank you, > > OK. Thanks. > > -Andrea -- Masami Hiramatsu