]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Fix error path under memory pressure
authorAlexei Starovoitov <ast@kernel.org>
Wed, 22 Jan 2020 02:41:38 +0000 (18:41 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 22 Jan 2020 11:09:02 +0000 (12:09 +0100)
commitd67bbc64500038321dc549f5dc4e1a70ffa1a7f6
tree0e3289384ee6ad1a13499afe74509574be73f27c
parenta38a839b05e809a129c0e85f8d616e737655a763
bpf: Fix error path under memory pressure

Restore the 'if (env->cur_state)' check that was incorrectly removed during
code move. Under memory pressure env->cur_state can be freed and zeroed inside
do_check(). Hence the check is necessary.

Fixes: 24810a531086 ("bpf: Introduce function-by-function verification")
Reported-by: syzbot+b296579ba5015704d9fa@syzkaller.appspotmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20200122024138.3385590-1-ast@kernel.org
kernel/bpf/verifier.c