Skip to contentSkip to conversation

cve/meltdown.c: abort the test if kallsyms was not enabled

PATCH New Po-Hsu Lin 2 participants 2 messages Jun 28, 2019 – Jul 1, 2019

lore
Share & tools
lore

Po-Hsu Lin

author
#0 lore raw

PATCH 1/1 cve/meltdown.c: abort the test if kallsyms was not enabled

The cve-2017-5754 meltdown test does not work with a kernel that does not have CONFIG_KALLSYMS enabled (e.g. Ubuntu KVM kernel).

Add and extra check for /proc/kallsyms to determine if we can run it.

---
 testcases/cve/meltdown.c | 3 +++
 1 file changed, 3 insertions(+)
testcases/cve/meltdown.c +3 -0
index 1a3303ec0..f78c38b80 100644
@@ -269,6 +269,9 @@ find_kernel_symbol(const char *name)
 	struct utsname utsname;
 	unsigned long addr;
 
+	if (access("/proc/kallsyms", F_OK) == -1)
+		tst_brk(TCONF, "/proc/kallsyms not enabled");
+
 	addr = find_symbol_in_file("/proc/kallsyms", name);
 	if (addr)
 		return addr;
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 cve/meltdown.c: abort the test if kallsyms was not enabled

----- Original Message -----

Quoted 6 lines

The cve-2017-5754 meltdown test does not work with a kernel that does not have CONFIG_KALLSYMS enabled (e.g. Ubuntu KVM kernel).

Add and extra check for /proc/kallsyms to determine if we can run it.

Pushed.

Thanks,
Jan