Skip to content

nft_byteorder: fix the uninitialised-stack read without removing multi-register support

Abdifatah Suruur stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2Revert "netfilter: nft_byteorder: remove multi-register support"net/netfilter/nft_byteorder.c+31 -203 replies
2/2netfilter: nft_byteorder: initialise the marked destination spannet/netfilter/nft_byteorder.c+11 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 6.18.y 0/2] nft_byteorder: fix the uninitialised-stack read without removing multi-register support

Pablo pointed out that the full upstream removal (bb061d3) cannot be applied to stable trees: nftables versions before 1.1.0 can generate len != size byteorder expressions, and the removal rejects them, so existing rulesets may fail to load. The removal is tagged stable+noautosel for that reason.

This series restores the multi-register path in 6.18.y and fixes the uninitialised-stack read with a targeted initialisation:

1/2 reverts the removal currently in 6.18.y.
2/2 zeroes the destination span marked initialised by the control
plane, but only when source and destination registers differ, so in-place conversions (sreg == dreg) keep their value.

This does not reject any rule and keeps the old userspace-visible behaviour. It removes the dependency on CONFIG_INIT_STACK_ALL_ZERO zeroing the register file.

Compile-tested by reverting the removal and applying 2/2 to the pre-removal tree; runtime testing on 6.18.y is welcome.

Abdifatah Suruur (2):
Revert "netfilter: nft_byteorder: remove multi-register support"
netfilter: nft_byteorder: initialise the marked destination span

Pablo, this is the stable-specific alternative we discussed. If a single folded patch is preferred, I can resend it that way.