mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] Add the ability to do BPF directed error injection
@ 2017-10-30 21:19 Josef Bacik
  2017-10-30 21:19 ` [PATCH 1/2] bpf: add a bpf_override_function helper Josef Bacik
  2017-10-30 21:19 ` [PATCH 2/2] samples/bpf: add a test for bpf_override_return Josef Bacik
  0 siblings, 2 replies; 5+ messages in thread
From: Josef Bacik @ 2017-10-30 21:19 UTC (permalink / raw)
  To: davem, netdev, linux-kernel, ast, kernel-team

A lot of our error paths are not well tested because we have no good way of
injecting errors generically.  Some subystems (block, memory) have ways to
inject errors, but they are random so it's hard to get reproduceable results.

With BPF we can add determinism to our error injection.  We can use kprobes and
other things to verify we are injecting errors at the exact case we are trying
to test.  This patch gives us the tool to actual do the error injection part.
It is very simple, we just set the return value of the pt_regs we're given to
whatever we provide, and then override the PC with a dummy function that simply
returns.

Right now this only works on x86, but it would be simple enough to expand to
other architectures.  Thanks,

Josef

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-10-31  1:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-30 21:19 [PATCH 0/2] Add the ability to do BPF directed error injection Josef Bacik
2017-10-30 21:19 ` [PATCH 1/2] bpf: add a bpf_override_function helper Josef Bacik
2017-10-31  1:35   ` Alexei Starovoitov
2017-10-30 21:19 ` [PATCH 2/2] samples/bpf: add a test for bpf_override_return Josef Bacik
2017-10-31  1:37   ` Alexei Starovoitov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®