netfilter: nf_tables: replace BUG_ON by element length check
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 5 Jul 2022 09:41:59 +0000 (11:41 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sat, 9 Jul 2022 14:25:09 +0000 (16:25 +0200)
commitc39ba4de6b0a843bec5d46c2b6f2064428dada5e
tree9573c622675b31bbb723ca6d302c557578557d25
parent7a847c00eeba9744353ecdfad253143b9115678a
netfilter: nf_tables: replace BUG_ON by element length check

BUG_ON can be triggered from userspace with an element with a large
userdata area. Replace it by length check and return EINVAL instead.
Over time extensions have been growing in size.

Pick a sufficiently old Fixes: tag to propagate this fix.

Fixes: 7d7402642eaf ("netfilter: nf_tables: variable sized set element keys / data")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/netfilter/nf_tables.h
net/netfilter/nf_tables_api.c