diff options
author | Alexei Starovoitov <ast@kernel.org> | 2020-11-19 19:45:55 +0100 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-11-19 20:58:15 +0100 |
commit | 14d6d86c210aea1a83c19a8f6391ecabcbefed94 (patch) | |
tree | 5eadde2770ff55b99a77d39e56e9b3dc322ce628 /net/mac802154 | |
parent | libbpf: Fix VERSIONED_SYM_COUNT number parsing (diff) | |
parent | selftest/bpf: Test bpf_probe_read_user_str() strips trailing bytes after NUL (diff) | |
download | linux-14d6d86c210aea1a83c19a8f6391ecabcbefed94.tar.xz linux-14d6d86c210aea1a83c19a8f6391ecabcbefed94.zip |
Merge branch 'Fix bpf_probe_read_user_str() overcopying'
Daniel Xu says:
====================
6ae08ae3dea2 ("bpf: Add probe_read_{user, kernel} and probe_read_{user,
kernel}_str helpers") introduced a subtle bug where
bpf_probe_read_user_str() would potentially copy a few extra bytes after
the NUL terminator.
This issue is particularly nefarious when strings are used as map keys,
as seemingly identical strings can occupy multiple entries in a map.
This patchset fixes the issue and introduces a selftest to prevent
future regressions.
v6 -> v7:
* Add comments
v5 -> v6:
* zero-pad up to sizeof(unsigned long) after NUL
v4 -> v5:
* don't read potentially uninitialized memory
v3 -> v4:
* directly pass userspace pointer to prog
* test more strings of different length
v2 -> v3:
* set pid filter before attaching prog in selftest
* use long instead of int as bpf_probe_read_user_str() retval
* style changes
v1 -> v2:
* add Fixes: tag
* add selftest
====================
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'net/mac802154')
0 files changed, 0 insertions, 0 deletions