Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp4008504imj; Tue, 12 Feb 2019 08:17:21 -0800 (PST) X-Google-Smtp-Source: AHgI3IbG4gpQKIwvRUAcpW1v0zkc/fwLww1UKDJi7gKuInsJN6ENWLgipoLWs2HnYPfTaMYuPt8f X-Received: by 2002:a17:902:8f83:: with SMTP id z3mr4656549plo.328.1549988241021; Tue, 12 Feb 2019 08:17:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549988241; cv=none; d=google.com; s=arc-20160816; b=qdZDM8/sNXVov/b4Vjal/RKecBExga5LQM9OKLHIOJLsKFlDOFIHQPP4TbkG3jNrsR SToRCyQmv/wFotiyaBOsngG+cWeWxySpa0sbbOC/sFHQQ76eJR4eF0VO8zOCzk8Z83hQ VnLT1KSunemNOgK7crn3fI+hHorswMyW1ETzjZzes8YYEtPU9uU7UQVh1Nl3z3lQlWqF /U98IvpwJf9UwAKkQd0UsRSo1DE5h5RdHhh2XfjMtBsWc751oiC5GXBADMcCDG1ObxzH tmF68e2TILdcTYgIHkfdeCXYK/yebVQNfMD9rr9hfWS1KexPME0FAvc6+yByhsYQdAt8 NjYQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=prvcIfF4ACIcj2WMkeDpn7vrpI3CjtgdrnKuh6U2djk=; b=IXErsZdLBAQ7vu7lyBPV3hlYa+asePuGNG1IkB8Cg6fLJIgJEv/S/K3hCuviQxMYzH NfNWy1Jsaf/X5ISQkCxQe6Z1c+kH2Ny3xUdF1GjmCmv7XjR4kemRmG08vSXZilJMoojs defwSOROIKPw8MR2a+HWRAyOkxD0cpwRD0MX4Dikx04qyeZ6rDMxaCSwa5pQ2eynTxNl cwOIVeUatR4iFd67XftJT9aQi8Juc0wqcoHWsCzWqV1W29rBreZS09mpEnK7XBNnX79U FqsyG32DG87cAwkiphdN4nEsM/C4mQsbIm0IpKLOjjuCyP4z2G421Fzf/psF2teZ+RJV y6/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RFt1SS6v; 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 d34si4331037pla.80.2019.02.12.08.17.04; Tue, 12 Feb 2019 08:17:21 -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=RFt1SS6v; 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 S1731028AbfBLQP5 (ORCPT + 99 others); Tue, 12 Feb 2019 11:15:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:45202 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728869AbfBLQP5 (ORCPT ); Tue, 12 Feb 2019 11:15:57 -0500 Received: from localhost.localdomain (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 162FE21773; Tue, 12 Feb 2019 16:15:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549988157; bh=DYYuFTFbws882p5tVP8bYyLy2Iu9FrDbZAXtF45aXSM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RFt1SS6vRamDdRG55Io9eT0q1xQO2pHfkP3vzTC7Mt5hwWp4O/ORVfunbCsDP5i0o sdS02sQK8RRcxUvyK1kVFXFwKMlSfrQlf+aapBTdWRM68EyLZqbi55WgieWdqzqhAf OiMP1UKzsCXY91ELl6cyTIk4yAkhv7cSFN80WJL4= From: Masami Hiramatsu To: Ingo Molnar Cc: Masami Hiramatsu , peterz@infradead.org, Mathieu Desnoyers , linux-kernel , Andrea Righi , Steven Rostedt Subject: [PATCH -tip v3 10/10] kprobes: Prohibit probing on bsearch() Date: Wed, 13 Feb 2019 01:15:34 +0900 Message-Id: <154998813406.31052.8791425358974650922.stgit@devbox> X-Mailer: git-send-email 2.13.6 In-Reply-To: <154998785011.31052.1475728497912659748.stgit@devbox> References: <154998785011.31052.1475728497912659748.stgit@devbox> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrea Righi Since kprobe breakpoing handler is using bsearch(), probing on this routine can cause recursive breakpoint problem. int3 ->do_int3() ->ftrace_int3_handler() ->ftrace_location() ->ftrace_location_range() ->bsearch() -> int3 Prohibit probing on bsearch(). Signed-off-by: Andrea Righi Acked-by: Masami Hiramatsu --- lib/bsearch.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/bsearch.c b/lib/bsearch.c index 18b445b010c3..82512fe7b33c 100644 --- a/lib/bsearch.c +++ b/lib/bsearch.c @@ -11,6 +11,7 @@ #include #include +#include /* * bsearch - binary search an array of elements @@ -53,3 +54,4 @@ void *bsearch(const void *key, const void *base, size_t num, size_t size, return NULL; } EXPORT_SYMBOL(bsearch); +NOKPROBE_SYMBOL(bsearch);