From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 48E8A606A32D for ; Sat, 5 Dec 2026 03:56:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=oakFy+rT Received: by kanga.kvack.org (Postfix) id 509656B05B1; Fri, 4 Dec 2026 22:56:38 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4E1CE6B05B2; Fri, 4 Dec 2026 22:56:38 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3CF3E6B05BD; Fri, 4 Dec 2026 22:56:38 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 06A466B05B1 for ; Fri, 4 Dec 2026 22:56:37 -0500 (EST) Received: from smtpin06.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 84A0912028A for ; Sat, 5 Dec 2026 03:56:37 +0000 (UTC) X-FDA: 85508567634.06.C7B0189 Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by imf29.hostedemail.com (Postfix) with ESMTP id F3AE3120005 for ; Sat, 5 Dec 2026 03:56:35 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=oakFy+rT; spf=pass (imf29.hostedemail.com: domain of sashiko-bot@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=sashiko-bot@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1796442996; b=JZAqvPih8nabGY5jlCf+IAfsG9cJ0UA2mrKjiqbe2yLJsFb3kG6Ov2RCBGEh1O8kVzk5IJ cUFP5R8yLGQFORFDW1svtpIJgqv6BWt3IUWKS/WFGJrfH/3JrtSsr+MpjC5RQ529fhu91o IHiDFIIpsUMd1L7LDsF0GmNHJIvewRs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1796442996; h=from:from:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ys/qmEU7Z/EFzRv4k3+LWvpT5R9sEwyw1eRX2227xGI=; b=B1FqRaJ4uMJazCLg7jUnLituWvi8sjq595mC8oatA3JuYj04DV/vvgjX8qnMio7yzBQNVI Vp9ref3CeMB+x17UO6wnz+t1DjtkPv1yJ87veMAPsA+izjQx2l1Cvrm/tagWKzEnVX3i9m pAsuYGh+4W0gPOL0mHSAKNhcP+bs2SU= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=oakFy+rT; spf=pass (imf29.hostedemail.com: domain of sashiko-bot@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=sashiko-bot@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 86983601F9; Sat, 5 Dec 2026 03:56:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7054B1F00936; Sat, 5 Dec 2026 03:56:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796442995; bh=ys/qmEU7Z/EFzRv4k3+LWvpT5R9sEwyw1eRX2227xGI=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=oakFy+rT9bHfUpP9DbfAqluQiBlHBXzBPxUOERJPgC+TPcYJt430W2QTpeNe57sDT L/bGk/SQw/h55GzqnuRhSr+hC3uP6kIDKs+O5c3BQv1BIW88s67+EPFJRBMDJ8HSh1 uZnE3hc8ny9N8MqzKgGGaiLHSyPevRaAi9RgWhcE/w9WHhePJ5akKw6jgehLlDlI+0 Ai/LSbdUaxcFQ9aE0OPbXPt1vu0RoVpmfG961DfrPHw6qoIY4BFYBHjqahi1oUTSLw 19i43f72LokpwGKDxEaWBi369uqJa70kofIQIvFaN45Dv6HuOa/pmS4ZjbrmT/nvq7 TU15uRYlbAYjw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [RFC PATCH v10 20/28] proc: Implement ->set_run() fs_context operation Reply-To: sashiko-reviews@lists.linux.dev To: "Jarkko Sakkinen" Cc: bpf@vger.kernel.org, linux-mm@kvack.org, linux-security-module@vger.kernel.org, "Aleksa Sarai" , "Alexander Mikhalitsyn" , "Alexander Viro" , "Alexei Starovoitov" , "Andrew Morton" , "Andrii Nakryiko" , "Andy Lutomirski" , "Arnd Bergmann" , "Baolin Wang" , "Ben Segall" , "Christian Brauner" , "Daniel Borkmann" , "David Hildenbrand" , "David Howells" , "David Woodhouse" , "Davidlohr Bueso" , "Dietmar Eggemann" , "Eduard Zingerman" , "Emil Tsalapatis" , "Eric Biggers" , "Georgia Garcia" , "Giuseppe Scrivano" , =?utf-8?b?R8O8bnRoZXIgTm9hY2s=?= , "Hugh Dickins" , "Ihor Solodrai" , "Ingo Molnar" , "James Morris" , "Jan Kara" , "Jason Gunthorpe" , "Jeff Layton" , "Jiri Olsa" , "John Johansen" , "Jonathan Corbet" , "Josef Bacik" , "Juri Lelli" , "Kees Cook" , "K Prateek Nayak" , "KP Singh" , "Kumar Kartikeya Dwivedi" , "Lennart Poettering" , "Liam R. Howlett" , "Manfred Spraul" , "Martin KaFai Lau" , "Matt Bobrowski" , "Mel Gorman" , "Michal Hocko" , =?utf-8?b?TWlja2HDq2wgU2FsYcO8bg==?= , "Mike Rapoport" , "Neal Gompa" , "Oleg Nesterov" , "Paul Moore" , "Pavel Tikhomirov" , "Peter Zijlstra" , "Randy Dunlap" , "Serge E. Hallyn" , "Serge Hallyn" , "Shuah Khan" , "Song Liu" , "Stephen Smalley" , "Steven Rostedt" , "Valentin Schneider" , "Vincent Guittot" , "Yonghong Song" , "Zygmunt Krynicki" In-Reply-To: <20261205032633.1702772-21-jarkko@kernel.org> References: <20261205032633.1702772-1-jarkko@kernel.org> <20261205032633.1702772-21-jarkko@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sat, 05 Dec 2026 03:56:32 +0000 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: F3AE3120005 X-Rspam-User: X-Stat-Signature: 4f4csayeags194z1fs7ssgcykoii39m8 X-Spam-Status: No, score=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-HE-Tag: 1796442995-696671 X-HE-Meta: U2FsdGVkX183Blk1Ycxlcp6EB/SDpiV/xd74ku7oEVs2eJpqrAAXuajDbVzpGJJBcNcDoTYv07Nbdg73EV+5XXigQSgtTd4gff/8gbqsSi5pAFh4SPACl5LGwyPdp+bEqVrakHmaN81aHyUTZoXkXy6628ujyocpWdvdwpf54H3pG60ZG8b+DFvtOLZZ+cLZ88GPkynVMtdbUdaD53i47Vz0nZa2BjxAGbiIIcQuB7Z7YVKeqYQJbtJFObDDpk+/8Owj23TXm6bdRnreEWQfodv+vbzqGqXbNnJHqf9P4Fwmi8d2jnXhSkfetMJSs7SG4zsFT5ryqQkDV6q0a8Ze6xO2Ps2tFohKhc001XQQkf51jS9yuXDeMagvUM5W8Sf9SQUxToQazMps5KmmKiUtInpcLrDOIAgZkGDDT5IS27kGum4AjgJ4ZXC+hbmUFKEo4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6SUR+ffxW7LJqCf0Yvu2aM+JKgo5qNWUROShQ1sGO0/CYSp95abZga+vd9VecMoeViw8MkKCl9oxZkIWY8uluSs9DIDvWUUS4q55jc3EhvSR0epttSfs5dl11+Aor4q2wRlqDsilrsC8MDpvdnfSH3wg5NEM0ONkRcxsVhqA7g8CY02F8EVlASyvjDmqIHAppRukP/i2EbzFgNiX4iXhed7FvvBjR4RH9XR0K5gDNwa3ks+ZX09TuDQkiJvByEZ2AqZPyXvxHtulputJY9T3/6bDYtvwN/yyh9IlNjwxHN+18gpnuGx6V62u3863FTueQzzvII0j58cQr/LmwDsrUdHXIDJeRiCLi/DBap95aEXk87HENzxLTtuoCgJ8L50qEscaU9QK1ZANWv/bEt5gyT6RMrgvUJVxRYKeVZXxnrVzXz1Iq48y0ewg= Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [High] proc: requiring gid=3D to map in fc->user_ns breaks cross-userns mounts/remounts - [Medium] proc: commit message omits gid=3D, pidns=3D, and reconfigure changes in root.c -- commit 8e67503c4c1018d3d3eb6b19d1ba1139004a37c3 Author: Jarkko Sakkinen > proc: Implement ->set_run() fs_context operation > > proc_init_fs_context() binds ctx->pid_ns to task_active_pid_ns(current) > and resets fc->user_ns to ctx->pid_ns->user_ns, overriding the user > namespace delegated by FSCONFIG_SET_RUN and leaving the context > attached to the caller's PID namespace. > > Wire up proc_set_run() to verify that the target run's PID > namespace is a descendant of the caller's active PID namespace and > rebind ctx->pid_ns and fc->user_ns accordingly, and mark proc with > FS_RUN_MOUNT. > > Co-developed-by: David Howells > Signed-off-by: David Howells > Signed-off-by: Jarkko Sakkinen [Severity: Medium] Should the commit message describe the other functional changes in fs/proc/root.c, or should they be split out? The changelog only mentions wiring up proc_set_run() and setting FS_RUN_MOUNT. The diff also switches Opt_gid to fsparam_gid with kgid_has_mapping() checks and rejects pidns=3D with -EBUSY when fc->run_bound is set. In addition, it changes proc_init_fs_context() to preserve sb->s_user_ns and pid_ns on FS_CONTEXT_FOR_RECONFIGURE, and moves s->s_fs_info =3D fs_info before proc_apply_options() in proc_fill_super(). > diff --git a/fs/proc/root.c b/fs/proc/root.c > index 7fbbe92bf73a7..de14a7933ee59 100644 > --- a/fs/proc/root.c > +++ b/fs/proc/root.c [ ... ] > @@ -178,7 +180,9 @@ static int proc_parse_param(struct fs_context *fc, st= ruct fs_parameter *param) > =20 > switch (opt) { > case Opt_gid: > - ctx->gid =3D result.uint_32; > + if (!kgid_has_mapping(fc->user_ns, result.gid)) > + return invalfc(fc, "Invalid gid"); > + ctx->gid =3D result.gid; > break; [Severity: High] Does requiring gid=3D to map in fc->user_ns here and in proc_apply_options() cause a regression for cross-user-namespace mounts and remounts? Mounting a child user-namespace procfs from init_user_ns with pidns=3D,hidepid=3D2,gid=3D, or remounting a container pro= cfs from init_user_ns, now fails with -EINVAL whenever that gid is unmapped in the child user namespace (including gid=3D0). fsparam_gid already validates gid=3D in current_user_ns(), and procfs never uses fs_info->pid_gid for inode ownership: has_pid_permissions() only calls in_group_p(fs_info->pid_gid) and proc_show_options() formats it in init_user_ns. Dropping the kgid_has_mapping(fc->user_ns, ...) checks would preserve the existing behavior. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261205032633.1702= 772-1-jarkko@kernel.org?part=3D20