Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp644943imu; Fri, 7 Dec 2018 06:48:27 -0800 (PST) X-Google-Smtp-Source: AFSGD/UualgS3gcz1MEIU49vY/N+qyA1KAaaP1uL6v2tLy4Euk0grtVTjm9Ekwdm7B3mpTvhqLdv X-Received: by 2002:a65:4784:: with SMTP id e4mr2166522pgs.12.1544194107929; Fri, 07 Dec 2018 06:48:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544194107; cv=none; d=google.com; s=arc-20160816; b=Iw5gEszQ+5KGc3GMTjtAFejM5cNU35UIa1KRPxGsZoKozynLJ4mKZqbgcb1xh4pG2c nNHykwHD31x9P8H3Dawmv98ih48u3MNHce2mgYmsWqBIcrYpHnCAG4/gC9Woy+7QuS3O A6b1Tl55zs5Vg/DSwx1pQM8Z8zsESHYWGSuvO6PtVRF57D+rqMhS3mF4BF0qocIEGFGJ KAmDya2pszXwgYEXwlMPS3s+9lE0NDJ2rLM5vP68lynPxJoN5Dr05wnBGaM+cfmprHfj GOb0I5QO067LewP1mmFybICd6zWFCFwQ/pb0q6JkI38ogxrGsfijVIpBIDoRAq92S3Yc G9Jg== 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=pDqx61F4a9oCa3rKQRFTxVm/Vc5JYZQZAu/SXjuQb3M=; b=IXxoVDep0nTQL9qZMAUQAT6UsNw6/dbVyMNxAHHz9zjRYBihx4ahkEYmmx+Xl6iXuL NMPITdtCSES7So0yixshFgP20AdvMwkib5hbrOleCZIRArrQNWJVj3jvZOpKxGuwCIYl hsxlZDmVvM5W1OJCYO52J+IXrsM/fo7fYwB9BLkCfdng845HTBkerVXDTZjKJAV1v5BW 3d5ahdILC9CAhyNlD33YVfodLxkYTEmc+llbwlQERj+9XYajdWHrrSC07oMHryvLrH/B qNlnDSHdnCDiXBSlqSYuOUa4F1PeQIodSobLO46TQDnZbb4SfcGpCNRBaotcmmOyWrI6 guOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TJYmQwEu; 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 q15si2740080pgm.420.2018.12.07.06.48.10; Fri, 07 Dec 2018 06:48:27 -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=TJYmQwEu; 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 S1726091AbeLGOrf (ORCPT + 99 others); Fri, 7 Dec 2018 09:47:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:39756 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725998AbeLGOrf (ORCPT ); Fri, 7 Dec 2018 09:47:35 -0500 Received: from devnote (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 A023420989; Fri, 7 Dec 2018 14:47:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544194054; bh=FntOFJdPJH20mUtvdxKHhnRbrohNDbfRQwkMEag/mi0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=TJYmQwEuPWQLc1vJcV6zBxxatsGiwrsMJBplrMPvfzBpS0IQlX41M+QxpOHKzeLWB tw1JrcOu697aE8p/VTfKmOi4cuumOfq7rUts1KJbnUxnl0eS9+kNHWZQrwb73ENX0f Y49VJMoaoEpO/1YVu49L7Gj7REP1la8ya6TpFv+4= Date: Fri, 7 Dec 2018 23:47:31 +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: <20181207234731.f52a8c1eff6c0e72c073ad40@kernel.org> In-Reply-To: <20181206095648.GA8249@Dell> References: <20181206095648.GA8249@Dell> X-Mailer: Sylpheed 3.5.0 (GTK+ 2.24.30; x86_64-pc-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 Thu, 6 Dec 2018 10:56:48 +0100 Andrea Righi wrote: > These interrupt functions are already non-attachable by kprobes. > Blacklist them explicitly so that they can show up in > /sys/kernel/debug/kprobes/blacklist and tools like BCC can use this > additional information. > > Signed-off-by: Andrea Righi For the short term, this is OK. But this is not the best way to cover other functions which are also prohibited by arch_within_kprobe_blacklist(). I'll fix this issue later. Acked-by: Masami Hiramatsu Thank you, > --- > arch/x86/entry/entry_64.S | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S > index ce25d84023c0..1f0efdb7b629 100644 > --- a/arch/x86/entry/entry_64.S > +++ b/arch/x86/entry/entry_64.S > @@ -566,6 +566,7 @@ ENTRY(interrupt_entry) > > ret > END(interrupt_entry) > +_ASM_NOKPROBE(interrupt_entry) > > > /* Interrupt entry/exit. */ > @@ -766,6 +767,7 @@ native_irq_return_ldt: > jmp native_irq_return_iret > #endif > END(common_interrupt) > +_ASM_NOKPROBE(common_interrupt) > > /* > * APIC interrupts. > @@ -780,6 +782,7 @@ ENTRY(\sym) > call \do_sym /* rdi points to pt_regs */ > jmp ret_from_intr > END(\sym) > +_ASM_NOKPROBE(\sym) > .endm > > /* Make sure APIC interrupt handlers end up in the irqentry section: */ > @@ -960,6 +963,7 @@ ENTRY(\sym) > > jmp error_exit > .endif > +_ASM_NOKPROBE(\sym) > END(\sym) > .endm > > -- > 2.17.1 -- Masami Hiramatsu