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 DB8C71581FD for ; Fri, 05 Sep 2025 14:01:46 +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 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id C1413335D42 for ; Fri, 05 Sep 2025 14:01:46 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id B143A110379; Fri, 05 Sep 2025 14:01:45 +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 A6BD8110379 for ; Fri, 05 Sep 2025 14:01:45 +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 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5552C335D42 for ; Fri, 05 Sep 2025 14:01:45 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A586638BB for ; Fri, 05 Sep 2025 14:01:43 +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: <1757076329.59f69be672470056d48c84c2dc4a1ebec7dfbad9.alicef@gentoo> Subject: [gentoo-commits] proj/linux-patches:6.16 commit in: / X-VCS-Repository: proj/linux-patches X-VCS-Files: 0000_README 1801_proc_fix_type_confusion_in_pde_set_flags.patch X-VCS-Directories: / X-VCS-Committer: alicef X-VCS-Committer-Name: Arisu Tachibana X-VCS-Revision: 59f69be672470056d48c84c2dc4a1ebec7dfbad9 X-VCS-Branch: 6.16 Date: Fri, 05 Sep 2025 14:01:43 +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: 46b4b755-bb48-4090-b36c-35becbe25d77 X-Archives-Hash: d13779f7bb33a1be6425f85ea7a7f42d commit: 59f69be672470056d48c84c2dc4a1ebec7dfbad9 Author: Arisu Tachibana gentoo org> AuthorDate: Fri Sep 5 12:45:29 2025 +0000 Commit: Arisu Tachibana gentoo org> CommitDate: Fri Sep 5 12:45:29 2025 +0000 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=59f69be6 Add 1801_proc_fix_type_confusion_in_pde_set_flags.patch Signed-off-by: Arisu Tachibana gentoo.org> 0000_README | 4 +++ ..._proc_fix_type_confusion_in_pde_set_flags.patch | 40 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/0000_README b/0000_README index df581c25..1902d1c9 100644 --- a/0000_README +++ b/0000_README @@ -79,6 +79,10 @@ 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: 1801_proc_fix_type_confusion_in_pde_set_flags.patch +From: https://lore.kernel.org/linux-fsdevel/20250904135715.3972782-1-wangzijie1@honor.com/ +Desc: proc: fix type confusion in pde_set_flags() + Patch: 2000_BT-Check-key-sizes-only-if-Secure-Simple-Pairing-enabled.patch From: https://lore.kernel.org/linux-bluetooth/20190522070540.48895-1-marcel@holtmann.org/raw Desc: Bluetooth: Check key sizes only when Secure Simple Pairing is enabled. See bug #686758 diff --git a/1801_proc_fix_type_confusion_in_pde_set_flags.patch b/1801_proc_fix_type_confusion_in_pde_set_flags.patch new file mode 100644 index 00000000..4777dbdc --- /dev/null +++ b/1801_proc_fix_type_confusion_in_pde_set_flags.patch @@ -0,0 +1,40 @@ +Subject: [PATCH] proc: fix type confusion in pde_set_flags() + +Commit 2ce3d282bd50 ("proc: fix missing pde_set_flags() for net proc files") +missed a key part in the definition of proc_dir_entry: + +union { + const struct proc_ops *proc_ops; + const struct file_operations *proc_dir_ops; +}; + +So dereference of ->proc_ops assumes it is a proc_ops structure results in +type confusion and make NULL check for 'proc_ops' not work for proc dir. + +Add !S_ISDIR(dp->mode) test before calling pde_set_flags() to fix it. + +Fixes: 2ce3d282bd50 ("proc: fix missing pde_set_flags() for net proc files") +Reported-by: Brad Spengler +Signed-off-by: wangzijie +--- + fs/proc/generic.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/fs/proc/generic.c b/fs/proc/generic.c +index bd0c099cf..176281112 100644 +--- a/fs/proc/generic.c ++++ b/fs/proc/generic.c +@@ -393,7 +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); ++ if (!S_ISDIR(dp->mode)) ++ pde_set_flags(dp); + + write_lock(&proc_subdir_lock); + dp->parent = dir; +-- +2.25.1 + +