From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796442995; b=Hk3jV+4V2hmFI+W1Lo7sU1ZETaCfGu4tmBuCFJFQzocGiezRZsW/2Ty8vCLlkr9Mvkz4 LKSVst+HSxVvffPtJ6vlueGHvpDrEEk70whLx9dHEkS/3PvIqs4J1JIFGYiNffDIAjyWY KEdvNsx8Q+Wmmr7unBDIBHNCOlJZ+YNiXyk97sQFXWtjJxSeqoRETaoXkQsCKyu/EsqUV 0gSku7wAC3eqBuCOxBnSpOdW4HJGoFoyWMJANCn5/DxLX+RGdlw2qb1BKFG4usfuRybXq /sYXL1bNnUA2aPgiwruLAnjfEo+Oo0WsxIeXjEACYBDYa4skB+TBk7jY59fL7blgE0w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796442995; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=ys/qmEU7Z/EFzRv4k3+LWvpT5R9sEwyw1eRX2227xGI=; b=ZrKbRQbjPJYn29vQr+UFDMVEItOrlfdAlkzAB21MiPr1NtaHD0HOhLStDizrItjzRGzy UG221avAf7XHgN0WI2nzd3wBi6TGPYPI/1jWl5x2B8kSgNIom4613fSTzWHwKKQiENbWe Uy69j70VcbfX2g+Kf1+RyNIuNJ2LEn6DKl1wdzMlh+2TCHtk8nsvmLRhtSQiK8nXV2EFa kgJbt3+z9D6EveVnzLOupHYOGL4G65QoEZ9IiHHDAom9kqyg/UsbkP5GhllwlHRSkiw6x VrzH51bUTw8indZOenT2Zk8NQMVrMu5ZPaCDj8BAq3rZbbAml2R5gBzrQyLSBDr2Zwg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=oakFy+rT; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 66AAA606A322; Sat, 5 Dec 2026 03:56:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=oakFy+rT 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-Mailing-List: linux-security-module@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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