diff options
author | Andrii Nakryiko <andriin@fb.com> | 2019-11-07 05:08:52 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-01-26 12:00:57 +0300 |
commit | 02d3c2fb209ff786e844cbe062e942eba5401bf4 (patch) | |
tree | ab068cf77d264e40c92141ad66ac4907f7a63c91 | |
parent | 2bc794f2038e1cbb0c39b6f2c462e75e49c9bccc (diff) | |
download | linux-02d3c2fb209ff786e844cbe062e942eba5401bf4.tar.xz |
libbpf: Fix potential overflow issue
commit 4ee1135615713387b869dfd099ffdf8656be6784 upstream.
Fix a potential overflow issue found by LGTM analysis, based on Github libbpf
source code.
Fixes: 3d65014146c6 ("bpf: libbpf: Add btf_line_info support to libbpf")
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20191107020855.3834758-3-andriin@fb.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | tools/lib/bpf/bpf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c index cbb933532981..9d0485959308 100644 --- a/tools/lib/bpf/bpf.c +++ b/tools/lib/bpf/bpf.c @@ -189,7 +189,7 @@ static void * alloc_zero_tailing_info(const void *orecord, __u32 cnt, __u32 actual_rec_size, __u32 expected_rec_size) { - __u64 info_len = actual_rec_size * cnt; + __u64 info_len = (__u64)actual_rec_size * cnt; void *info, *nrecord; int i; |