Skip to content

Commit 74cbb48

Browse files
committed
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()
2 parents 5d6a0f4 + 3f61631 commit 74cbb48

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/proc/inode.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,9 @@ static int proc_reg_open(struct inode *inode, struct file *file)
494494
typeof_member(struct proc_ops, proc_release) release;
495495
struct pde_opener *pdeo;
496496

497+
if (!pde->proc_ops->proc_lseek)
498+
file->f_mode &= ~FMODE_LSEEK;
499+
497500
if (pde_is_permanent(pde)) {
498501
open = pde->proc_ops->proc_open;
499502
if (open)

0 commit comments

Comments
 (0)