Commit 25aea32f authored by Bui Quang Minh's avatar Bui Quang Minh Committed by Pu Lehui
Browse files

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: default avatarBui Quang Minh <minhquangbui99@gmail.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20210127063653.3576-1-minhquangbui99@gmail.com


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarPu Lehui <pulehui@huawei.com>
parent 48d72040
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment