From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 843AC1917CD for ; Fri, 26 Jun 2026 14:29:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782484166; cv=none; b=kkfLoav1ElBSa3SG1dRqcD/ZmS7sMmcNfYNk+OSPaVYmHutfTxO8aC01cfJGM4qHYI/NibDOv2mjmUW0o3v5SDsGz3hZEIJ9aUF17a5M8TfC1AIs3YQvAQv0tyznxLNujM05/IUCPddJu7OePyHMrhxPOcan9RyYNRLotkZPqc4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782484166; c=relaxed/simple; bh=BuiKi8nT3ANJ0o4TFP2alv/b/UPldMGvXxUInb2vRhc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lD8Vqm8a2BZ98krdAOSlSjS4nACqSeul+sc6qPezoH2vgyz6lLoPI/b5X/x6krcfU3gzRv5nmStsSQD6ssbQa5gk9Es9lx2ZzR0R2BGmBppoXzagm2A555ol3muwnMUEyh8tdeNsf5WmonLMP4cTeErNOerJtyJjytHx7nO8hRs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=cNTCN8Pg; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="cNTCN8Pg" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1782484160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=nxjc3mAVcsKzV3pEhXiWe9V3Wg4iCKIdlp1rzL9EcEM=; b=cNTCN8PgGaJxGtyYNexyzo/x6jZb3lrsVg2RP0x/YVmPisWbcjUczrDeyPGvIbOBzHhFo2 OaucEzqVkYHRCK9GZcUtDgcLmstov0DwVgsv0XuT1hzBeiMZ80WbLU2GcCgoChu+ooCQLr JqrpHmyNxCCMFlgMbi1KKgfVX25zZsw= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-467-1w9T0iaePlKv9JowjsO52g-1; Fri, 26 Jun 2026 10:29:16 -0400 X-MC-Unique: 1w9T0iaePlKv9JowjsO52g-1 X-Mimecast-MFC-AGG-ID: 1w9T0iaePlKv9JowjsO52g_1782484154 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 04F40195609F; Fri, 26 Jun 2026 14:29:14 +0000 (UTC) Received: from fedora (unknown [10.44.33.126]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id D59721956094; Fri, 26 Jun 2026 14:29:08 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Fri, 26 Jun 2026 16:29:13 +0200 (CEST) Date: Fri, 26 Jun 2026 16:29:07 +0200 From: Oleg Nesterov To: Andrew Morton , Bradley Morgan , ebiederm@xmission.com Cc: Christian Brauner , Peter Zijlstra , Adrian Huang , Marco Elver , Kexin Sun , Thomas Gleixner , linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] signal: avoid shared siginfo namespace rewrites Message-ID: References: <20260622164029.11474-1-include@grrlz.net> 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-Disposition: inline In-Reply-To: <20260622164029.11474-1-include@grrlz.net> X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 To avoid the confusion, let me reply to V1 again. Acked-by: Oleg Nesterov IIUC Eric is fine with this change too. Andrew, can you take this fix please? We will send more changes on top of it. On 06/22, Bradley Morgan wrote: > > 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. > > Fixes: 7a0cf094944e ("signal: Correct namespace fixups of si_pid and si_uid") > Cc: stable@vger.kernel.org > Signed-off-by: Bradley Morgan > --- > kernel/signal.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/kernel/signal.c b/kernel/signal.c > index b9fc7be1a169..d72d9be3a992 100644 > --- a/kernel/signal.c > +++ b/kernel/signal.c > @@ -1181,6 +1181,7 @@ static inline bool has_si_pid_and_uid(struct kernel_siginfo *info) > 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; > > @@ -1194,6 +1195,9 @@ int send_signal_locked(int sig, struct kernel_siginfo *info, > /* 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) { > -- > 2.53.0 >