We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8704cd2 commit b982da9Copy full SHA for b982da9
kernel/bpf/helpers.c
@@ -22,6 +22,7 @@
22
#include <linux/security.h>
23
#include <linux/btf_ids.h>
24
#include <linux/bpf_mem_alloc.h>
25
+#include <linux/kasan.h>
26
27
#include "../../lib/kstrtox.h"
28
@@ -2483,6 +2484,11 @@ __bpf_kfunc void bpf_throw(u64 cookie)
2483
2484
WARN_ON_ONCE(!ctx.aux->exception_boundary);
2485
WARN_ON_ONCE(!ctx.bp);
2486
WARN_ON_ONCE(!ctx.cnt);
2487
+ /* Prevent KASAN false positives for CONFIG_KASAN_STACK by unpoisoning
2488
+ * deeper stack depths than ctx.sp as we do not return from bpf_throw,
2489
+ * which skips compiler generated instrumentation to do the same.
2490
+ */
2491
+ kasan_unpoison_task_stack_below((void *)ctx.sp);
2492
ctx.aux->bpf_exception_cb(cookie, ctx.sp, ctx.bp);
2493
}
2494
0 commit comments