Commit 5f53766
committed
cachestat: fix page cache statistics permission checking
When the 'cachestat()' system call was added in commit cf264e1
("cachestat: implement cachestat syscall"), it was meant to be a much
more convenient (and performant) version of mincore() that didn't need
mapping things into the user virtual address space in order to work.
But it ended up missing the "check for writability or ownership" fix for
mincore(), done in commit 134fca9 ("mm/mincore.c: make mincore()
more conservative").
This just adds equivalent logic to 'cachestat()', modified for the file
context (rather than vma).
Reported-by: Sudheendra Raghav Neela <sneela@tugraz.at>
Fixes: cf264e1 ("cachestat: implement cachestat syscall")
Tested-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Nhat Pham <nphamcs@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>1 parent c4b9570 commit 5f53766
1 file changed
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4375 | 4375 | | |
4376 | 4376 | | |
4377 | 4377 | | |
| 4378 | + | |
| 4379 | + | |
| 4380 | + | |
| 4381 | + | |
| 4382 | + | |
| 4383 | + | |
| 4384 | + | |
| 4385 | + | |
| 4386 | + | |
| 4387 | + | |
| 4388 | + | |
| 4389 | + | |
| 4390 | + | |
| 4391 | + | |
4378 | 4392 | | |
4379 | 4393 | | |
4380 | 4394 | | |
| |||
4430 | 4444 | | |
4431 | 4445 | | |
4432 | 4446 | | |
| 4447 | + | |
| 4448 | + | |
| 4449 | + | |
4433 | 4450 | | |
4434 | 4451 | | |
4435 | 4452 | | |
| |||
0 commit comments