+19
−0
Loading
stable inclusion from stable-v6.6.75 commit 7d6405c13b0d8a8367cd8df63f118b619a3f0dd2 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IBSPQB Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=7d6405c13b0d8a8367cd8df63f118b619a3f0dd2 -------------------------------- commit 5f537664e705b0bf8b7e329861f20128534f6a83 upstream. When the 'cachestat()' system call was added in commit cf264e13 ("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 134fca90 ("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: cf264e13 ("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:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Wen Zhiwei <wenzhiwei@kylinos.cn>