diff options
author | Andrei Matei <andreimatei1@gmail.com> | 2024-03-27 05:42:45 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2024-03-27 19:56:36 +0300 |
commit | ecc6a2101840177e57c925c102d2d29f260d37c8 (patch) | |
tree | bf6977a9ab0b8a0c54accee088371e52c6d6d08d /certs | |
parent | a8d89feba7e54e691ca7c4efc2a6264fa83f3687 (diff) | |
download | linux-ecc6a2101840177e57c925c102d2d29f260d37c8.tar.xz |
bpf: Protect against int overflow for stack access size
This patch re-introduces protection against the size of access to stack
memory being negative; the access size can appear negative as a result
of overflowing its signed int representation. This should not actually
happen, as there are other protections along the way, but we should
protect against it anyway. One code path was missing such protections
(fixed in the previous patch in the series), causing out-of-bounds array
accesses in check_stack_range_initialized(). This patch causes the
verification of a program with such a non-sensical access size to fail.
This check used to exist in a more indirect way, but was inadvertendly
removed in a833a17aeac7.
Fixes: a833a17aeac7 ("bpf: Fix verification of indirect var-off stack access")
Reported-by: syzbot+33f4297b5f927648741a@syzkaller.appspotmail.com
Reported-by: syzbot+aafd0513053a1cbf52ef@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/bpf/CAADnVQLORV5PT0iTAhRER+iLBTkByCYNBYyvBSgjN1T31K+gOw@mail.gmail.com/
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Andrei Matei <andreimatei1@gmail.com>
Link: https://lore.kernel.org/r/20240327024245.318299-3-andreimatei1@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'certs')
0 files changed, 0 insertions, 0 deletions