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()
Unified · Split
| @@ -494,6 +494,9 @@ static int proc_reg_open(struct inode *inode, struct file *file) · 493 unmodified lines | |||
| 494 | typeof_member(struct proc_ops, proc_release) release; | 494 | typeof_member(struct proc_ops, proc_release) release; |
| 495 | struct pde_opener *pdeo; | 495 | struct pde_opener *pdeo; |
| 496 | 496 | ||
| 497 | if (!pde->proc_ops->proc_lseek) | ||
| 498 | file->f_mode &= ~FMODE_LSEEK; | ||
| 499 | |||
| 497 | if (pde_is_permanent(pde)) { | 500 | if (pde_is_permanent(pde)) { |
| 498 | open = pde->proc_ops->proc_open; | 501 | open = pde->proc_ops->proc_open; |
| 499 | if (open) | 502 | if (open) |