File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
tools/testing/selftests/bpf/progs Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 2
2
/* Converted from tools/testing/selftests/bpf/verifier/bounds.c */
3
3
4
4
#include <linux/bpf.h>
5
+ #include <../../../include/linux/filter.h>
5
6
#include <bpf/bpf_helpers.h>
6
7
#include "bpf_misc.h"
7
8
@@ -1532,4 +1533,21 @@ __naked void sub32_partial_overflow(void)
1532
1533
: __clobber_all );
1533
1534
}
1534
1535
1536
+ SEC ("socket" )
1537
+ __description ("dead branch on jset, does not result in invariants violation error" )
1538
+ __success __log_level (2 )
1539
+ __retval (0 ) __flag (BPF_F_TEST_REG_INVARIANTS )
1540
+ __naked void jset_range_analysis (void )
1541
+ {
1542
+ asm volatile (" \
1543
+ call %[bpf_get_netns_cookie]; \
1544
+ if r0 == 0 goto l0_%=; \
1545
+ if r0 & 0xffffffff goto +0; \
1546
+ l0_%=: r0 = 0; \
1547
+ exit; \
1548
+ " :
1549
+ : __imm (bpf_get_netns_cookie )
1550
+ : __clobber_all );
1551
+ }
1552
+
1535
1553
char _license [] SEC ("license" ) = "GPL" ;
You can’t perform that action at this time.
0 commit comments