@@ -1823,6 +1823,7 @@ static struct bpf_test tests[] = {
1823
1823
.errstr = "invalid bpf_context access" ,
1824
1824
.result = REJECT ,
1825
1825
.prog_type = BPF_PROG_TYPE_SK_MSG ,
1826
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
1826
1827
},
1827
1828
{
1828
1829
"direct packet read for SK_MSG" ,
@@ -2215,6 +2216,8 @@ static struct bpf_test tests[] = {
2215
2216
},
2216
2217
.errstr = "invalid bpf_context access" ,
2217
2218
.result = REJECT ,
2219
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
2220
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
2218
2221
},
2219
2222
{
2220
2223
"check cb access: half, wrong type" ,
@@ -3281,6 +3284,7 @@ static struct bpf_test tests[] = {
3281
3284
.result = REJECT ,
3282
3285
.errstr = "R0 invalid mem access 'inv'" ,
3283
3286
.prog_type = BPF_PROG_TYPE_SCHED_CLS ,
3287
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
3284
3288
},
3285
3289
{
3286
3290
"raw_stack: skb_load_bytes, spilled regs corruption 2" ,
@@ -3311,6 +3315,7 @@ static struct bpf_test tests[] = {
3311
3315
.result = REJECT ,
3312
3316
.errstr = "R3 invalid mem access 'inv'" ,
3313
3317
.prog_type = BPF_PROG_TYPE_SCHED_CLS ,
3318
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
3314
3319
},
3315
3320
{
3316
3321
"raw_stack: skb_load_bytes, spilled regs + data" ,
@@ -3810,6 +3815,7 @@ static struct bpf_test tests[] = {
3810
3815
.errstr = "R2 invalid mem access 'inv'" ,
3811
3816
.result = REJECT ,
3812
3817
.prog_type = BPF_PROG_TYPE_SCHED_CLS ,
3818
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
3813
3819
},
3814
3820
{
3815
3821
"direct packet access: test16 (arith on data_end)" ,
@@ -3993,6 +3999,7 @@ static struct bpf_test tests[] = {
3993
3999
.prog_type = BPF_PROG_TYPE_SCHED_CLS ,
3994
4000
.result = REJECT ,
3995
4001
.errstr = "invalid access to packet, off=0 size=8, R5(id=1,off=0,r=0)" ,
4002
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
3996
4003
},
3997
4004
{
3998
4005
"direct packet access: test24 (x += pkt_ptr, 5)" ,
@@ -5149,6 +5156,7 @@ static struct bpf_test tests[] = {
5149
5156
.result = REJECT ,
5150
5157
.errstr = "invalid access to map value, value_size=64 off=-2 size=4" ,
5151
5158
.prog_type = BPF_PROG_TYPE_CGROUP_SKB ,
5159
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
5152
5160
},
5153
5161
{
5154
5162
"invalid cgroup storage access 5" ,
@@ -5265,6 +5273,7 @@ static struct bpf_test tests[] = {
5265
5273
.result = REJECT ,
5266
5274
.errstr = "invalid access to map value, value_size=64 off=-2 size=4" ,
5267
5275
.prog_type = BPF_PROG_TYPE_CGROUP_SKB ,
5276
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
5268
5277
},
5269
5278
{
5270
5279
"invalid per-cpu cgroup storage access 5" ,
@@ -7206,6 +7215,7 @@ static struct bpf_test tests[] = {
7206
7215
.errstr = "invalid mem access 'inv'" ,
7207
7216
.result = REJECT ,
7208
7217
.result_unpriv = REJECT ,
7218
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
7209
7219
},
7210
7220
{
7211
7221
"map element value illegal alu op, 5" ,
@@ -7228,6 +7238,7 @@ static struct bpf_test tests[] = {
7228
7238
.fixup_map_hash_48b = { 3 },
7229
7239
.errstr = "R0 invalid mem access 'inv'" ,
7230
7240
.result = REJECT ,
7241
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
7231
7242
},
7232
7243
{
7233
7244
"map element value is preserved across register spilling" ,
@@ -9720,6 +9731,7 @@ static struct bpf_test tests[] = {
9720
9731
.errstr = "R1 offset is outside of the packet" ,
9721
9732
.result = REJECT ,
9722
9733
.prog_type = BPF_PROG_TYPE_XDP ,
9734
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
9723
9735
},
9724
9736
{
9725
9737
"XDP pkt read, pkt_end > pkt_data', good access" ,
@@ -9758,6 +9770,7 @@ static struct bpf_test tests[] = {
9758
9770
.errstr = "R1 offset is outside of the packet" ,
9759
9771
.result = REJECT ,
9760
9772
.prog_type = BPF_PROG_TYPE_XDP ,
9773
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
9761
9774
},
9762
9775
{
9763
9776
"XDP pkt read, pkt_end > pkt_data', bad access 2" ,
@@ -9776,6 +9789,7 @@ static struct bpf_test tests[] = {
9776
9789
.errstr = "R1 offset is outside of the packet" ,
9777
9790
.result = REJECT ,
9778
9791
.prog_type = BPF_PROG_TYPE_XDP ,
9792
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
9779
9793
},
9780
9794
{
9781
9795
"XDP pkt read, pkt_data' < pkt_end, good access" ,
@@ -9814,6 +9828,7 @@ static struct bpf_test tests[] = {
9814
9828
.errstr = "R1 offset is outside of the packet" ,
9815
9829
.result = REJECT ,
9816
9830
.prog_type = BPF_PROG_TYPE_XDP ,
9831
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
9817
9832
},
9818
9833
{
9819
9834
"XDP pkt read, pkt_data' < pkt_end, bad access 2" ,
@@ -9832,6 +9847,7 @@ static struct bpf_test tests[] = {
9832
9847
.errstr = "R1 offset is outside of the packet" ,
9833
9848
.result = REJECT ,
9834
9849
.prog_type = BPF_PROG_TYPE_XDP ,
9850
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
9835
9851
},
9836
9852
{
9837
9853
"XDP pkt read, pkt_end < pkt_data', good access" ,
@@ -9886,6 +9902,7 @@ static struct bpf_test tests[] = {
9886
9902
.errstr = "R1 offset is outside of the packet" ,
9887
9903
.result = REJECT ,
9888
9904
.prog_type = BPF_PROG_TYPE_XDP ,
9905
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
9889
9906
},
9890
9907
{
9891
9908
"XDP pkt read, pkt_data' >= pkt_end, good access" ,
@@ -9922,6 +9939,7 @@ static struct bpf_test tests[] = {
9922
9939
.errstr = "R1 offset is outside of the packet" ,
9923
9940
.result = REJECT ,
9924
9941
.prog_type = BPF_PROG_TYPE_XDP ,
9942
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
9925
9943
},
9926
9944
{
9927
9945
"XDP pkt read, pkt_data' >= pkt_end, bad access 2" ,
@@ -9997,6 +10015,7 @@ static struct bpf_test tests[] = {
9997
10015
.errstr = "R1 offset is outside of the packet" ,
9998
10016
.result = REJECT ,
9999
10017
.prog_type = BPF_PROG_TYPE_XDP ,
10018
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
10000
10019
},
10001
10020
{
10002
10021
"XDP pkt read, pkt_data' <= pkt_end, good access" ,
@@ -10053,6 +10072,7 @@ static struct bpf_test tests[] = {
10053
10072
.errstr = "R1 offset is outside of the packet" ,
10054
10073
.result = REJECT ,
10055
10074
.prog_type = BPF_PROG_TYPE_XDP ,
10075
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
10056
10076
},
10057
10077
{
10058
10078
"XDP pkt read, pkt_end <= pkt_data', good access" ,
@@ -10089,6 +10109,7 @@ static struct bpf_test tests[] = {
10089
10109
.errstr = "R1 offset is outside of the packet" ,
10090
10110
.result = REJECT ,
10091
10111
.prog_type = BPF_PROG_TYPE_XDP ,
10112
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
10092
10113
},
10093
10114
{
10094
10115
"XDP pkt read, pkt_end <= pkt_data', bad access 2" ,
@@ -10162,6 +10183,7 @@ static struct bpf_test tests[] = {
10162
10183
.errstr = "R1 offset is outside of the packet" ,
10163
10184
.result = REJECT ,
10164
10185
.prog_type = BPF_PROG_TYPE_XDP ,
10186
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
10165
10187
},
10166
10188
{
10167
10189
"XDP pkt read, pkt_data > pkt_meta', good access" ,
@@ -10200,6 +10222,7 @@ static struct bpf_test tests[] = {
10200
10222
.errstr = "R1 offset is outside of the packet" ,
10201
10223
.result = REJECT ,
10202
10224
.prog_type = BPF_PROG_TYPE_XDP ,
10225
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
10203
10226
},
10204
10227
{
10205
10228
"XDP pkt read, pkt_data > pkt_meta', bad access 2" ,
@@ -10218,6 +10241,7 @@ static struct bpf_test tests[] = {
10218
10241
.errstr = "R1 offset is outside of the packet" ,
10219
10242
.result = REJECT ,
10220
10243
.prog_type = BPF_PROG_TYPE_XDP ,
10244
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
10221
10245
},
10222
10246
{
10223
10247
"XDP pkt read, pkt_meta' < pkt_data, good access" ,
@@ -10256,6 +10280,7 @@ static struct bpf_test tests[] = {
10256
10280
.errstr = "R1 offset is outside of the packet" ,
10257
10281
.result = REJECT ,
10258
10282
.prog_type = BPF_PROG_TYPE_XDP ,
10283
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
10259
10284
},
10260
10285
{
10261
10286
"XDP pkt read, pkt_meta' < pkt_data, bad access 2" ,
@@ -10274,6 +10299,7 @@ static struct bpf_test tests[] = {
10274
10299
.errstr = "R1 offset is outside of the packet" ,
10275
10300
.result = REJECT ,
10276
10301
.prog_type = BPF_PROG_TYPE_XDP ,
10302
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
10277
10303
},
10278
10304
{
10279
10305
"XDP pkt read, pkt_data < pkt_meta', good access" ,
@@ -10328,6 +10354,7 @@ static struct bpf_test tests[] = {
10328
10354
.errstr = "R1 offset is outside of the packet" ,
10329
10355
.result = REJECT ,
10330
10356
.prog_type = BPF_PROG_TYPE_XDP ,
10357
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
10331
10358
},
10332
10359
{
10333
10360
"XDP pkt read, pkt_meta' >= pkt_data, good access" ,
@@ -10364,6 +10391,7 @@ static struct bpf_test tests[] = {
10364
10391
.errstr = "R1 offset is outside of the packet" ,
10365
10392
.result = REJECT ,
10366
10393
.prog_type = BPF_PROG_TYPE_XDP ,
10394
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
10367
10395
},
10368
10396
{
10369
10397
"XDP pkt read, pkt_meta' >= pkt_data, bad access 2" ,
@@ -10439,6 +10467,7 @@ static struct bpf_test tests[] = {
10439
10467
.errstr = "R1 offset is outside of the packet" ,
10440
10468
.result = REJECT ,
10441
10469
.prog_type = BPF_PROG_TYPE_XDP ,
10470
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
10442
10471
},
10443
10472
{
10444
10473
"XDP pkt read, pkt_meta' <= pkt_data, good access" ,
@@ -10495,6 +10524,7 @@ static struct bpf_test tests[] = {
10495
10524
.errstr = "R1 offset is outside of the packet" ,
10496
10525
.result = REJECT ,
10497
10526
.prog_type = BPF_PROG_TYPE_XDP ,
10527
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
10498
10528
},
10499
10529
{
10500
10530
"XDP pkt read, pkt_data <= pkt_meta', good access" ,
@@ -10531,6 +10561,7 @@ static struct bpf_test tests[] = {
10531
10561
.errstr = "R1 offset is outside of the packet" ,
10532
10562
.result = REJECT ,
10533
10563
.prog_type = BPF_PROG_TYPE_XDP ,
10564
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
10534
10565
},
10535
10566
{
10536
10567
"XDP pkt read, pkt_data <= pkt_meta', bad access 2" ,
@@ -10635,6 +10666,7 @@ static struct bpf_test tests[] = {
10635
10666
},
10636
10667
.result = REJECT ,
10637
10668
.errstr = "dereference of modified ctx ptr" ,
10669
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
10638
10670
},
10639
10671
{
10640
10672
"check deducing bounds from const, 8" ,
@@ -10648,6 +10680,7 @@ static struct bpf_test tests[] = {
10648
10680
},
10649
10681
.result = REJECT ,
10650
10682
.errstr = "dereference of modified ctx ptr" ,
10683
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
10651
10684
},
10652
10685
{
10653
10686
"check deducing bounds from const, 9" ,
@@ -11122,6 +11155,7 @@ static struct bpf_test tests[] = {
11122
11155
.result = REJECT ,
11123
11156
.errstr = "R6 invalid mem access 'inv'" ,
11124
11157
.prog_type = BPF_PROG_TYPE_XDP ,
11158
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
11125
11159
},
11126
11160
{
11127
11161
"calls: two calls with args" ,
@@ -11987,6 +12021,7 @@ static struct bpf_test tests[] = {
11987
12021
.fixup_map_hash_8b = { 12 , 22 },
11988
12022
.result = REJECT ,
11989
12023
.errstr = "invalid access to map value, value_size=8 off=2 size=8" ,
12024
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
11990
12025
},
11991
12026
{
11992
12027
"calls: two calls that receive map_value via arg=ptr_stack_of_caller. test2" ,
@@ -12130,6 +12165,7 @@ static struct bpf_test tests[] = {
12130
12165
.fixup_map_hash_8b = { 12 , 22 },
12131
12166
.result = REJECT ,
12132
12167
.errstr = "invalid access to map value, value_size=8 off=2 size=8" ,
12168
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
12133
12169
},
12134
12170
{
12135
12171
"calls: two calls that receive map_value_ptr_or_null via arg. test1" ,
@@ -12301,6 +12337,7 @@ static struct bpf_test tests[] = {
12301
12337
.result = ACCEPT ,
12302
12338
.prog_type = BPF_PROG_TYPE_SCHED_CLS ,
12303
12339
.retval = POINTER_VALUE ,
12340
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
12304
12341
},
12305
12342
{
12306
12343
"calls: pkt_ptr spill into caller stack 2" ,
@@ -12332,6 +12369,7 @@ static struct bpf_test tests[] = {
12332
12369
.prog_type = BPF_PROG_TYPE_SCHED_CLS ,
12333
12370
.errstr = "invalid access to packet" ,
12334
12371
.result = REJECT ,
12372
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
12335
12373
},
12336
12374
{
12337
12375
"calls: pkt_ptr spill into caller stack 3" ,
@@ -12434,6 +12472,7 @@ static struct bpf_test tests[] = {
12434
12472
.prog_type = BPF_PROG_TYPE_SCHED_CLS ,
12435
12473
.errstr = "same insn cannot be used with different" ,
12436
12474
.result = REJECT ,
12475
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
12437
12476
},
12438
12477
{
12439
12478
"calls: pkt_ptr spill into caller stack 6" ,
@@ -12469,6 +12508,7 @@ static struct bpf_test tests[] = {
12469
12508
.prog_type = BPF_PROG_TYPE_SCHED_CLS ,
12470
12509
.errstr = "R4 invalid mem access" ,
12471
12510
.result = REJECT ,
12511
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
12472
12512
},
12473
12513
{
12474
12514
"calls: pkt_ptr spill into caller stack 7" ,
@@ -12503,6 +12543,7 @@ static struct bpf_test tests[] = {
12503
12543
.prog_type = BPF_PROG_TYPE_SCHED_CLS ,
12504
12544
.errstr = "R4 invalid mem access" ,
12505
12545
.result = REJECT ,
12546
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
12506
12547
},
12507
12548
{
12508
12549
"calls: pkt_ptr spill into caller stack 8" ,
@@ -12584,6 +12625,7 @@ static struct bpf_test tests[] = {
12584
12625
.prog_type = BPF_PROG_TYPE_SCHED_CLS ,
12585
12626
.errstr = "invalid access to packet" ,
12586
12627
.result = REJECT ,
12628
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
12587
12629
},
12588
12630
{
12589
12631
"calls: caller stack init to zero or map_value_or_null" ,
@@ -12949,6 +12991,7 @@ static struct bpf_test tests[] = {
12949
12991
.result = REJECT ,
12950
12992
.errstr = "BPF_XADD stores into R2 pkt is not allowed" ,
12951
12993
.prog_type = BPF_PROG_TYPE_XDP ,
12994
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
12952
12995
},
12953
12996
{
12954
12997
"xadd/w check whether src/dst got mangled, 1" ,
@@ -13435,6 +13478,7 @@ static struct bpf_test tests[] = {
13435
13478
.prog_type = BPF_PROG_TYPE_SCHED_CLS ,
13436
13479
.errstr = "Unreleased reference" ,
13437
13480
.result = REJECT ,
13481
+ .flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS ,
13438
13482
},
13439
13483
{
13440
13484
"reference tracking: alloc, check, free in both subbranches" ,
0 commit comments