aboutsummaryrefslogtreecommitdiff
path: root/lib/test_fortify/write_overflow-strncpy-src.c
diff options
context:
space:
mode:
authorMichael Roth <[email protected]>2024-03-29 16:24:42 -0500
committerPaolo Bonzini <[email protected]>2024-05-10 13:11:45 -0400
commitc72ceafbd12cf95e088681ae5e535ef1a78bf0ed (patch)
tree1a877f9fb40103dac7fd20abf4fda3f3661ed3ae /lib/test_fortify/write_overflow-strncpy-src.c
parent2b1f435505aee67094a9427ebc27ac04842d9f95 (diff)
mm: Introduce AS_INACCESSIBLE for encrypted/confidential memory
filemap users like guest_memfd may use page cache pages to allocate/manage memory that is only intended to be accessed by guests via hardware protections like encryption. Writes to memory of this sort in common paths like truncation may cause unexpected behavior such as writing garbage instead of zeros when attempting to zero pages, or worse, triggering hardware protections that are considered fatal as far as the kernel is concerned. Introduce a new address_space flag, AS_INACCESSIBLE, and use this initially to prevent zero'ing of pages during truncation, with the understanding that it is up to the owner of the mapping to handle this specially if needed. This is admittedly a rather blunt solution, but it seems like there are no other places that should take into account the flag to keep its promise. Link: https://lore.kernel.org/lkml/[email protected]/ Cc: Matthew Wilcox <[email protected]> Suggested-by: Sean Christopherson <[email protected]> Signed-off-by: Michael Roth <[email protected]> Message-ID: <[email protected]> Acked-by: Vlastimil Babka <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strncpy-src.c')
0 files changed, 0 insertions, 0 deletions