RFC powerpc/book3s64/radix: Add support for memfd_secret
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest4 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | powerpc/64s: Add linear_map_use_base_page command line optionDocumentation/ arch/ arch/ +1 more | +35 | 0 replies | |
| 2/4 | powerpc/64s/radix: Implement ARCH_HAS_SET_DIRECT_MAParch/ arch/ arch/ | +106 | 0 replies | |
| 3/4 | powerpc: Wire memfd_secret syscallarch/ | +1 | 0 replies | |
| 4/4 | selftests: mm: Enable memfd_secret for powerpctools/ | +1 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC 0/4] powerpc/book3s64/radix: Add support for memfd_secret
memfd_secret() gives a process a place to keep a secret that the kernel itself should not be able to read. The page is still mapped in that process but it is removed from the kernel linear map, so a kernel read or a speculative walk of that map cannot see it.
On PowerPC book3s64, if the same address is translated by two pages of different sizes at once, the TLB access can raise a machine check for a parity error or a multi-hit. So that means breaking a 2M or a 1G mapping of kernel linear map is not possible.
The way around that is to build the linear map out of base pages in the first place and only then allow a single page to be dropped and put back. So, that is what this series does by adding a linear_map_use_base_page cmdline option.
This is based out of mm-new branch for now (since few dependent function definitions have been modified there). Once v7.4 is merge window closes - I will rebase this to latest upstream powerpc tree.
Ritesh Harjani (IBM) (4):
powerpc/64s: Add linear_map_use_base_page command line option powerpc/64s/radix: Implement ARCH_HAS_SET_DIRECT_MAP
powerpc: Wire memfd_secret syscall
selftests: mm: Enable memfd_secret for powerpc
.../admin-guide/kernel-parameters.txt | 10 ++ arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/book3s/64/mmu.h | 2 + arch/powerpc/include/asm/set_memory.h | 9 ++ arch/powerpc/kernel/syscalls/syscall.tbl | 2 +- arch/powerpc/mm/book3s64/pgtable.c | 22 +++++ arch/powerpc/mm/book3s64/radix_pgtable.c | 2 +- arch/powerpc/mm/pageattr.c | 96 +++++++++++++++++++ tools/testing/selftests/mm/Makefile | 2 +- 9 files changed, 143 insertions(+), 3 deletions(-)
--
2.39.5