In the Linux kernel, the following vulnerability has been resolved:
netfilter: nftables: avoid overflows in nft_hash_buckets()
Number of buckets being stored in 32bit variables, we have to
ensure that no overflows occur in nft_hash_buckets()
syzbot injected a size == 0x40000000 and reported:
UBSAN: shift-out-of-bounds in ./include/linux/log2.h:57:13shift exponent 64 is too large for 64-bit type 'long unsigned int'
CPU: 1 PID: 29539 Comm: syz-executor.4 Not tainted 5.12.0-rc7-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:__dump_stacklib/dump_stack.c:79[inline]dump_stack+0x141/0x1d7lib/dump_stack.c:120ubsan_epilogue+0xb/0x5alib/ubsan.c:148__ubsan_handle_shift_out_of_bounds.cold+0xb1/0x181lib/ubsan.c:327__roundup_pow_of_twoinclude/linux/log2.h:57[inline]nft_hash_bucketsnet/netfilter/nft_set_hash.c:411[inline]nft_hash_estimate.cold+0x19/0x1enet/netfilter/nft_set_hash.c:652nft_select_set_opsnet/netfilter/nf_tables_api.c:3586[inline]nf_tables_newset+0xe62/0x3110net/netfilter/nf_tables_api.c:4322nfnetlink_rcv_batch+0xa09/0x24b0net/netfilter/nfnetlink.c:488nfnetlink_rcv_skb_batchnet/netfilter/nfnetlink.c:612[inline]nfnetlink_rcv+0x3af/0x420net/netfilter/nfnetlink.c:630netlink_unicast_kernelnet/netlink/af_netlink.c:1312[inline]netlink_unicast+0x533/0x7d0net/netlink/af_netlink.c:1338netlink_sendmsg+0x856/0xd90net/netlink/af_netlink.c:1927sock_sendmsg_nosecnet/socket.c:654[inline]sock_sendmsg+0xcf/0x120net/socket.c:674____sys_sendmsg+0x6e8/0x810net/socket.c:2350___sys_sendmsg+0xf3/0x170net/socket.c:2404__sys_sendmsg+0xe5/0x1b0net/socket.c:2433do_syscall_64+0x2d/0x70arch/x86/entry/common.c:46