bpf: Check for integer overflow when using roundup_pow_of_two()
stable inclusion from stable-v4.19.177 commit 063c722dd9d285d877e6fd499e753d6224f4c046 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9HKCB CVE: CVE-2024-26883 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=063c722dd9d2 -------------------------------- [ Upstream commit 6183f4d3 ] On 32-bit architecture, roundup_pow_of_two() can return 0 when the argument has upper most bit set due to resulting 1UL << 32. Add a check for this case. Fixes: d5a3b1f6 ("bpf: introduce BPF_MAP_TYPE_STACK_TRACE") Signed-off-by:Bui Quang Minh <minhquangbui99@gmail.com> Signed-off-by:
Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/bpf/20210127063653.3576-1-minhquangbui99@gmail.com Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Pu Lehui <pulehui@huawei.com>
Loading
Please sign in to comment