From: David Hildenbrand <david@redhat.com>
To: ltp@lists.linux.it
Cc: David Hildenbrand <david@redhat.com>
Subject: [LTP] [PATCH v1 2/3] security/dirtyc0w_shmem: Fix compile-time absence of UFFD_FEATURE_MINOR_SHMEM
Date: Mon, 28 Nov 2022 12:18:32 +0100 [thread overview]
Message-ID: <20221128111833.98937-3-david@redhat.com> (raw)
In-Reply-To: <20221128111833.98937-1-david@redhat.com>
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 --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 */
--
2.38.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2022-11-28 11:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-28 11:18 [LTP] [PATCH v1 0/3] userfaultfd: Fix and remove compile-time TCONF handling David Hildenbrand
2022-11-28 11:18 ` [LTP] [PATCH v1 1/3] lapi/userfaultfd.h: Preparation for removing compile-time TCONF handling from userfaultfd testcases David Hildenbrand
2022-11-28 11:18 ` David Hildenbrand [this message]
2022-11-28 11:18 ` [LTP] [PATCH v1 3/3] syscalls/userfaultfd01: Remove compile-time TCONF handling David Hildenbrand
2022-11-28 11:57 ` [LTP] [PATCH v1 0/3] userfaultfd: Fix and remove " Petr Vorel
2022-11-28 12:29 ` Martin Doucha
2022-11-28 15:44 ` David Hildenbrand
2022-11-28 18:42 ` Petr Vorel
2022-11-29 8:29 ` Petr Vorel
2022-11-29 8:46 ` David Hildenbrand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221128111833.98937-3-david@redhat.com \
--to=david@redhat.com \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox