summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-04-03 14:16:25 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-04-03 14:16:25 +0200
commitcb2e3d461b26f07540e0b898e0125137def2b015 (patch)
treea7d3c7f79bd26b15806565405522c7c7c0da44db /lib
parentd30eed1cd2b17f6140ec443f22a8e32f99cd99c1 (diff)
parenta71c9a1c779f2499fb2afc0553e543f18aff6edf (diff)
downloadlinux-cb2e3d461b26f07540e0b898e0125137def2b015.tar.gz
linux-cb2e3d461b26f07540e0b898e0125137def2b015.tar.bz2
linux-cb2e3d461b26f07540e0b898e0125137def2b015.zip
Merge 4.11-rc5 into usb-next
We want the usb fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/syscall.c1
-rw-r--r--lib/test_kasan.c10
2 files changed, 11 insertions, 0 deletions
diff --git a/lib/syscall.c b/lib/syscall.c
index 17d5ff5fa6a3..2c6cd1b5c3ea 100644
--- a/lib/syscall.c
+++ b/lib/syscall.c
@@ -12,6 +12,7 @@ static int collect_syscall(struct task_struct *target, long *callno,
if (!try_get_task_stack(target)) {
/* Task has no stack, so the task isn't in a syscall. */
+ *sp = *pc = 0;
*callno = -1;
return 0;
}
diff --git a/lib/test_kasan.c b/lib/test_kasan.c
index 0b1d3140fbb8..a25c9763fce1 100644
--- a/lib/test_kasan.c
+++ b/lib/test_kasan.c
@@ -20,6 +20,7 @@
#include <linux/string.h>
#include <linux/uaccess.h>
#include <linux/module.h>
+#include <linux/kasan.h>
/*
* Note: test functions are marked noinline so that their names appear in
@@ -474,6 +475,12 @@ static noinline void __init use_after_scope_test(void)
static int __init kmalloc_tests_init(void)
{
+ /*
+ * Temporarily enable multi-shot mode. Otherwise, we'd only get a
+ * report for the first case.
+ */
+ bool multishot = kasan_save_enable_multi_shot();
+
kmalloc_oob_right();
kmalloc_oob_left();
kmalloc_node_oob_right();
@@ -499,6 +506,9 @@ static int __init kmalloc_tests_init(void)
ksize_unpoisons_memory();
copy_user_test();
use_after_scope_test();
+
+ kasan_restore_multi_shot(multishot);
+
return -EAGAIN;
}