From mboxrd@z Thu Jan 1 00:00:00 1970 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 659863264F7; Sat, 12 Sep 2026 13:54:22 +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=1789221264; cv=none; b=pVJgYbuEY0jBhUXngt9EUGnGuAj/aC8eIir0mxgDZiQWfHjFQuzRopYtIgMJjN0pod8vZxW4SUoG2I0j+SAHb7cCN1IHpmwUFHln7xHi0bgYJSyV3kAVpVhdgfAsPOJfHAK7BI6ewDLwrVL5OyWHKUhB8GiMcviG8QvXdwwQQbE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789221264; c=relaxed/simple; bh=BQjZcCkwgj8kbBlUT3VdnSVATiAvqsUXS9Wfypaym1Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=COxzA+ul9yG2gouPBzFPghXZRLjU0FXAxHQAvj96cS2zMaDwi2AhneK7+K+TxGd21IGXlff04uOlXMPdMBPgIbMj14VE83TME49xuXddiJykNBjMOpWL5aVnrEUkPKl3FQLoYo38yOkwvyPyIugDka8Sm9smvzbehqah5b84BFU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=pwkukzVx; 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="pwkukzVx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 100DD1F00893; Sat, 12 Sep 2026 13:54:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789221260; bh=GKsyPq2oZC3OyVCEWwQ5yAt/dVnuPdg/vPsleshym1E=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=pwkukzVxID+SfBNla66uJimAdyBxJV1zehn/mVXvU58FITQP59efyKI7+uHDE8ATQ SdwSU+plZ5CjRi5hnKlatJ7zIjScSPUnQ+teEWjnNqQW56X0TYsDkzPyjNad8CT8ia 146f48wD7JzsY4TRgKOlk7IUq0BZCjI12rHvpOLE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Bradley Morgan , Oleg Nesterov , "Eric W. Biederman" , Adrian Huang , Aleksandr Nogikh , Christian Brauner , Marco Elver , "Masami Hiramatsu (Google)" , Mathieu Desnoyers , Peter Zijlstra , Steven Rostedt , Andrew Morton Subject: [PATCH 6.6 0303/1424] signal: avoid shared siginfo namespace rewrites Date: Sat, 12 Sep 2026 08:45:35 +0200 Message-ID: <20260912065614.071313767@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065607.279695368@linuxfoundation.org> References: <20260912065607.279695368@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.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bradley Morgan commit d19cdc167e696714509e87d3f7ae765b6e164589 upstream. send_signal_locked() rewrites sender ids for the target namespace. Group sends reuse the same siginfo, so one recipient can affect the next. Copy the siginfo before changing it. Link: https://lore.kernel.org/86a8857d58d43ee26a8b365b837fd24830343494.1782159692.git.include@grrlz.net Fixes: 7a0cf094944e ("signal: Correct namespace fixups of si_pid and si_uid") Signed-off-by: Bradley Morgan Acked-by: Oleg Nesterov Cc: "Eric W. Biederman" Cc: Adrian Huang Cc: Aleksandr Nogikh Cc: Christian Brauner Cc: Marco Elver Cc: "Masami Hiramatsu (Google)" Cc: Mathieu Desnoyers Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- kernel/signal.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/kernel/signal.c +++ b/kernel/signal.c @@ -1226,6 +1226,7 @@ static inline bool has_si_pid_and_uid(st int send_signal_locked(int sig, struct kernel_siginfo *info, struct task_struct *t, enum pid_type type) { + struct kernel_siginfo rewritten; /* Should SIGKILL or SIGSTOP be received by a pid namespace init? */ bool force = false; @@ -1239,6 +1240,9 @@ int send_signal_locked(int sig, struct k /* SIGKILL and SIGSTOP is special or has ids */ struct user_namespace *t_user_ns; + rewritten = *info; + info = &rewritten; + rcu_read_lock(); t_user_ns = task_cred_xxx(t, user_ns); if (current_user_ns() != t_user_ns) {