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 A69BB42AF8A; Fri, 4 Sep 2026 06:23:04 +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=1788502985; cv=none; b=XeP1fg0/nSlPTwwrLF0XPjH4YrwDVwghwGW5h69zIDvaJOwAWjAop4CRXhE2qnSKlN3xaCRlKVGZAEo/W5UOM8rtMAjLltAkA1PoFKcZgjxmnI5y14U+C/w66uCa87zYtYf5CZOKX0KCsaZTet9eCxh/AGsU3Lz1uV3VHjaoLNU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788502985; c=relaxed/simple; bh=midn41aHURlmzYFma3J3LxlROfc2mmFqUipc0ovtql8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jZ6uijks9zE9LFEmtYriyMvkkUghyAOZYzkckOti9HOO2xmZ8F5LWJDJG/zqyUtxc6PnrOIicoaQK+p81VIw36g9sQr1TJgb/v52a1ClRQotFP83ra8X3jK3WLsNFiTyLkWfrfPFWaORTcNqpadsBjCYhpjfBGuby2Yi1tbyDPQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=N8878KOM; 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="N8878KOM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 066A01F00AC4; Fri, 4 Sep 2026 06:23:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1788502984; bh=vuVGwdSJ4waqHMvMo+V3vlUOE3InrZaBcl3HORFwxOQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=N8878KOMseYLK5mPNRZc/RLo8n63oxM5kg9fml2ysphc3SI6eQTAvqDwcLibPmI8X JeUsdh7NvQ6+PylL1qrvGIaKxRgb2lUos0eQUaYc+r5uhpredCm/J0p3ns1NYjYA1Y DrFpe3J1x+BlsLzMzV1SVatk0Ji5XMGO0F5iCsMM= 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.12 398/403] signal: avoid shared siginfo namespace rewrites Date: Fri, 4 Sep 2026 07:03:21 +0200 Message-ID: <20260904045743.830560030@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260904045734.806166532@linuxfoundation.org> References: <20260904045734.806166532@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.12-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 @@ -1214,6 +1214,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; @@ -1227,6 +1228,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) {