]> www.infradead.org Git - users/jedix/linux-maple.git/commit
xfrm: validate assignment of maximal possible SEQ number
authorLeon Romanovsky <leonro@nvidia.com>
Tue, 13 May 2025 10:56:22 +0000 (13:56 +0300)
committerSteffen Klassert <steffen.klassert@secunet.com>
Thu, 15 May 2025 07:56:19 +0000 (09:56 +0200)
commite86212b6b13a20c5ad404c5597933f57fd0f1519
tree2d032fcea7de17507663de3e274027ebcb832d44
parent86e530c84c9701e653a324df970c25ca3ffee390
xfrm: validate assignment of maximal possible SEQ number

Users can set any seq/seq_hi/oseq/oseq_hi values. The XFRM core code
doesn't prevent from them to set even 0xFFFFFFFF, however this value
will cause for traffic drop.

Is is happening because SEQ numbers here mean that packet with such
number was processed and next number should be sent on the wire. In this
case, the next number will be 0, and it means overflow which causes to
(expected) packet drops.

While it can be considered as misconfiguration and handled by XFRM
datapath in the same manner as any other SEQ number, let's add
validation to easy for packet offloads implementations which need to
configure HW with next SEQ to send and not with current SEQ like it is
done in core code.

Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_user.c