* + proc-clear-fmode_lseek-flag-correctly-for-permanent-pde.patch added to mm-nonmm-unstable branch
@ 2025-06-05 21:45 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2025-06-05 21:45 UTC (permalink / raw)
To: mm-commits, rick.p.edgecombe, kirill.shutemov, ast, adobriyan,
wangzijie1, akpm
The patch titled
Subject: proc: clear FMODE_LSEEK flag correctly for permanent pde
has been added to the -mm mm-nonmm-unstable branch. Its filename is
proc-clear-fmode_lseek-flag-correctly-for-permanent-pde.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/proc-clear-fmode_lseek-flag-correctly-for-permanent-pde.patch
This patch will later appear in the mm-nonmm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
From: wangzijie <wangzijie1@honor.com>
Subject: proc: clear FMODE_LSEEK flag correctly for permanent pde
Date: Thu, 5 Jun 2025 14:52:52 +0800
Clearing FMODE_LSEEK flag should not rely on whether proc_open ops exists,
fix it.
Link: https://lkml.kernel.org/r/20250605065252.900317-1-wangzijie1@honor.com
Fixes: ad7f4ea6e36e ("proc: avoid use-after-free in proc_reg_open()")
Signed-off-by: wangzijie <wangzijie1@honor.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
Cc: Kirill A. Shuemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
fs/proc/inode.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
--- a/fs/proc/inode.c~proc-clear-fmode_lseek-flag-correctly-for-permanent-pde
+++ a/fs/proc/inode.c
@@ -474,12 +474,11 @@ static int proc_reg_open(struct inode *i
struct pde_opener *pdeo;
if (pde_is_permanent(pde)) {
+ if (!pde->proc_ops->proc_lseek)
+ file->f_mode &= ~FMODE_LSEEK;
open = pde->proc_ops->proc_open;
- if (open) {
- if (!pde->proc_ops->proc_lseek)
- file->f_mode &= ~FMODE_LSEEK;
+ if (open)
rv = open(inode, file);
- }
return rv;
}
_
Patches currently in -mm which might be from wangzijie1@honor.com are
proc-avoid-use-after-free-in-proc_reg_open.patch
proc-clear-fmode_lseek-flag-correctly-for-permanent-pde.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-06-05 21:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-05 21:45 + proc-clear-fmode_lseek-flag-correctly-for-permanent-pde.patch added to mm-nonmm-unstable branch Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.