From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,rick.p.edgecombe@intel.com,kirill.shutemov@linux.intel.com,ast@kernel.org,adobriyan@gmail.com,wangzijie1@honor.com,akpm@linux-foundation.org
Subject: + proc-clear-fmode_lseek-flag-correctly-for-permanent-pde.patch added to mm-nonmm-unstable branch
Date: Thu, 05 Jun 2025 14:45:04 -0700 [thread overview]
Message-ID: <20250605214505.1DBA7C4CEE7@smtp.kernel.org> (raw)
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
reply other threads:[~2025-06-05 21:45 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250605214505.1DBA7C4CEE7@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=adobriyan@gmail.com \
--cc=ast@kernel.org \
--cc=kirill.shutemov@linux.intel.com \
--cc=mm-commits@vger.kernel.org \
--cc=rick.p.edgecombe@intel.com \
--cc=wangzijie1@honor.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.