summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2022-08-14 22:03:53 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2022-08-14 22:03:53 +0200
commit74cbb480d0efa61efa09e5ebd081a32e1d355bba (patch)
tree9e32fe16349d823d8b58deea5d614a9675821c57
parentMerge tag 'for-linus-6.0-rc1b-tag' of git://git.kernel.org/pub/scm/linux/kern... (diff)
parenttake care to handle NULL ->proc_lseek() (diff)
downloadlinux-74cbb480d0efa61efa09e5ebd081a32e1d355bba.tar.xz
linux-74cbb480d0efa61efa09e5ebd081a32e1d355bba.zip
Merge tag 'pull-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs lseek fix from Al Viro: "Fix proc_reg_llseek() breakage. Always had been possible if somebody left NULL ->proc_lseek, became a practical issue now" * tag 'pull-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: take care to handle NULL ->proc_lseek()
-rw-r--r--fs/proc/inode.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index f130499ad843..f495fdb39151 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -494,6 +494,9 @@ static int proc_reg_open(struct inode *inode, struct file *file)
typeof_member(struct proc_ops, proc_release) release;
struct pde_opener *pdeo;
+ if (!pde->proc_ops->proc_lseek)
+ file->f_mode &= ~FMODE_LSEEK;
+
if (pde_is_permanent(pde)) {
open = pde->proc_ops->proc_open;
if (open)