From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796329581; b=yDJAwlkyQkXuPLID9vBEwbDH/+KxUYwvhnbFvB//QFlL7y+yetRc7RLrooOnca2rwcJi zZPNZbmIhGLkpIsKLRSjXT1jNI3Wrwf07UEvIP6m/W2IaySJgMI+rc9yjSqM3hvuU6hIX hqyNWoI6WRn0HiP8x+wtDBux2Xv3WRdYm8zGIhBsaePdC0xNNlRMyGwovEXutbZ+JL4ic j6d7DpidbT9Swpqsp3Fx/o+TMg9H8yUeWu7Jek7L+EG9yrwL2dyU19qgKGERhtQqVeBNX J7N/SqTV39Xy4WnIFBon+j7d2kIy5A1/NFKDk8zW9pEhmcAo53FhoXjs0/+rmNUf0Uw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796329581; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: MIME-Version:Content-Transfer-Encoding; bh=fzlEidajrwUQWPWQS7bssyDQTp6bkyecLf/9nJFW35Q=; b=Wbd5k0SAksdmps65Kkj9ECWY1hnrVuMBwyEhC5R2CE0maWAFKdE48CizuWOsVvkpHrHN TAGAjbnph4n9T0YtNNbK4hcYkqmmZaItJ3lHP4BWSTF5sbMEGO1qsHJXNrWJchFYY9pv7 6lsNEC8i1cL3E6Gonm8ed/tlMZTRgTD+mdwRTVQELj4zo/+i8emzTIo83VJEwxG9YfE2O Bk0qUtzouraqWGbPl19rgrAEpKafcUVuCsyCNW5K25D12KaglB+e4/qM/tum9RG8b/zbs VSylfFX6Nw9lLXwiMeNQbpD+8ArHtvKpIMmKyIozGKSSrreK2XN5ZlRwLOLcw4xZj/w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=KzNWYZWJ; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3FC1C606A322; Thu, 3 Dec 2026 20:26:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=KzNWYZWJ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C34A1F000CE; Thu, 3 Dec 2026 20:26:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796329580; bh=fzlEidajrwUQWPWQS7bssyDQTp6bkyecLf/9nJFW35Q=; h=From:To:Cc:Subject:Date; b=KzNWYZWJltsnXWgxLBLdKUSHAGayVII2rkcN2rdMTWhSl/Vzq/N5hUyNr5LRAG0b6 cZLdkG0bdMLNWs+d9Oxq3DZk6NWi0WdYcRUiDKOJAZlucbCLtLwA3/CbUAWwSj3+V2 1SiWnY5T9C5/XXDIdjeHmzTG8VFlBEhImXu/Yui80pfWBzLINsiXOXxP2leezyNH5k +NUymbgxjt0R5DVfGP0fQ1Fds+4+Tfkb+AuoI5A+W03gplxwf+uXQhDQ/J+T243fUS eo8EHGv7Z0njqvgFChLIAn4Z3uRGNLLVoorpg79kvCl44Zi9YfWKd+eJ3xezPPE2qY Q7dp54i64os9A== From: Chris Mason To: bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, jolsa@kernel.org, song@kernel.org Cc: eddyz87@gmail.com, memxor@gmail.com, martin.lau@linux.dev, yonghong.song@linux.dev, emil@etsalapatis.com, ihor.solodrai@linux.dev, rostedt@goodmis.org, mhiramat@kernel.org, mathieu.desnoyers@efficios.com, mjambigi@linux.ibm.com, petr.pavlu@suse.com, linux-trace-kernel@vger.kernel.org, linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org, mason@kernel.org Subject: [PATCH bpf 0/2] bpf: don't attach links to modules that are still loading Date: Thu, 3 Dec 2026 15:26:15 -0500 Message-ID: <20261203202617.31741-1-mason@kernel.org> X-Mailer: git-send-email 2.55.0 X-Mailing-List: linux-modules@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi everyone, These are AI generated fixes for two use-after-frees in BPF links. When a module fails to load, we free it without checking for references. If somebody creates a link while it's still loading, the link is left pointing at freed memory. With these applied, the link fails until the module is live. Mahanta Jambigi has a patch that makes the module loader wait for those references instead: [PATCH v2] module: drain external refs before freeing a failed-init module https://lore.kernel.org/all/20261201103922.1480284-1-mjambigi@linux.ibm.com/ It doesn't cover all of the ways a load can fail, and an open link could make it wait forever, so I think we need both. This is on top of v7.4-rc5. Chris Mason (2): bpf: Reject raw tracepoint links on coming modules bpf: Reject kprobe_multi links on coming modules kernel/trace/bpf_trace.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244 -- 2.55.0