]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
netfilter: xt_u32: validate user space input
authorWander Lairson Costa <wander@redhat.com>
Mon, 28 Aug 2023 13:21:07 +0000 (10:21 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Sep 2023 08:46:59 +0000 (10:46 +0200)
commite416d65ff456066d60d813c540ab2dd2a06d3d12
treebd377728193a18ec57602c662a0cf11980ae163c
parent7935b636dd693dfe4483cfef4a1e91366c8103fa
netfilter: xt_u32: validate user space input

commit 69c5d284f67089b4750d28ff6ac6f52ec224b330 upstream.

The xt_u32 module doesn't validate the fields in the xt_u32 structure.
An attacker may take advantage of this to trigger an OOB read by setting
the size fields with a value beyond the arrays boundaries.

Add a checkentry function to validate the structure.

This was originally reported by the ZDI project (ZDI-CAN-18408).

Fixes: 1b50b8a371e9 ("[NETFILTER]: Add u32 match")
Cc: stable@vger.kernel.org
Signed-off-by: Wander Lairson Costa <wander@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/netfilter/xt_u32.c