diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2021-12-15 02:20:54 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2021-12-15 08:59:33 +0300 |
commit | f97982398cc1c92f2e9bd0ef1ef870a5a729b0ac (patch) | |
tree | 6472b1652415cc9f7aee558e818b78e2c07cd366 /kernel/futex/futex.h | |
parent | a34efe503bc55c5732e328e5191ad549eb899f31 (diff) | |
download | linux-f97982398cc1c92f2e9bd0ef1ef870a5a729b0ac.tar.xz |
libbpf: Avoid reading past ELF data section end when copying license
Fix possible read beyond ELF "license" data section if the license
string is not properly zero-terminated. Use the fact that libbpf_strlcpy
never accesses the (N-1)st byte of the source string because it's
replaced with '\0' anyways.
If this happens, it's a violation of contract between libbpf and a user,
but not handling this more robustly upsets CIFuzz, so given the fix is
trivial, let's fix the potential issue.
Fixes: 9fc205b413b3 ("libbpf: Add sane strncpy alternative and use it internally")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20211214232054.3458774-1-andrii@kernel.org
Diffstat (limited to 'kernel/futex/futex.h')
0 files changed, 0 insertions, 0 deletions