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 D28B83FD14F for ; Fri, 26 Jun 2026 16:36: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=1782491765; cv=none; b=cZPqABE/PCqKApmiWLBY3By/iCsLgAQBbm4g7wMnEl2ApXWJ3MylZ5Dz1GhyVXDcWQYUrH+clyv4DyIAXTj/Ch5DzzXY8BiGH0+e1TSQmbeuR2xVws+FN/2RwiHZea+OF6SnkbvlHM3iM0A7vEPSSKv4+Uew6LkcpXRzAOrHHvY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782491765; c=relaxed/simple; bh=/wkaPTU6SBybXQr9txp6VRIrLyoywWF5lQg/aAK22Qw=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=qSP37Z6l1w2ohZCR7Z31CIJuXPm7kBFx4K/71rn4SbeDY2lwCVDLREo8i6qL2Oo1paYsxmi2+5Uk/JzY3qfNmAJyKiHRHcluV/aunNC2i31Y1qH7p3R+XlJLWK1x1zNyv28l2Nt5e0awbk3T1kYm3Y+f0vxL1O+gSEU9j48GtBU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=X/TFNwL4; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="X/TFNwL4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 429BA1F000E9; Fri, 26 Jun 2026 16:36:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1782491764; bh=M0pfEfK64qkNCd3ngmR08W6vV9ruU228fV0z5NJN3IQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=X/TFNwL4PF+N6omD8M70S918GFDsEjEPd9pETafVC7E8qlwNkjk5mQdF2BtyKAy+y awDZngwBrDBHqRiI/6TXeIIac9pCuIzRIlOysviNhOOG8hsB/VEDzLzHj/E5M3UrjY plK08H53SZmZk85n5x6HazmWNDfZXJbkF9x8vY3c= Date: Fri, 26 Jun 2026 09:36:03 -0700 From: Andrew Morton To: Oleg Nesterov Cc: Bradley Morgan , "Eric W. Biederman" , linux-kernel@vger.kernel.org Subject: Re: [PATCH] signal: change sys_kill() to use SEND_SIG_NOINFO Message-Id: <20260626093603.7eb06a58684e0d02f3b9d0f8@linux-foundation.org> In-Reply-To: References: X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 26 Jun 2026 17:33:08 +0200 Oleg Nesterov wrote: > prepare_kill_siginfo(PIDTYPE_TGID) fills si_code = SI_USER and sets > si_pid/si_uid in the sender's namespace. Then send_signal_locked() > translates si_pid/si_uid to the target's namespace. > > SEND_SIG_NOINFO produces the same result: si_code = SI_USER, and > __send_signal_locked() computes si_pid/si_uid directly in the target's > namespace. The force computation is also the same: both check if the > sender is visible in the target's pid namespace. The above paragraphs contain no description of any flaw. What's wrong here? > Note: this also fixes the kill(-1, sig) case where send_signal_locked() > rewrites si_pid/si_uid in the shared siginfo, corrupting it for subsequent > recipients. But for other group senders like __kill_pgrp_info() we still > need the fix from Bradley Morgan [1] who found this problem. "also fixes". Again, what was the first fix? > TODO: kill prepare_kill_siginfo() and change other users to use > SEND_SIG_NOINFO too. This needs trivial changes in __send_signal_locked() > and TP_STORE_SIGINFO(). > > ... > > --- a/kernel/signal.c > +++ b/kernel/signal.c > @@ -3966,11 +3966,7 @@ static void prepare_kill_siginfo(int sig, struct kernel_siginfo *info, > */ > SYSCALL_DEFINE2(kill, pid_t, pid, int, sig) > { > - struct kernel_siginfo info; > - > - prepare_kill_siginfo(sig, &info, PIDTYPE_TGID); > - > - return kill_something_info(sig, &info, pid); > + return kill_something_info(sig, SEND_SIG_NOINFO, pid); > } Thanks, I'll queue this for testing. Please send along some changelog edits sometime?