From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 3F6011581FD for ; Wed, 10 Sep 2025 06:25:32 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 18980340906 for ; Wed, 10 Sep 2025 06:25:32 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id F108F110377; Wed, 10 Sep 2025 06:25:30 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id E481B110377 for ; Wed, 10 Sep 2025 06:25:30 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 91BB7340906 for ; Wed, 10 Sep 2025 06:25:30 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 27AE8322B for ; Wed, 10 Sep 2025 06:25:29 +0000 (UTC) From: "Arisu Tachibana" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Arisu Tachibana" Message-ID: <1757485500.d3ccadd18676d781a5e80474b29d51780b19130f.alicef@gentoo> Subject: [gentoo-commits] proj/linux-patches:6.6 commit in: / X-VCS-Repository: proj/linux-patches X-VCS-Files: 0000_README 1800_proc_fix_missing_pde_set_flags_for_net_proc_files.patch X-VCS-Directories: / X-VCS-Committer: alicef X-VCS-Committer-Name: Arisu Tachibana X-VCS-Revision: d3ccadd18676d781a5e80474b29d51780b19130f X-VCS-Branch: 6.6 Date: Wed, 10 Sep 2025 06:25:29 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 1416c5d3-10f3-4b96-9049-a0f1bb31b90c X-Archives-Hash: 3f4239713d564dea1cd056ddb200f070 commit: d3ccadd18676d781a5e80474b29d51780b19130f Author: Arisu Tachibana gentoo org> AuthorDate: Wed Sep 10 06:22:34 2025 +0000 Commit: Arisu Tachibana gentoo org> CommitDate: Wed Sep 10 06:25:00 2025 +0000 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=d3ccadd1 Remove 1800_proc_fix_missing_pde_set_flags_for_net_proc_files.patch Signed-off-by: Arisu Tachibana gentoo.org> 0000_README | 4 - ..._missing_pde_set_flags_for_net_proc_files.patch | 129 --------------------- 2 files changed, 133 deletions(-) diff --git a/0000_README b/0000_README index e61b3981..db45e6ad 100644 --- a/0000_README +++ b/0000_README @@ -475,10 +475,6 @@ Patch: 1730_parisc-Disable-prctl.patch From: https://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux.git Desc: prctl: Temporarily disable prctl(PR_SET_MDWE) on parisc -Patch: 1800_proc_fix_missing_pde_set_flags_for_net_proc_files.patch -From: https://lore.kernel.org/all/20250821105806.1453833-1-wangzijie1@honor.com/ -Desc: proc: fix missing pde_set_flags() for net proc files - Patch: 1900_btrfs-dev-mapper-name-soft-link-fix.patch From: https://lore.kernel.org/linux-btrfs/30aefd8b4e8c1f0c5051630b106a1ff3570d28ed.1735537399.git.wqu@suse.com/T/#u Desc: btrfs: prefer to use "/dev/mapper/name" soft link instead of "/dev/dm-*" diff --git a/1800_proc_fix_missing_pde_set_flags_for_net_proc_files.patch b/1800_proc_fix_missing_pde_set_flags_for_net_proc_files.patch deleted file mode 100644 index 8632f53b..00000000 --- a/1800_proc_fix_missing_pde_set_flags_for_net_proc_files.patch +++ /dev/null @@ -1,129 +0,0 @@ -Subject: [PATCH v3] proc: fix missing pde_set_flags() for net proc files -Date: Thu, 21 Aug 2025 18:58:06 +0800 -Message-ID: <20250821105806.1453833-1-wangzijie1@honor.com> -X-Mailer: git-send-email 2.25.1 -Precedence: bulk -X-Mailing-List: regressions@lists.linux.dev -List-Id: -List-Subscribe: -List-Unsubscribe: -MIME-Version: 1.0 -Content-Transfer-Encoding: 8bit -Content-Type: text/plain -X-ClientProxiedBy: w002.hihonor.com (10.68.28.120) To a011.hihonor.com - (10.68.31.243) - -To avoid potential UAF issues during module removal races, we use pde_set_flags() -to save proc_ops flags in PDE itself before proc_register(), and then use -pde_has_proc_*() helpers instead of directly dereferencing pde->proc_ops->*. - -However, the pde_set_flags() call was missing when creating net related proc files. -This omission caused incorrect behavior which FMODE_LSEEK was being cleared -inappropriately in proc_reg_open() for net proc files. Lars reported it in this link[1]. - -Fix this by ensuring pde_set_flags() is called when register proc entry, and add -NULL check for proc_ops in pde_set_flags(). - -[1]: https://lore.kernel.org/all/20250815195616.64497967@chagall.paradoxon.rec/ - -Fixes: ff7ec8dc1b64 ("proc: use the same treatment to check proc_lseek as ones for proc_read_iter et.al") -Cc: stable@vger.kernel.org -Reported-by: Lars Wendler -Signed-off-by: wangzijie ---- -v3: -- followed by Christian's suggestion to stash pde->proc_ops in a local const variable -v2: -- followed by Jiri's suggestion to refractor code and reformat commit message ---- - fs/proc/generic.c | 38 +++++++++++++++++++++----------------- - 1 file changed, 21 insertions(+), 17 deletions(-) - -diff --git a/fs/proc/generic.c b/fs/proc/generic.c -index 76e800e38..bd0c099cf 100644 ---- a/fs/proc/generic.c -+++ b/fs/proc/generic.c -@@ -367,6 +367,25 @@ static const struct inode_operations proc_dir_inode_operations = { - .setattr = proc_notify_change, - }; - -+static void pde_set_flags(struct proc_dir_entry *pde) -+{ -+ const struct proc_ops *proc_ops = pde->proc_ops; -+ -+ if (!proc_ops) -+ return; -+ -+ if (proc_ops->proc_flags & PROC_ENTRY_PERMANENT) -+ pde->flags |= PROC_ENTRY_PERMANENT; -+ if (proc_ops->proc_read_iter) -+ pde->flags |= PROC_ENTRY_proc_read_iter; -+#ifdef CONFIG_COMPAT -+ if (proc_ops->proc_compat_ioctl) -+ pde->flags |= PROC_ENTRY_proc_compat_ioctl; -+#endif -+ if (proc_ops->proc_lseek) -+ pde->flags |= PROC_ENTRY_proc_lseek; -+} -+ - /* returns the registered entry, or frees dp and returns NULL on failure */ - struct proc_dir_entry *proc_register(struct proc_dir_entry *dir, - struct proc_dir_entry *dp) -@@ -374,6 +393,8 @@ struct proc_dir_entry *proc_register(struct proc_dir_entry *dir, - if (proc_alloc_inum(&dp->low_ino)) - goto out_free_entry; - -+ pde_set_flags(dp); -+ - write_lock(&proc_subdir_lock); - dp->parent = dir; - if (pde_subdir_insert(dir, dp) == false) { -@@ -561,20 +582,6 @@ struct proc_dir_entry *proc_create_reg(const char *name, umode_t mode, - return p; - } - --static void pde_set_flags(struct proc_dir_entry *pde) --{ -- if (pde->proc_ops->proc_flags & PROC_ENTRY_PERMANENT) -- pde->flags |= PROC_ENTRY_PERMANENT; -- if (pde->proc_ops->proc_read_iter) -- pde->flags |= PROC_ENTRY_proc_read_iter; --#ifdef CONFIG_COMPAT -- if (pde->proc_ops->proc_compat_ioctl) -- pde->flags |= PROC_ENTRY_proc_compat_ioctl; --#endif -- if (pde->proc_ops->proc_lseek) -- pde->flags |= PROC_ENTRY_proc_lseek; --} -- - struct proc_dir_entry *proc_create_data(const char *name, umode_t mode, - struct proc_dir_entry *parent, - const struct proc_ops *proc_ops, void *data) -@@ -585,7 +592,6 @@ struct proc_dir_entry *proc_create_data(const char *name, umode_t mode, - if (!p) - return NULL; - p->proc_ops = proc_ops; -- pde_set_flags(p); - return proc_register(parent, p); - } - EXPORT_SYMBOL(proc_create_data); -@@ -636,7 +642,6 @@ struct proc_dir_entry *proc_create_seq_private(const char *name, umode_t mode, - p->proc_ops = &proc_seq_ops; - p->seq_ops = ops; - p->state_size = state_size; -- pde_set_flags(p); - return proc_register(parent, p); - } - EXPORT_SYMBOL(proc_create_seq_private); -@@ -667,7 +672,6 @@ struct proc_dir_entry *proc_create_single_data(const char *name, umode_t mode, - return NULL; - p->proc_ops = &proc_single_ops; - p->single_show = show; -- pde_set_flags(p); - return proc_register(parent, p); - } - EXPORT_SYMBOL(proc_create_single_data); --- -2.25.1 - -