diff options
author | Muhammad Usama Anjum <[email protected]> | 2023-12-14 15:19:30 +0500 |
---|---|---|
committer | Andrew Morton <[email protected]> | 2023-12-20 13:46:19 -0800 |
commit | 0aac13add26d546ac74c89d2883b3a5f0fbea039 (patch) | |
tree | 2de5bba3ac65e43188cc45fced5b6196afc2eca2 /scripts/gdb/linux/interrupts.py | |
parent | fc346d0a70a13d52fe1c4bc49516d83a42cd7c4c (diff) |
selftests: secretmem: floor the memory size to the multiple of page_size
The "locked-in-memory size" limit per process can be non-multiple of
page_size. The mmap() fails if we try to allocate locked-in-memory with
same size as the allowed limit if it isn't multiple of the page_size
because mmap() rounds off the memory size to be allocated to next multiple
of page_size.
Fix this by flooring the length to be allocated with mmap() to the
previous multiple of the page_size.
This was getting triggered on KernelCI regularly because of different
ulimit settings which wasn't multiple of the page_size. Find logs
here: https://linux.kernelci.org/test/plan/id/657654bd8e81e654fae13532/
The bug in was present from the time test was first added.
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 76fe17ef588a ("secretmem: test: add basic selftest for memfd_secret(2)")
Signed-off-by: Muhammad Usama Anjum <[email protected]>
Reported-by: "kernelci.org bot" <[email protected]>
Closes: https://linux.kernelci.org/test/plan/id/657654bd8e81e654fae13532/
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Mike Rapoport (IBM) <[email protected]>
Cc: Shuah Khan <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'scripts/gdb/linux/interrupts.py')
0 files changed, 0 insertions, 0 deletions