Netdev List
 help / color / mirror / Atom feed
* [PATCH net 0/6] xsk: harden TX metadata validation against races
@ 2026-07-27 16:19 Stanislav Fomichev
  2026-07-27 16:19 ` [PATCH net 1/6] xsk: require at least 16 bytes of TX metadata Stanislav Fomichev
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Stanislav Fomichev @ 2026-07-27 16:19 UTC (permalink / raw)
  To: netdev
  Cc: davem, edumazet, kuba, pabeni, anthony.l.nguyen,
	przemyslaw.kitszel, andrew+netdev, saeedm, tariqt, mbloch, ast,
	daniel, hawk, john.fastabend, sdf, maxime.chevallier,
	mcoquelin.stm32, alexandre.torgue, aleksander.lobakin, horms,
	magnus.karlsson, maciej.fijalkowski, witu, alice.kernel, dtatulea,
	yoong.siang.song, martin.lau, intel-wired-lan, linux-kernel,
	linux-rdma, bpf, linux-stm32, linux-arm-kernel, leon,
	AutonomousCodeSecurity, Cen Zhang (Microsoft)

Cen Zhang reported a KASAN out-of-bounds read when AF_XDP is configured
with a TX metadata area smaller than struct xsk_tx_metadata. The metadata
is also shared with user space, so reading its flags more than once can
produce inconsistent validation and processing decisions.

Require enough space for the flags and one request field, validate the
launch-time field against the configured metadata length, and use one
snapshot of the flags while processing each request. Carry the validated
decision through completion handling so later user-space changes cannot
enable an unrequested completion timestamp.

Reported-by: AutonomousCodeSecurity@microsoft.com
Reported-by: Cen Zhang (Microsoft) <blbllhy@gmail.com>
Link: https://lore.kernel.org/netdev/20260720155210.34229-1-blbllhy@gmail.com/

Stanislav Fomichev (6):
  xsk: require at least 16 bytes of TX metadata
  xsk: pass TX metadata pointer by reference
  xsk: clear metadata pointer when no timestamp is requested
  xsk: validate launch-time metadata size
  xsk: move xsk_tx_metadata_request() to xdp_sock_drv.h
  xsk: validate metadata when processing requests

 drivers/net/ethernet/intel/igc/igc_main.c     |  2 +-
 drivers/net/ethernet/mellanox/mlx5/core/en.h  |  2 +-
 .../net/ethernet/mellanox/mlx5/core/en/xdp.c  | 15 ++--
 .../net/ethernet/mellanox/mlx5/core/en/xdp.h  |  4 +-
 .../ethernet/mellanox/mlx5/core/en/xsk/tx.c   |  2 +-
 .../net/ethernet/stmicro/stmmac/stmmac_main.c |  4 +-
 include/net/libeth/xsk.h                      |  2 +-
 include/net/xdp_sock.h                        | 45 ++---------
 include/net/xdp_sock_drv.h                    | 77 ++++++++++++++++---
 net/xdp/xdp_umem.c                            |  2 +
 net/xdp/xsk.c                                 | 11 ++-
 net/xdp/xsk_buff_pool.c                       |  6 +-
 12 files changed, 101 insertions(+), 71 deletions(-)

-- 
2.53.0-Meta


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-07-29  9:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-27 16:19 [PATCH net 0/6] xsk: harden TX metadata validation against races Stanislav Fomichev
2026-07-27 16:19 ` [PATCH net 1/6] xsk: require at least 16 bytes of TX metadata Stanislav Fomichev
2026-07-27 16:19 ` [PATCH net 2/6] xsk: pass TX metadata pointer by reference Stanislav Fomichev
2026-07-27 16:19 ` [PATCH net 3/6] xsk: clear metadata pointer when no timestamp is requested Stanislav Fomichev
2026-07-27 16:19 ` [PATCH net 4/6] xsk: validate launch-time metadata size Stanislav Fomichev
2026-07-27 16:19 ` [PATCH net 5/6] xsk: move xsk_tx_metadata_request() to xdp_sock_drv.h Stanislav Fomichev
2026-07-27 16:19 ` [PATCH net 6/6] xsk: validate metadata when processing requests Stanislav Fomichev
2026-07-29  9:39 ` [PATCH net 0/6] xsk: harden TX metadata validation against races Maciej Fijalkowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox