lkml.org 
[lkml]   [2024]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: [syzbot] [bpf?] UBSAN: array-index-out-of-bounds in check_stack_range_initialized
Date
please test oob in check_stack_range_initialized

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf.git master


diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 1dd3b99d1bb9..ed0878f4373a 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -7177,6 +7177,11 @@ static int check_stack_range_initialized(
return 0;
}

+ if (INT_MIN - access_size > max_off) {
+ verbose(env, "invalid access size\n");
+ return -EACCES;
+ }
+
for (i = min_off; i < max_off + access_size; i++) {
u8 *stype;


\
 
 \ /
  Last update: 2024-05-27 15:55    [W:0.142 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site