Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5613740img; Wed, 27 Mar 2019 11:43:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqwRtBoQHpw/W+Np9tcssJ3gjSr1J0f5IIPXcQWHvp0C1a4yxROqtQROn9pas23M4L88AvFu X-Received: by 2002:a17:902:8643:: with SMTP id y3mr38146357plt.195.1553712230389; Wed, 27 Mar 2019 11:43:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553712230; cv=none; d=google.com; s=arc-20160816; b=nK2OQkR/mBCdQcIqx9YxTbPUSayGU138WCJYIYj9baLosVx+ftSduR11/z/tXwCM0h CQnVXpTB+ATBIEEd1DcWykLF6MHikt/102pyCOo2J11KcDxoLdc2DKt+gOgNA6qcNSwM nEpwGMcxsT7fL3Vre0dOfknGXeL75wKm7NjJuCUAyr6upnrXHdWtaacwq465ZYtPkX5n CVWmcAj01R5YkcnrF4UGenWzXBK4nX+tOOKELTcH+537JqShDFjeMDWkZI2QC2tKyLvl NYDr7DmDdY0IaMDvm3xQxxfVnpesfswRqXKuftGouU6bM54BiVzxqksaR+NpWIYVcUBa UWSw== 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:date:subject:cc:to:from :dkim-signature; bh=BNbwz4ubt3JG0Ov+71/NjrucS1EH2Ipvy0kpeinaboM=; b=mz8pvz4IWvcJ0zA6e6o26mRgjKvhZXnqK+sQsktqrqZm1cuCLxntV29WLYFZgmAT6N v/DTkdi3PtmXP+kh6ZsdqcwGNjZpHZTEMjMqZBW38Difb7uHjXfCVWfdY1PJAVLjWwDu VJ4mL/sqbY5Yt6VwwtoS/Ou5tJqOtF952UUDQwahRvWCa31uRe0Q7yL6blKDZvtl8Kqt NsDjNk0cTGZoh/MPwP698/X3p/RNGwqyaC5bjoV7fLK5sW6C6slodT8nog7ARt0GmgD7 MXTnYZu/mDkpqC4TG+yv4rJd6exNyyTRNzATJijPjNvZp7oxaa5EW0jY96C/qp4hzVCS a2rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PzvMTef8; 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 c186si19015672pfg.160.2019.03.27.11.43.35; Wed, 27 Mar 2019 11:43:50 -0700 (PDT) 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=PzvMTef8; 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 S2391257AbfC0SWH (ORCPT + 99 others); Wed, 27 Mar 2019 14:22:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:40050 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403811AbfC0SWD (ORCPT ); Wed, 27 Mar 2019 14:22:03 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 420BD20643; Wed, 27 Mar 2019 18:22:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553710922; bh=840THv+UwAh/DMlXBEC9mMy5QzhoIUtVLdHZt6lu8Ug=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PzvMTef8yhpm/6Fg2eVWDLO8tTwKE36onGHrT6kNgNdukhsEExLTVDGq+6akckae8 cmvCKGrLxuv4Wvu7GQvKnKtN2kG96z7LN22MSO91ni7LW9qcnRxGrDMd0Fyy62pSnQ pPODTkKRWlh+s2xp5bzPdTsUQXjReF7gVXm7/89Q= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Andrea Righi , Alexander Shishkin , Arnaldo Carvalho de Melo , Jiri Olsa , Linus Torvalds , Mathieu Desnoyers , Peter Zijlstra , Steven Rostedt , Thomas Gleixner , Ingo Molnar , Sasha Levin Subject: [PATCH AUTOSEL 4.9 48/87] kprobes: Prohibit probing on bsearch() Date: Wed, 27 Mar 2019 14:20:01 -0400 Message-Id: <20190327182040.17444-48-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327182040.17444-1-sashal@kernel.org> References: <20190327182040.17444-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrea Righi [ Upstream commit 02106f883cd745523f7766d90a739f983f19e650 ] 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 Cc: Alexander Shishkin Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Linus Torvalds Cc: Mathieu Desnoyers Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/154998813406.31052.8791425358974650922.stgit@devbox Signed-off-by: Ingo Molnar Signed-off-by: Sasha Levin --- lib/bsearch.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/bsearch.c b/lib/bsearch.c index e33c179089db..d50048446b77 100644 --- a/lib/bsearch.c +++ b/lib/bsearch.c @@ -11,6 +11,7 @@ #include #include +#include /* * bsearch - binary search an array of elements @@ -51,3 +52,4 @@ void *bsearch(const void *key, const void *base, size_t num, size_t size, return NULL; } EXPORT_SYMBOL(bsearch); +NOKPROBE_SYMBOL(bsearch); -- 2.19.1