@@ -1887,7 +1887,7 @@ fn test_err_dynamic_stack_out_of_bound() {
18871887 AccessType :: Store ,
18881888 ebpf:: MM_STACK_START - 1 ,
18891889 1 ,
1890- "program "
1890+ "rodata "
18911891 ) ) ,
18921892 ) ;
18931893
@@ -1931,7 +1931,7 @@ fn test_err_dynamic_stack_ptr_overflow() {
19311931 AccessType :: Store ,
19321932 u64 :: MAX - 63 ,
19331933 1 ,
1934- "unknown "
1934+ "accounts "
19351935 ) ) ,
19361936 ) ;
19371937}
@@ -2096,7 +2096,12 @@ fn test_err_mem_access_out_of_bound() {
20962096 prog[ 16 ] = ebpf:: ST_1B_IMM ;
20972097 prog[ 24 ] = ebpf:: RETURN ;
20982098 let loader = Arc :: new ( BuiltinProgram :: new_mock ( ) ) ;
2099- for address in [ 0x2u64 , 0x8002u64 , 0x80000002u64 , 0x8000000000000002u64 ] {
2099+ for ( address, area) in [
2100+ ( 0x2u64 , "program" ) ,
2101+ ( 0x8002u64 , "program" ) ,
2102+ ( 0x80000002u64 , "program" ) ,
2103+ ( 0x8000000000000002u64 , "accounts" ) ,
2104+ ] {
21002105 LittleEndian :: write_u32 ( & mut prog[ 4 ..] , address as u32 ) ;
21012106 LittleEndian :: write_u32 ( & mut prog[ 12 ..] , ( address >> 32 ) as u32 ) ;
21022107 #[ allow( unused_mut) ]
@@ -2115,7 +2120,7 @@ fn test_err_mem_access_out_of_bound() {
21152120 AccessType :: Store ,
21162121 address,
21172122 1 ,
2118- "unknown"
2123+ area
21192124 ) ) ,
21202125 ) ;
21212126 }
@@ -2440,16 +2445,18 @@ fn test_call_save() {
24402445fn test_err_syscall_string ( ) {
24412446 test_syscall_asm ! (
24422447 "
2443- mov64 r1, 0x0
2448+ mov64 r1, 0x3
2449+ lsh64 r1, 32
2450+ add64 r1, 0xffff
24442451 syscall bpf_syscall_string
24452452 mov64 r0, 0x0
24462453 exit" ,
24472454 [ 72 , 101 , 108 , 108 , 111 ] ,
24482455 (
24492456 "bpf_syscall_string" => syscalls:: SyscallString :: vm,
24502457 ) ,
2451- TestContextObject :: new( 2 ) ,
2452- ProgramResult :: Err ( EbpfError :: SyscallError ( Box :: new( EbpfError :: AccessViolation ( AccessType :: Load , 0 , 0 , "unknown " ) ) ) ) ,
2458+ TestContextObject :: new( 4 ) ,
2459+ ProgramResult :: Err ( EbpfError :: SyscallError ( Box :: new( EbpfError :: AccessViolation ( AccessType :: Load , 0x30000FFFF , 0 , "heap " ) ) ) ) ,
24532460 ) ;
24542461}
24552462
0 commit comments