Commit 86ca59c
Rafael Aquini
cachestat: fix page cache statistics permission checking
JIRA: https://issues.redhat.com/browse/RHEL-84184
JIRA: https://issues.redhat.com/browse/RHEL-78989
CVE: CVE-2025-21691
Conflicts:
* minor differences on the 2nd hunk due to RHEL-9 missing upstream
commit 65c8941 ("convert cachestat(2)") that transposes fdput()
with copy_to_user(), as well as missing commit 1da91ea ("introduce
fd_file(), convert all accessors to it."). These changes, however are
irrelevant for this backport work.
This patch is a backport of the following upstream commit:
commit 5f53766
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date: Tue Jan 21 09:27:22 2025 -0800
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>
Signed-off-by: Rafael Aquini <raquini@redhat.com>1 parent e4205cc commit 86ca59c
1 file changed
+19
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4212 | 4212 | | |
4213 | 4213 | | |
4214 | 4214 | | |
| 4215 | + | |
| 4216 | + | |
| 4217 | + | |
| 4218 | + | |
| 4219 | + | |
| 4220 | + | |
| 4221 | + | |
| 4222 | + | |
| 4223 | + | |
| 4224 | + | |
| 4225 | + | |
| 4226 | + | |
| 4227 | + | |
| 4228 | + | |
4215 | 4229 | | |
4216 | 4230 | | |
4217 | 4231 | | |
| |||
4271 | 4285 | | |
4272 | 4286 | | |
4273 | 4287 | | |
| 4288 | + | |
| 4289 | + | |
| 4290 | + | |
| 4291 | + | |
| 4292 | + | |
4274 | 4293 | | |
4275 | 4294 | | |
4276 | 4295 | | |
| |||
0 commit comments