]> git.ipfire.org Git - thirdparty/linux.git/commit
netfilter: xt_hashlimit: validate hashtable supports XT_HASHLIMIT_RATE_MATCH
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 21 Jul 2026 20:02:46 +0000 (22:02 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 23 Jul 2026 16:01:25 +0000 (18:01 +0200)
commit305b63e1402267459fdabb183af4527f6799eebf
treec0616eb52c0ae87fc25a14d89be72b14a1fb95d0
parentf4f699790590bd0896c48a71e9232a65198f92f0
netfilter: xt_hashlimit: validate hashtable supports XT_HASHLIMIT_RATE_MATCH

The XT_HASHLIMIT_RATE_MATCH flag mode changes the semantics of the
dsthash_ent structure which represents an entry in the hashtable.  There
is a union area which uses a different layout to express the rate match
mode.

Update .checkentry path to validate the XT_HASHLIMIT_RATE_MATCH mode
flag is requested by two or more different rules that refer to the same
hashtable. Otherwise, uninitialized access to the burst field in the
union is possible.

Reject the use of the XT_HASHLIMIT_RATE_MATCH mode flag if set on by
revision less than 3 too.

Fixes: bea74641e378 ("netfilter: xt_hashlimit: add rate match mode")
Reported-and-tested-by: Talha Berk Arslan <talha.anything.info@gmail.com>
Link: https://patch.msgid.link/20260721074629.668-1-talha.anything.info@gmail.com/
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/xt_hashlimit.c