Commit ea21771
bpf: Maintain FIFO property for rqspinlock unlock
Since out-of-order unlocks are unsupported for rqspinlock, and irqsave
variants enforce strict FIFO ordering anyway, make the same change for
normal non-irqsave variants, such that FIFO ordering is enforced.
Two new verifier state fields (active_lock_id, active_lock_ptr) are used
to denote the top of the stack, and prev_id and prev_ptr are ascertained
whenever popping the topmost entry through an unlock.
Take special care to make these fields part of the state comparison in
refsafe.
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/r/20250316040541.108729-25-memxor@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>1 parent 0de2046 commit ea21771
2 files changed
+31
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
| 271 | + | |
271 | 272 | | |
272 | 273 | | |
273 | 274 | | |
| |||
434 | 435 | | |
435 | 436 | | |
436 | 437 | | |
| 438 | + | |
| 439 | + | |
437 | 440 | | |
438 | 441 | | |
439 | 442 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1428 | 1428 | | |
1429 | 1429 | | |
1430 | 1430 | | |
| 1431 | + | |
| 1432 | + | |
1431 | 1433 | | |
1432 | 1434 | | |
1433 | 1435 | | |
| |||
1527 | 1529 | | |
1528 | 1530 | | |
1529 | 1531 | | |
| 1532 | + | |
| 1533 | + | |
1530 | 1534 | | |
1531 | 1535 | | |
1532 | 1536 | | |
| |||
1577 | 1581 | | |
1578 | 1582 | | |
1579 | 1583 | | |
| 1584 | + | |
| 1585 | + | |
1580 | 1586 | | |
1581 | 1587 | | |
1582 | 1588 | | |
1583 | | - | |
1584 | | - | |
1585 | | - | |
| 1589 | + | |
| 1590 | + | |
1586 | 1591 | | |
1587 | 1592 | | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
1588 | 1596 | | |
1589 | 1597 | | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
1590 | 1602 | | |
1591 | 1603 | | |
1592 | 1604 | | |
| |||
8342 | 8354 | | |
8343 | 8355 | | |
8344 | 8356 | | |
| 8357 | + | |
| 8358 | + | |
| 8359 | + | |
| 8360 | + | |
| 8361 | + | |
| 8362 | + | |
| 8363 | + | |
| 8364 | + | |
8345 | 8365 | | |
8346 | 8366 | | |
8347 | 8367 | | |
| |||
12534 | 12554 | | |
12535 | 12555 | | |
12536 | 12556 | | |
12537 | | - | |
12538 | | - | |
| 12557 | + | |
12539 | 12558 | | |
12540 | 12559 | | |
12541 | 12560 | | |
| |||
18591 | 18610 | | |
18592 | 18611 | | |
18593 | 18612 | | |
| 18613 | + | |
| 18614 | + | |
| 18615 | + | |
| 18616 | + | |
18594 | 18617 | | |
18595 | 18618 | | |
18596 | 18619 | | |
| |||
0 commit comments