Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754655AbdH2OvQ (ORCPT ); Tue, 29 Aug 2017 10:51:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:49162 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752063AbdH2OvP (ORCPT ); Tue, 29 Aug 2017 10:51:15 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6336821A93 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=acme@kernel.org Date: Tue, 29 Aug 2017 11:51:12 -0300 From: Arnaldo Carvalho de Melo To: Li Bin Cc: Peter Zijlstra , Namhyung Kim , Masami Hiramatsu , linux-kernel@vger.kernel.org, Wang Nan , zhangmengting@huawei.com Subject: Re: [PATCH] perf probe: Fix kprobe blacklist checking condition Message-ID: <20170829145112.GB4831@kernel.org> References: <1504011443-7269-1-git-send-email-huawei.libin@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1504011443-7269-1-git-send-email-huawei.libin@huawei.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1836 Lines: 39 Em Tue, Aug 29, 2017 at 08:57:23PM +0800, Li Bin escreveu: > The commit 9aaf5a5("perf probe: Check kprobes blacklist > when adding new events"), perf probe supports checking > the blacklist of the fuctions which can not be probed. > But the checking condition is wrong, that the end_addr > of the symbol which is the start_addr of the next symbol > can't be included. Applied, with the following committer notes added: Committer notes: IOW make it match its kernel counterpart in kernel/kprobes.c: bool within_kprobe_blacklist(unsigned long addr) Each entry have as its end address not its end address, but the first address _outside_ that symbol, which for related functions, is the first address of the next symbol, like these from kernel/trace/trace_probe.c: 0xffffffffbd198df0-0xffffffffbd198e40 print_type_u8 0xffffffffbd198e40-0xffffffffbd198e90 print_type_u16 0xffffffffbd198e90-0xffffffffbd198ee0 print_type_u32 0xffffffffbd198ee0-0xffffffffbd198f30 print_type_u64 0xffffffffbd198f30-0xffffffffbd198f80 print_type_s8 0xffffffffbd198f80-0xffffffffbd198fd0 print_type_s16 0xffffffffbd198fd0-0xffffffffbd199020 print_type_s32 0xffffffffbd199020-0xffffffffbd199070 print_type_s64 0xffffffffbd199070-0xffffffffbd1990c0 print_type_x8 0xffffffffbd1990c0-0xffffffffbd199110 print_type_x16 0xffffffffbd199110-0xffffffffbd199160 print_type_x32 0xffffffffbd199160-0xffffffffbd1991b0 print_type_x64 But not always: 0xffffffffbd1997b0-0xffffffffbd1997c0 fetch_kernel_stack_address (kernel/trace/trace_probe.c) 0xffffffffbd1c57f0-0xffffffffbd1c58b0 __context_tracking_enter (kernel/context_tracking.c) Fixes: 9aaf5a5f479b ("perf probe: Check kprobes blacklist when adding new events")