Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1024838yba; Thu, 4 Apr 2019 02:41:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqw5/OccosbD8gHde3lKXd0WfYF5iQ5U/wtTJwBu8fklQ6TI898EGjw0gRdyplVEBe6AerR7 X-Received: by 2002:a65:4844:: with SMTP id i4mr4817191pgs.347.1554370887170; Thu, 04 Apr 2019 02:41:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554370887; cv=none; d=google.com; s=arc-20160816; b=f2fkNBsn67FVjBw/WnjSVEQIAIXJnpFus+IsWbTqOAc6eW69CsYI/eg+QZg20ZvEyq 3eCm6OcD3YNRz9hmqsKNJ/ozysoiyODdpnV9OQ2qamlrxPsiCvkqmhx5yXT+uOocbuxr HjugIH9LIEJSaLTy+8yUnJScbiFaKPVHCzQNYBjcUb/2n2+9iW6fHFxIoWPpUVSJF840 e0Sk4w/udq7sU9ndpbO7ARdVobiOj80zbg1pTH2mnePBuUrwgkW3Dd/Qjp1yPbOZA1HM An6ieww5/Goj22C5niSdic7VPvDdcdfk8G5pA14lRR5dL5p8wGfWcpXnngJQfVoWYRMO ncvg== 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=l+hF3P5P8yM5kO087dNpElZNl2B2fWesT8DQIEaCi8g=; b=UF6dPZkrEIGFJBpLnb2A40wK2WL+bp6EPQKL17fuHrcePM9o+fWfPXGm25JPvarodO mjUE8lDSC8I0D+ntxCGWwS0NkMtaMkp+kzp0WLRCKtcLC5Q2kDnvF7j3Wo4/aMDVgz1c +HXtL88Y+MGZRbBSpzSGlTY47PsC7Zo6P9p7dyZmu4a8xrn5YRSm7muD0cPi8js/OPU+ fhPxst+ORhxhjfS0/DAYRWZblHwMcyxJeHNziAdOQILBl+3cQxCQr/iXAuKope7HmMOY /5QfkA7jLSaANXvI9huz8IALB/db7D5JboLAsdpZFnMG6BoONptxDVhiCiisuSNsaZsn 9KHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Iwd9Zu3g; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n79si16090119pfb.133.2019.04.04.02.41.12; Thu, 04 Apr 2019 02:41:27 -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=Iwd9Zu3g; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731989AbfDDJj3 (ORCPT + 99 others); Thu, 4 Apr 2019 05:39:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:41136 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731800AbfDDJD3 (ORCPT ); Thu, 4 Apr 2019 05:03:29 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 555012147C; Thu, 4 Apr 2019 09:03:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554368608; bh=+1l8iLf6Qth8czlK3I4pdhaR5nodkp0FUerYR+6krUo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Iwd9Zu3gFDE+IesdEAgH6FXkZywZoZ4Co1ZaC+H2tLvZ0PxzBTeVw9zwVtQt1D6zB Ynx2CuF+mBpZ+PMS5OdTa5g7Fghyo3gGB4x5bPrf+HVb5OcOe/3yRryjj2JqMqWBFv pJ+oOh7QgPKDIZ24DkUXWA43gz3vx6OVa6rg29SU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrea Righi , Masami Hiramatsu , Alexander Shishkin , Arnaldo Carvalho de Melo , Jiri Olsa , Linus Torvalds , Mathieu Desnoyers , Peter Zijlstra , Steven Rostedt , Thomas Gleixner , Ingo Molnar , Sasha Levin Subject: [PATCH 4.19 102/187] kprobes: Prohibit probing on bsearch() Date: Thu, 4 Apr 2019 10:47:19 +0200 Message-Id: <20190404084608.017921661@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084603.119654039@linuxfoundation.org> References: <20190404084603.119654039@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ 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