netfilter: xt_dscp: add checkentry for tos match

The 'tos' match registered in xt_dscp.c has no .checkentry callback,
allowing userspace to insert rules with a non-boolean invert field
without any validation.

Add tos_mt_check() that rejects invert > 1 and attach it to both the
IPv4 and IPv6 'tos' match registrations.

Signed-off-by: Feng Wu <wufengwufengwufeng@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
This commit is contained in:
Feng Wu 2026-06-25 01:43:34 -07:00 • committed by Florian Westphal
commit 60aee97fc7