diff options
author | Stanislav Fomichev <sdf@google.com> | 2019-02-19 10:54:17 -0800 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2019-02-25 22:21:22 +0100 |
commit | a439184d515fbf4805f57d11fa5dfd4524d2c0eb (patch) | |
tree | a5e9805e70b42c76bb3ce9f7a79a77f1c22d163a /tools | |
parent | fd92d6648feb83888e40f0aa2f74e1d9bbd2ad7d (diff) | |
download | linux-a439184d515fbf4805f57d11fa5dfd4524d2c0eb.tar.gz linux-a439184d515fbf4805f57d11fa5dfd4524d2c0eb.tar.bz2 linux-a439184d515fbf4805f57d11fa5dfd4524d2c0eb.zip |
bpf/test_run: fix unkillable BPF_PROG_TEST_RUN for flow dissector
Syzbot found out that running BPF_PROG_TEST_RUN with repeat=0xffffffff
makes process unkillable. The problem is that when CONFIG_PREEMPT is
enabled, we never see need_resched() return true. This is due to the
fact that preempt_enable() (which we do in bpf_test_run_one on each
iteration) now handles resched if it's needed.
Let's disable preemption for the whole run, not per test. In this case
we can properly see whether resched is needed.
Let's also properly return -EINTR to the userspace in case of a signal
interrupt.
This is a follow up for a recently fixed issue in bpf_test_run, see
commit df1a2cb7c74b ("bpf/test_run: fix unkillable
BPF_PROG_TEST_RUN").
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions