From b9e19cc396347df8c7f8cf5d14ba1d6172040f16 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Wed, 20 Dec 2023 15:40:54 +0100 Subject: netlink: fix stack overflow due to erroneous rounding Byteorder switch in this function may undersize the conversion buffer by one byte, this needs to use div_round_up(). Signed-off-by: Florian Westphal --- tests/shell/testcases/bogons/nft-f/byteorder_switch_stack_overflow | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 tests/shell/testcases/bogons/nft-f/byteorder_switch_stack_overflow (limited to 'tests/shell/testcases/bogons/nft-f/byteorder_switch_stack_overflow') diff --git a/tests/shell/testcases/bogons/nft-f/byteorder_switch_stack_overflow b/tests/shell/testcases/bogons/nft-f/byteorder_switch_stack_overflow new file mode 100644 index 00000000..01640528 --- /dev/null +++ b/tests/shell/testcases/bogons/nft-f/byteorder_switch_stack_overflow @@ -0,0 +1,6 @@ +table inet x { + chain nat_dns_acme { + udp length . @th,260,118 vmap { 47-63 . 0xe373135363130333131303735353203 : goto nat_dns_dnstc, } + drop + } +} -- cgit v1.2.3