Skip to content

Commit 9ad9148

Browse files
committed
dirtyc0w_shmem: Ignore cve-2022-2590_64bit CVE for Kernel versions below 5.16+
CVE 2022-2590_64bit is applicable only for kernel versions 5.16 onwards. Add kernel version check to skip/Ignore the test case. Test Module: vts_ltp_test_arm_64 Test Case: cve.cve-2022-2590_64bit#cve.cve-2022-2590_64bit GBUG: 418679607 Signed-off-by: Madhu Ananthula <[email protected]>
1 parent 3c82316 commit 9ad9148

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

testcases/kernel/security/dirtyc0w_shmem/dirtyc0w_shmem.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <stdbool.h>
2020
#include <pwd.h>
2121

22+
#include "tst_kvercmp.h"
2223
#include "tst_test.h"
2324

2425
#define TMP_DIR "tmp_dirtyc0w_shmem"
@@ -41,6 +42,9 @@ static void sighandler(int sig)
4142

4243
static void setup(void)
4344
{
45+
if (tst_kvercmp(5, 16, 0) < 0) {
46+
tst_brk(TCONF, "Test requires kernel 5.16.0 or newer for CVE-2022-2590 fix");
47+
}
4448
struct passwd *pw;
4549

4650
umask(0);
@@ -99,7 +103,9 @@ static void dirtyc0w_shmem_test(void)
99103

100104
static void cleanup(void)
101105
{
102-
SAFE_UMOUNT(TMP_DIR);
106+
if (tst_kvercmp(5, 16, 0) >= 0) {
107+
SAFE_UMOUNT(TMP_DIR);
108+
}
103109
}
104110

105111
static struct tst_test test = {

0 commit comments

Comments
 (0)