security/dirtyc0w_shmem: Fix test with host pagesize != 4k
PATCH 1/1 security/dirtyc0w_shmem: Fix test with host pagesize != 4k
The test can currently fail if the host page size is not 4k, because we forgot to replace a hard-coded 4k by the actual page size. So if we end up having to trigger a UFFDIO_WAKE, that ioctl will fail because it's not aligned to the host page size.
Reported-by Juri Lelli <[email protected]>
Reported-by Bruno Goncalves <[email protected]>
Tested-by Chunyu Hu <[email protected]>
Cc Petr Vorel <[email protected]>
Cc Martin Doucha <[email protected]>
Signed-off-by David Hildenbrand <[email protected]>
--- testcases/kernel/security/dirtyc0w_shmem/dirtyc0w_shmem_child.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/security/dirtyc0w_shmem/dirtyc0w_shmem_child.c +1 -1
@@ -115,7 +115,7 @@ static void *uffd_thread_fn(void *arg)if (ioctl (uffd,UFFDIO_CONTINUE , &uffdio) <0 ) {if (errno ==EEXIST ) { uffdio_wake.start = (unsigned long ) map; - uffdio_wake.len =4096 ; + uffdio_wake.len = page_size;SAFE_IOCTL (uffd,UFFDIO_WAKE , &uffdio_wake); } }
Signature · 5 lines
2.39.2 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi!
Applied, thanks.
Signature · 5 lines
Cyril Hrubis [email protected] -- Mailing list info: https://lists.linux.it/listinfo/ltp