Commit 977a1e4
fix stale-check signed overflow; add adversarial admission tests
Fix undefined behavior in rx_session_solve_admission(): the expression
`ts > (last_admission_ts + timeout)` overflows int64_t when
last_admission_ts == BIG_BANG (INT64_MIN). Rearranged to the equivalent
`(ts - timeout) > last_admission_ts` which is safe for non-negative ts
and timeout.
Add test_intrusive_rx_admission.c: 14 test cases covering the admission
state machine exhaustively — truth table, fresh/stale boundary
conditions, continuation frames, preemption scenarios (including the
documented TID-rollover edge case), record_admission masking, and
integration sequences (TID progression, duplicate rejection, interface
failover, zero timeout, duplicate-after-preemption limitation).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent d52e640 commit 977a1e4
File tree
3 files changed
+557
-1
lines changed- libcanard
- tests
- src
3 files changed
+557
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1404 | 1404 | | |
1405 | 1405 | | |
1406 | 1406 | | |
1407 | | - | |
| 1407 | + | |
1408 | 1408 | | |
1409 | 1409 | | |
1410 | 1410 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| |||
0 commit comments