Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp193943pxk; Wed, 2 Sep 2020 19:06:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzasCLmzh5a3Dmdmum+I2P4373UGHUd28kC1LzjZT1jB+UouCwbZ/k2+gqxKJH0TfoOq7vn X-Received: by 2002:a50:a2e6:: with SMTP id 93mr728100edm.147.1599098787846; Wed, 02 Sep 2020 19:06:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599098787; cv=none; d=google.com; s=arc-20160816; b=aS46ZI3qeEjdEB4po1jxoiNjv28lHFFAeRezN6OZAPfJDaq7k8lfWv4XWEjC3H/Zdi kdXWfafg3CBycf40Ux4GaAsy+ACOr5r3oXzEh6yFGWYZIjF8oBYkbIgf0lJe98UUin2D gLpaHRyLjO65pNOqy5/ukkqmKVkTHuhbGTXc+sI3tLFxV045iuBNLKzx9XkDtb2Z2mtd wiQH4tfxDTRHFb42n6d3CbEimlRVJvAi4G1lomp4K542AnF74oUIDAzlI+5UievWrnQp xXdYMvN7RbJyTWLntNcMQKxkFHfv5NLc0c3Jq8Jcdywx4W9Z1XsTNNnz5wIE01ACINWD oanA== 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:subject:cc:to:from:date :dkim-signature; bh=pmd1jnxTipFsRbNqEhw9JY+rmpcDc61sbT1cFhNUMuM=; b=JlH5xhCrhIYQIwB4V3SAQRqdzjvF396vFiXRB2292zd/4ekQ2oXgZrFX+rGIZm7BGu Fi6w4HJh+zCQJ5i5d4qj9Fzf+o2WF0VdB3Qc4JyZ8VoXJy4dwm5cImELG/MvQEYAL4wu 1k0QqleXjETnc+eQK5bO4i+ZMl8BNqjpcaJPDTZJIaILKV0fWUfKPrAagxnNXtorbmPA zRL0hm0cNIj+jUbbOwjws+oz8c41LkBkNV68Fq63YZOFF0vh3LgtoavLz5N8bWbOFmlf UJTav5XiWtN38wP/xmKVxkAd5wnIhW73zqVPCsjBRDc+QTknJTgZu3qzuzRC8uSiG+0Y 7L4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iGBysdCD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id n2si903279ejd.578.2020.09.02.19.06.03; Wed, 02 Sep 2020 19:06:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iGBysdCD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726814AbgICCCd (ORCPT + 99 others); Wed, 2 Sep 2020 22:02:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:51484 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726177AbgICCCc (ORCPT ); Wed, 2 Sep 2020 22:02:32 -0400 Received: from devnote2 (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 55BC82071B; Thu, 3 Sep 2020 02:02:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599098552; bh=oXS2G4ZGoJ1ZSfjgka22/QmGCif9MbzQQtgewSUYIgc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=iGBysdCDoQ7S5l2sM4OOTwhGD85kpcOGwAZRZPInk0byviyBFEHh+BAjY6AFu/XGq dg9YYWydzm5vxEBic16jogzrdIJVi5Hs7pgfLpEO1bfLab+UV5mw6PaXlzxLoyYMP1 S+ItB222EMS6Adt+KWv/seS7slNhVvdlJCkuaqNI= Date: Thu, 3 Sep 2020 11:02:26 +0900 From: Masami Hiramatsu To: Masami Hiramatsu Cc: peterz@infradead.org, Ingo Molnar , linux-kernel@vger.kernel.org, Eddy_Wu@trendmicro.com, x86@kernel.org, davem@davemloft.net, rostedt@goodmis.org, naveen.n.rao@linux.ibm.com, anil.s.keshavamurthy@intel.com, linux-arch@vger.kernel.org, cameron@moodycamel.com, oleg@redhat.com, will@kernel.org, paulmck@kernel.org, systemtap@sourceware.org Subject: Re: [PATCH v5 00/21] kprobes: Unify kretprobe trampoline handlers and make kretprobe lockless Message-Id: <20200903110226.8963179e6a7c978e2d56c595@kernel.org> In-Reply-To: <20200903103954.68f0c97da57b3679169ce3a7@kernel.org> References: <159870598914.1229682.15230803449082078353.stgit@devnote2> <20200901190808.GK29142@worktop.programming.kicks-ass.net> <20200902093739.8bd13603380951eaddbcd8a5@kernel.org> <20200902070226.GG2674@hirez.programming.kicks-ass.net> <20200902171755.b126672093a3c5d1b3a62a4f@kernel.org> <20200902093613.GY1362448@hirez.programming.kicks-ass.net> <20200902221926.f5cae5b4ad00b8d8f9ad99c7@kernel.org> <20200902134252.GH1362448@hirez.programming.kicks-ass.net> <20200903103954.68f0c97da57b3679169ce3a7@kernel.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 3 Sep 2020 10:39:54 +0900 Masami Hiramatsu wrote: > OK, I've confirmed that the lockdep warns on kretprobe from INT3 > with your fix. Of course make it lockless then warning is gone. > But even without the lockless patch, this warning can be false-positive > because we prohibit nested kprobe call, right? > > If the kprobe user handler uses a spinlock, the spinlock is used > only in that handler (and in the context between kprobe_busy_begin/end), > it will be safe since the spinlock is not nested. > But if the spinlock is shared with other context, it will be dangerous > because it can be interrupted by NMI (including INT3). This also applied > to the function which is called from kprobe user handlers, thus user > has to take care of it. Sorry, for noticing this point, I Cc'd to systemtap. Is systemtap taking care of spinlock too? Thank you, -- Masami Hiramatsu