Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5612851588F; Thu, 17 Sep 2026 17:19:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789665594; cv=none; b=Pry0MZRM+MKVML979NTGavIEiW1darDqO7T1PVKPkPQnr1lcw2ahe0V3s8Re7J7Ns31DJOHkk3+62+y7+O7Xm+SID+snKFsoaJpUOonzTddSwBMP1OD+LPNfez+M9kB9F5VyvvYmaMHGS7QVno6uFjk22LKzdKGs+pHThwgJX6c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789665594; c=relaxed/simple; bh=8A/e4nIJtFovLG9tc2JuNY5plT3M2gacHJdDao6iC7A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ptmQhVpuaKYnkkff5GstQAipzLJlayjG7dybdIUzoaWXsQmKiRjkdpryMlh3kkvZ5zGCd9m0F9cFLCJrx2KHpCqDscSgNI9fVsWisvZaMfhme3J6WrRi96/MRh6perX/jYmMKggc1dZQO7HPpcz+zU86VzAWJBII4ZE1fjE0RV8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=NdzXiqrz; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="NdzXiqrz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ADED51F000FF; Thu, 17 Sep 2026 17:19:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789665593; bh=OrmWvBJWoGRHiwqsChgYQedtBw/bZcF934WeNE6mR/k=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=NdzXiqrzrr9MotsKiaxChYE6sLV8V8p/Ndqn8O+l0+uCHUbRSlGAhyUYGKGBKj0sK FO5+AtPia3XGzU6u636rrCFSDGdMRqN5L5slN8nIPD+uvw2o8aM+THrzP426BFtpzK lQ1N2diN0TVdlUeV6akfo6gAqBYuT2z087ExXElQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Nicholas Carlini , Kumar Kartikeya Dwivedi , Alexei Starovoitov , Sasha Levin Subject: [PATCH 6.18 0756/1250] bpf: Mark signal tracepoint siginfo arguments as scalar Date: Thu, 17 Sep 2026 16:09:11 +0100 Message-ID: <20260917151612.365548593@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260917151551.901433442@linuxfoundation.org> References: <20260917151551.901433442@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kumar Kartikeya Dwivedi [ Upstream commit 77515ab12e4983e6416f8c35039a3f0c0822ac70 ] The signal_generate and signal_deliver tracepoints declare their info argument as a struct kernel_siginfo pointer. btf_ctx_access() therefore treats it as a trusted pointer for tp_btf programs. Signal delivery also uses SEND_SIG_NOINFO and SEND_SIG_PRIV as special values for this argument. Those values are zero and one respectively, and are not pointers. A tp_btf program can currently dereference either value and fault the kernel. In particular, signal_generate can run from timer interrupt context, turning the fault into a kernel panic. Record both tracepoints in raw_tp_null_args[] and mark argument one as a non-pointer. This preserves scalar access to the cookie while rejecting direct and helper-mediated pointer use. Merely marking it nullable would not suffice because SEND_SIG_PRIV is nonzero. Fixes: 838a10bd2ebf ("bpf: Augment raw_tp arguments with PTR_MAYBE_NULL") Reported-by: Nicholas Carlini Suggested-by: Nicholas Carlini Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20260903144433.1716731-2-memxor@gmail.com Signed-off-by: Alexei Starovoitov Signed-off-by: Sasha Levin --- kernel/bpf/btf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c index 2483d6ce3ddaf..9f3a28cdbc345 100644 --- a/kernel/bpf/btf.c +++ b/kernel/bpf/btf.c @@ -6561,6 +6561,9 @@ static const struct bpf_raw_tp_null_args raw_tp_null_args[] = { { "rxrpc_resend", 0x10 }, { "rxrpc_tq", 0x10 }, { "rxrpc_client", 0x1 }, + /* signal */ + { "signal_generate", 0x20 }, + { "signal_deliver", 0x20 }, /* skb */ {"kfree_skb", 0x1000}, /* sunrpc */ -- 2.53.0