commit | f580a54bbd522f2518fd642f7d4d73ad728e5d58 | [log] [tgz] |
---|---|---|
author | Jiri Kosina <[email protected]> | Tue May 14 15:41:38 2019 -0700 |
committer | Greg Kroah-Hartman <[email protected]> | Wed May 22 07:37:40 2019 +0200 |
tree | f8b1622a8ba5cd5b7b0dd8f86dd38169745c85a8 | |
parent | 681f3695d514e5154997c9c3d04f4ff7128a4382 [diff] |
mm/mincore.c: make mincore() more conservative commit 134fca9063ad4851de767d1768180e5dede9a881 upstream. The semantics of what mincore() considers to be resident is not completely clear, but Linux has always (since 2.3.52, which is when mincore() was initially done) treated it as "page is available in page cache". That's potentially a problem, as that [in]directly exposes meta-information about pagecache / memory mapping state even about memory not strictly belonging to the process executing the syscall, opening possibilities for sidechannel attacks. Change the semantics of mincore() so that it only reveals pagecache information for non-anonymous mappings that belog to files that the calling process could (if it tried to) successfully open for writing; otherwise we'd be including shared non-exclusive mappings, which - is the sidechannel - is not the usecase for mincore(), as that's primarily used for data, not (shared) text [[email protected]: v2] Link: http://lkml.kernel.org/r/[email protected] [[email protected]: restructure can_do_mincore() conditions] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Jiri Kosina <[email protected]> Signed-off-by: Vlastimil Babka <[email protected]> Acked-by: Josh Snyder <[email protected]> Acked-by: Michal Hocko <[email protected]> Originally-by: Linus Torvalds <[email protected]> Originally-by: Dominique Martinet <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Dave Chinner <[email protected]> Cc: Kevin Easton <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Cyril Hrubis <[email protected]> Cc: Tejun Heo <[email protected]> Cc: Kirill A. Shutemov <[email protected]> Cc: Daniel Gruss <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>