File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
tools/testing/selftests/bpf/progs Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -624,7 +624,6 @@ __retval(0)
624
624
__naked void cmp_map_pointer_with_zero (void )
625
625
{
626
626
asm volatile (" \
627
- r1 = 0; \
628
627
r1 = %[map_hash_8b] ll; \
629
628
if r1 == 0 goto l0_%=; \
630
629
l0_%=: r0 = 0; \
@@ -634,6 +633,22 @@ l0_%=: r0 = 0; \
634
633
: __clobber_all );
635
634
}
636
635
636
+ SEC ("socket" )
637
+ __description ("unpriv: cmp map pointer with const" )
638
+ __success __failure_unpriv __msg_unpriv ("R1 pointer comparison prohibited" )
639
+ __retval (0 )
640
+ __naked void cmp_map_pointer_with_const (void )
641
+ {
642
+ asm volatile (" \
643
+ r1 = %[map_hash_8b] ll; \
644
+ if r1 == 0x0000beef goto l0_%=; \
645
+ l0_%=: r0 = 0; \
646
+ exit; \
647
+ " :
648
+ : __imm_addr (map_hash_8b )
649
+ : __clobber_all );
650
+ }
651
+
637
652
SEC ("socket" )
638
653
__description ("unpriv: write into frame pointer" )
639
654
__failure __msg ("frame pointer is read only" )
You can’t perform that action at this time.
0 commit comments