diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2018-10-24 22:05:48 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2018-10-25 17:02:06 -0700 |
commit | d3f66e4116aff8dd0d5bd4067295b9ddb5e2c29c (patch) | |
tree | 44d9067866b5d740959eb95d33ffef600fd04b38 /net/core | |
parent | 80b0d86a176cab6201719b8dfd806902b0c6e046 (diff) |
bpf: fix leaking uninitialized memory on pop/peek helpers
Commit f1a2e44a3aec ("bpf: add queue and stack maps") added helpers
with ARG_PTR_TO_UNINIT_MAP_VALUE. Meaning, the helper is supposed to
fill the map value buffer with data instead of reading from it like
in other helpers such as map update. However, given the buffer is
allowed to be uninitialized (since we fill it in the helper anyway),
it also means that the helper is obliged to wipe the memory in case
of an error in order to not allow for leaking uninitialized memory.
Given pop/peek is both handled inside __{stack,queue}_map_get(),
lets wipe it there on error case, that is, empty stack/queue.
Fixes: f1a2e44a3aec ("bpf: add queue and stack maps")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Cc: Mauricio Vasquez B <mauricio.vasquez@polito.it>
Acked-by: Mauricio Vasquez B<mauricio.vasquez@polito.it>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'net/core')
0 files changed, 0 insertions, 0 deletions