Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5583705img; Wed, 27 Mar 2019 11:08:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5s/wuiZAfkCI5hjNZj2UUr8zx3b8W+R5/i0MS4NSZJJPHzd+D07jPpR9xXCSmctVzjuXR X-Received: by 2002:a63:2747:: with SMTP id n68mr34589431pgn.317.1553710116099; Wed, 27 Mar 2019 11:08:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553710116; cv=none; d=google.com; s=arc-20160816; b=OCSCbWF128sqd6W/dAsXTqoMgoROW7TAm3WjNjvW/bwFr8AgmXREULoKvw+0IbnDKz 3j0AaEK7bR6mEnuplHM3UKkp+/fFC2UZm8ecMptkXbaHpgmxdVxoYcbn1/olPTMai8Zy VOmeXlWrDejERE4sn/piqI6EKvG4qiaY/ixAFxPdyNgPhtqgkKCI0rqNi1pLHuoBzgb8 sLX2wMOTmg+sf8qfMZX8ORWykSjrjjR7zLtwMYuLVH7ffpfuaC003Ioo7pE2LQKjWnDH 5pgTwCAkcnRa1mCV2eiczVKfdbMh01fPv45kDbPhOaJxopIKhaLm8Of8tqDJ3ee4xVew 5CgQ== 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=8U6DpCmDL9NwEPhrmAuVeXl5uzo7hu/KliTqKsDRiwQ=; b=0oOKur4bQ8pdFy6ufujHTYrrgAcjST8FseOfL2irJLzXJ92MEEG35l8Z4h39lYt5Ls JNINOniiEbb9EAwmkCHeGxKEztJrGxMRLc+SJvrOUlyX/EpwSRvem+OXD61oVuWf5Z3/ fZT13JuvITG9Yubh7UJ4FdOaHjHmcvIwBzm4yRZgNohBLzv9K6hVlxqziGUbf+D8vJY/ AjW2+1IN0C6Ko3apfBnyOqCJegcBsSd0J7lOWwlwmNZF10lg+JP6XVy1Fm3srdHg1/Zc DFu0684l5HRNlSUqMqFnN90br3z2+b/PRdMfLzwB4FaxiwCausJiUT5Ju7aZBfo/0mGM NhjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GnZRYx3W; 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 f3si18927496pfn.122.2019.03.27.11.08.20; Wed, 27 Mar 2019 11:08:36 -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=GnZRYx3W; 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 S2388008AbfC0SGo (ORCPT + 99 others); Wed, 27 Mar 2019 14:06:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:48348 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387990AbfC0SGk (ORCPT ); Wed, 27 Mar 2019 14:06:40 -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 336942063F; Wed, 27 Mar 2019 18:06:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553709999; bh=fRRvlS6BSlWJEOgJ6mK/HtJMXrjrzPEBnyi5d58cgt8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GnZRYx3WPYpJh+9tj0hJrDwu5WzibX0Bzb/am21zGiDMAJTUxLxdkj0JFLZI9Kgax g8IbSlGVfZtJsPTkr3DbWim3FawGtcK7hrMSxZU/MDNhgy12aat4MhrHqPbXQOOwF7 9SjYj4ELJzDe7JzKCR1nqDtEtewVDiJNn0AwOT4U= 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 5.0 150/262] kprobes: Prohibit probing on bsearch() Date: Wed, 27 Mar 2019 14:00:05 -0400 Message-Id: <20190327180158.10245-150-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327180158.10245-1-sashal@kernel.org> References: <20190327180158.10245-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 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); -- 2.19.1