Commit c3db55d
net/mlx5e: Prevent concurrent access to IPSec ASO context
[ Upstream commit 99b3685 ]
The query or updating IPSec offload object is through Access ASO WQE.
The driver uses a single mlx5e_ipsec_aso struct for each PF, which
contains a shared DMA-mapped context for all ASO operations.
A race condition exists because the ASO spinlock is released before
the hardware has finished processing WQE. If a second operation is
initiated immediately after, it overwrites the shared context in the
DMA area.
When the first operation's completion is processed later, it reads
this corrupted context, leading to unexpected behavior and incorrect
results.
This commit fixes the race by introducing a private context within
each IPSec offload object. The shared ASO context is now copied to
this private context while the ASO spinlock is held. Subsequent
processing uses this saved, per-object context, ensuring its integrity
is maintained.
Fixes: 1ed78fc ("net/mlx5e: Update IPsec soft and hard limits")
Signed-off-by: Jianbo Liu <jianbol@nvidia.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20260316094603.6999-3-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 869ff44 commit c3db55d
File tree
2 files changed
+9
-9
lines changed- drivers/net/ethernet/mellanox/mlx5/core/en_accel
2 files changed
+9
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
| 277 | + | |
277 | 278 | | |
278 | 279 | | |
279 | 280 | | |
| |||
Lines changed: 8 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
374 | | - | |
375 | | - | |
376 | 374 | | |
377 | 375 | | |
378 | 376 | | |
379 | 377 | | |
380 | 378 | | |
381 | | - | |
382 | | - | |
| 379 | + | |
| 380 | + | |
383 | 381 | | |
384 | 382 | | |
385 | 383 | | |
386 | 384 | | |
387 | | - | |
| 385 | + | |
388 | 386 | | |
389 | 387 | | |
390 | 388 | | |
| |||
455 | 453 | | |
456 | 454 | | |
457 | 455 | | |
458 | | - | |
459 | 456 | | |
460 | 457 | | |
461 | | - | |
462 | 458 | | |
463 | 459 | | |
464 | 460 | | |
| |||
467 | 463 | | |
468 | 464 | | |
469 | 465 | | |
470 | | - | |
471 | | - | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
472 | 469 | | |
473 | 470 | | |
474 | 471 | | |
| |||
630 | 627 | | |
631 | 628 | | |
632 | 629 | | |
| 630 | + | |
| 631 | + | |
633 | 632 | | |
634 | 633 | | |
635 | 634 | | |
0 commit comments