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 5507430C17B for ; Wed, 24 Jun 2026 16:32:31 +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=1782318752; cv=none; b=R5BycHV8R8hNWYcZ/2XtMiGWSp6vH+GBSVsMSjYtsiCJG2RRoOKt4BXU1EwGwPiY4Zc6kHb2FeEWfupRkZrxWsSDF0xCUkCktkI3QAvJn3DmeJ9YtgJiGA8BTUL36tpB8Ff60yFN60owVsEi7nMT+0AgijF1LkghhXvX3wXKuA8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782318752; c=relaxed/simple; bh=E1T4wE0ygiMAZv855NIhDr6DZngYGNQdjcNp156J/eo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pLmisrxXa//fmFbot9OfEX4o/GIqioKQ7PJe8zS/bycbTrl7D7KrL/3MhIKOmG5WbsHJhvWQDtseMCYj9+lrKXkvwqRllkZrG9KnMWLLJfXFemfCHXZj9Uest0mfz4kpiyqTnclphat1lG57365+DjP5HAaI4JEo61ueWm5ANuM= 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=O2GYdMlz; 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="O2GYdMlz" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1782318750; 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=weXIXIEuSPHid59fYxq8EFYgzpqn8iZGIP2KySkFB54=; b=O2GYdMlzghy2VAatv+ab3gpmMFapTfbFqIIUpbYGChQM0D0CQfKkbD3LTFuLMbPFyh+Ika OlR4Fm82lm+b/vxUGl2GIsPZfZUKcyxAL1frRW5uu8fs1wqdZ96kfMHUcxgps8v5Vo6xPN +8rsiXVN+l057AohEI44U0kjdvo5604= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-257-QhMcd1y6N8a7NM5r8orjow-1; Wed, 24 Jun 2026 12:32:23 -0400 X-MC-Unique: QhMcd1y6N8a7NM5r8orjow-1 X-Mimecast-MFC-AGG-ID: QhMcd1y6N8a7NM5r8orjow_1782318741 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 432FE18052D6; Wed, 24 Jun 2026 16:32:21 +0000 (UTC) Received: from fedora (unknown [10.44.33.191]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 4CFD0180058F; Wed, 24 Jun 2026 16:32:15 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Wed, 24 Jun 2026 18:32:20 +0200 (CEST) Date: Wed, 24 Jun 2026 18:32:13 +0200 From: Oleg Nesterov To: Bradley Morgan , "Eric W. Biederman" Cc: Christian Brauner , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Andrew Morton , Peter Zijlstra , Marco Elver , Aleksandr Nogikh , Thomas Gleixner , Adrian Huang , Kexin Sun , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v2 1/2] signal: avoid shared siginfo namespace rewrites Message-ID: References: <20260622164029.11474-1-include@grrlz.net> <86a8857d58d43ee26a8b365b837fd24830343494.1782159692.git.include@grrlz.net> <87bjd0c5xk.fsf@email.froward.int.ebiederm.org> 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: X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 On 06/24, Bradley Morgan wrote: > > Hey you two, sorry to impede in your conversation, but could we write > your "conflicting" patch over my Patch 2? > > It's fine if you don't want to, it kind of kills two birds with one stone. No, sorry, I don't ;) at least right now. Because I don't really like the changes it adds into send_signal_locked(). But perhaps I didn't read it carefully. Can we return to it later? There is another reason... Currently I am very busy but I am thinking about another change on top of your 1/2. Something like below. Not sure it makes a lot of sense though. Eric, do you think this optimization on top of 1/2 makes sense? Oleg. int send_signal_locked(int sig, struct kernel_siginfo *info, struct task_struct *t, enum pid_type type) { /* Should SIGKILL or SIGSTOP be received by a pid namespace init? */ struct kernel_siginfo __info; bool force = false; if (info == SEND_SIG_NOINFO) { /* Force if sent from an ancestor pid namespace */ force = !task_pid_nr_ns(current, task_active_pid_ns(t)); } else if (info == SEND_SIG_PRIV) { /* Don't ignore kernel generated signals */ force = true; } else if (has_si_pid_and_uid(info)) { /* SIGKILL and SIGSTOP is special or has ids */ struct user_namespace *t_user_ns; #ifdef CONFIG_USER_NS rcu_read_lock(); t_user_ns = task_cred_xxx(t, user_ns); if (current_user_ns() != t_user_ns) { __info = *info; info = &__info; kuid_t uid = make_kuid(current_user_ns(), info->si_uid); info->si_uid = from_kuid_munged(t_user_ns, uid); } rcu_read_unlock(); #endif /* A kernel generated signal? */ force = (info->si_code == SI_KERNEL); #ifdef CONFIG_PID_NS /* From an ancestor pid namespace? */ if (!task_pid_nr_ns(current, task_active_pid_ns(t))) { if (info != &__info) { __info = *info; info = &__info; } info->si_pid = 0; force = true; } #endif } return __send_signal_locked(sig, info, t, type, force); }