Commit 28bba2c
fsnotify: pass correct offset to fsnotify_mmap_perm()
fsnotify_mmap_perm() requires a byte offset for the file about to be
mmap'ed. But it is called from vm_mmap_pgoff(), which has a page offset.
Previously the conversion was done incorrectly so let's fix it, being
careful not to overflow on 32-bit platforms.
Discovered during code review.
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 066e053 ("fsnotify: add pre-content hooks on mmap()")
Signed-off-by: Ryan Roberts <[email protected]>
Reviewed-by: Kiryl Shutsemau <[email protected]>
Cc: Amir Goldstein <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Liam Howlett <[email protected]>
Cc: Lorenzo Stoakes <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Mike Rapoport <[email protected]>
Cc: Suren Baghdasaryan <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>1 parent f04aad3 commit 28bba2c
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
566 | 566 | | |
567 | 567 | | |
568 | 568 | | |
| 569 | + | |
569 | 570 | | |
570 | 571 | | |
571 | 572 | | |
572 | 573 | | |
573 | 574 | | |
574 | 575 | | |
575 | 576 | | |
576 | | - | |
| 577 | + | |
577 | 578 | | |
578 | 579 | | |
579 | 580 | | |
| |||
0 commit comments