Commit 64c7d05
committed
netstacklat: Protect out-of-order tracking with spinlocks
Currently there is no synchronization between the updates and checks
of the per-socket ooo-range used to filter out potentially HOL-blocked
measurements. While the kernel holds a socket lock when the ooo-range
is updated in tcp_data_queue_ofo(), the kernel does not seem to hold a
socket lock by the time we check the ooo-range in
tcp_recv_timestamp(). To prevent the check of the ooo-range from
reading the ooo-range while it's concurrently updated (resulting in a
potentially inconsistent state), add a bpf_spin_lock to protect
updates and checks of the ooo-range.
Signed-off-by: Simon Sundberg <simon.sundberg@kau.se>1 parent 8798bdf commit 64c7d05
1 file changed
+17
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
363 | 364 | | |
364 | 365 | | |
365 | 366 | | |
| 367 | + | |
366 | 368 | | |
367 | 369 | | |
368 | 370 | | |
369 | 371 | | |
370 | 372 | | |
371 | 373 | | |
372 | 374 | | |
| 375 | + | |
373 | 376 | | |
374 | 377 | | |
375 | 378 | | |
| |||
378 | 381 | | |
379 | 382 | | |
380 | 383 | | |
| 384 | + | |
381 | 385 | | |
382 | 386 | | |
383 | 387 | | |
384 | 388 | | |
385 | 389 | | |
386 | 390 | | |
387 | 391 | | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | 392 | | |
392 | 393 | | |
393 | 394 | | |
| |||
400 | 401 | | |
401 | 402 | | |
402 | 403 | | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
408 | 414 | | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
409 | 418 | | |
410 | 419 | | |
411 | 420 | | |
| |||
0 commit comments