diff mbox series

[v1,2/3] security/dirtyc0w_shmem: Fix compile-time absence of UFFD_FEATURE_MINOR_SHMEM

Message ID 20221128111833.98937-3-david@redhat.com
State Accepted
Headers show
Series userfaultfd: Fix and remove compile-time TCONF handling | expand

Commit Message

David Hildenbrand Nov. 28, 2022, 11:18 a.m. UTC
Without UFFD_FEATURE_MINOR_SHMEM, we'd currently let the parent run into
a timeout because we don't make the checkpoint happy, failing the
testcase instead of skipping it as TCONF.

Let's make compilation always work by including include/lapi/userfaultfd.h.

Reported-by: Martin Doucha <mdoucha@suse.cz>
Fixes: a46f8956f ("security/dirtyc0w_shmem: Add new test for CVE-2022-2590")
Signed-off-by: David Hildenbrand <david@redhat.com>
---
 .../security/dirtyc0w_shmem/dirtyc0w_shmem_child.c   | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
diff mbox series

Patch

diff --git a/testcases/kernel/security/dirtyc0w_shmem/dirtyc0w_shmem_child.c b/testcases/kernel/security/dirtyc0w_shmem/dirtyc0w_shmem_child.c
index 61799a504..9c2b03994 100644
--- a/testcases/kernel/security/dirtyc0w_shmem/dirtyc0w_shmem_child.c
+++ b/testcases/kernel/security/dirtyc0w_shmem/dirtyc0w_shmem_child.c
@@ -20,17 +20,11 @@ 
 #include <sys/syscall.h>
 #include <sys/ioctl.h>
 
-#ifdef HAVE_LINUX_USERFAULTFD_H
-#include <linux/userfaultfd.h>
-#endif
-
-#ifdef UFFD_FEATURE_MINOR_SHMEM
-
 #define TST_NO_DEFAULT_MAIN
 #include "tst_test.h"
 #include "tst_safe_macros.h"
 #include "tst_safe_pthread.h"
-#include "lapi/syscalls.h"
+#include "lapi/userfaultfd.h"
 
 #define TMP_DIR "tmp_dirtyc0w_shmem"
 #define TEST_FILE TMP_DIR"/testfile"
@@ -238,7 +232,3 @@  int main(void)
 
 	return 0;
 }
-#else /* UFFD_FEATURE_MINOR_SHMEM */
-#include "tst_test.h"
-TST_TEST_TCONF("System does not have userfaultfd minor fault support for shmem");
-#endif /* UFFD_FEATURE_MINOR_SHMEM */