Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp4006131imj; Tue, 12 Feb 2019 08:15:22 -0800 (PST) X-Google-Smtp-Source: AHgI3IYcTcnFko+X9BHmaOr1QjGyWz4p/GWb9hqsCMHjZaS0vJIQ/FIF5AKRVeLxdO63/qsGsjVJ X-Received: by 2002:a65:500c:: with SMTP id f12mr4251121pgo.226.1549988121955; Tue, 12 Feb 2019 08:15:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549988121; cv=none; d=google.com; s=arc-20160816; b=zVYXGuM6TDK8M3Y6AGl2gkZ6iNxT0//qxmCr6AZJPvFZSRfgzNtpzkwc0PyWxHcJ8h ECZaYeUDNT+LuKcS0y2GJz12zSs/ht9hDfUaVCLaO8gSb00pJwyYTcE4knBcfB9hSH5a xzbLGlqXGZa6hIioQr4lBakYYbQX+/8KNG0IKicZY4dvb2eecr7+GTtKEE10XXdDLcpB X4Ba9onbOENUNGFbGQPonyfKyjuLnfPjfQkKOO2hBrssPdRp20B3nQlol/9BHUONINyl XSn0R12SaXyWgFpEsAd3NxrqWF/NRpeawejhz2ZVNFEaE79TUfKQpAky2WFXzHcZn0NK Rihw== 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=z+gnFEzLd4VxLe7zJRduBylQM96s6Wu0M9HRrTBqr78=; b=QVk8afAb2du0L1ZG/Y8aYrV/vC16EdDIgDFcI2DvksljGzV9v+5ASXOdQXtHLzF0se Tmq9I3U8DuwZgST5jIA67knyb07YS+S8UWE82elj9qjHNle4IrlYwiATmRks6nYBeWzN Ce+2orPr2L4BHbZPwmo3ceHicjtZCSuzTiwtIq90lHxqM7rFBBZkkywu+thWmuboC0By hXOtwAIjaB/Dp4q1wHHYAkSpV+xhvxSUbgkCyzEO7UJgZmYYDwbiFh1mJwIfx57DPLR+ 25Ygr72nVesd1CsAm1jsHSZADxoQn0nx+1eaLK3zHumOPZHZEe/gRwbdpeH8K/wOTxau exKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=P9TjQDRh; 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 43si14221267plb.299.2019.02.12.08.15.05; Tue, 12 Feb 2019 08:15: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=P9TjQDRh; 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 S1730957AbfBLQOd (ORCPT + 99 others); Tue, 12 Feb 2019 11:14:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:43046 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727932AbfBLQOc (ORCPT ); Tue, 12 Feb 2019 11:14:32 -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 0965F21773; Tue, 12 Feb 2019 16:14:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549988072; bh=VND5k2JW7QtV9ySj2wCYQ+iFgA8ygUhr6ofMEiu+/Dg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P9TjQDRh4cYn8IgvJjmfRXqvz2Jt5vNj7ZzePA9dkLTguZaIo+yH3KW43Qw0Zlp/L VFwiwtFjkccBwxfK6NFokTojvFuJvLspu08fUSTsVSNkR39SQ9OuHEV8tmnmC60QeV V705v3ZKnC+bK0F3MpCJi1qqSTm+KnAradhMnWtA= From: Masami Hiramatsu To: Ingo Molnar Cc: Masami Hiramatsu , peterz@infradead.org, Mathieu Desnoyers , linux-kernel , Andrea Righi , Steven Rostedt Subject: [PATCH -tip v3 07/10] kprobes: Prohibit probing on preempt_check debug functions Date: Wed, 13 Feb 2019 01:14:09 +0900 Message-Id: <154998804911.31052.3541963527929117920.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 Since kprobes depends on preempt disable/enable, probing on the preempt debug routine can cause recursive breakpoint problem. Signed-off-by: Masami Hiramatsu --- lib/smp_processor_id.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/smp_processor_id.c b/lib/smp_processor_id.c index 85925aaa4fff..157d9e31f6c2 100644 --- a/lib/smp_processor_id.c +++ b/lib/smp_processor_id.c @@ -5,10 +5,11 @@ * DEBUG_PREEMPT variant of smp_processor_id(). */ #include +#include #include -notrace static unsigned int check_preemption_disabled(const char *what1, - const char *what2) +notrace static nokprobe_inline +unsigned int check_preemption_disabled(const char *what1, const char *what2) { int this_cpu = raw_smp_processor_id(); @@ -56,9 +57,11 @@ notrace unsigned int debug_smp_processor_id(void) return check_preemption_disabled("smp_processor_id", ""); } EXPORT_SYMBOL(debug_smp_processor_id); +NOKPROBE_SYMBOL(debug_smp_processor_id); notrace void __this_cpu_preempt_check(const char *op) { check_preemption_disabled("__this_cpu_", op); } EXPORT_SYMBOL(__this_cpu_preempt_check); +NOKPROBE_SYMBOL(__this_cpu_preempt_check);