]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Fix potential multiplication overflow in mmap() size calculation
authorAndrii Nakryiko <andriin@fb.com>
Fri, 17 Jan 2020 06:08:00 +0000 (22:08 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 17 Jan 2020 16:33:18 +0000 (08:33 -0800)
commitdc0d8b441a6d7da3bed07b5dff71f6aec067d5dd
treeed0c7062d3151b9b6cfcb9707830726159069f84
parent0b3ed5ed48dc175f440850a05e42f6b266209af6
libbpf: Fix potential multiplication overflow in mmap() size calculation

Prevent potential overflow performed in 32-bit integers, before assigning
result to size_t. Reported by LGTM static analysis.

Fixes: fd57ffe4cf59 ("libbpf: Refactor global data map initialization")
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200117060801.1311525-4-andriin@fb.com
tools/lib/bpf/libbpf.c