mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexei Starovoitov <ast@fb.com>
To: David Miller <davem@davemloft.net>, <josef@toxicpanda.com>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<ast@kernel.org>, <kernel-team@fb.com>
Subject: Re: [PATCH 0/2][v2] Add the ability to do BPF directed error injection
Date: Tue, 31 Oct 2017 18:58:00 -0700	[thread overview]
Message-ID: <d01b9aa5-2571-2c43-a521-ea47567ab0d1@fb.com> (raw)
In-Reply-To: <20171101.105502.2238912905275925246.davem@davemloft.net>

On 10/31/17 6:55 PM, David Miller wrote:
> From: Josef Bacik <josef@toxicpanda.com>
> Date: Tue, 31 Oct 2017 11:45:55 -0400
>
>> v1->v2:
>> - moved things around to make sure that bpf_override_return could really only be
>>   used for an ftrace kprobe.
>> - killed the special return values from trace_call_bpf.
>> - renamed pc_modified to bpf_kprobe_state so bpf_override_return could tell if
>>   it was being called from an ftrace kprobe context.
>> - reworked the logic in kprobe_perf_func to take advantage of bpf_kprobe_state.
>> - updated the test as per Alexei's review.
>>
>> 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,
>
> This appears to moreso target the tracing tree than the networking tree.
>
> Let me know if that's not the case and I should be the one intergrating
> these changes.

i don't think it will apply to anything but net-next. If it goes any
other tree we will have major conflicts during merge window.
btw I haven't reviewed them for the second time.

  reply	other threads:[~2017-11-01  1:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-31 15:45 Josef Bacik
2017-10-31 15:45 ` [PATCH 1/2] bpf: add a bpf_override_function helper Josef Bacik
2017-11-01  4:47   ` Alexei Starovoitov
2017-10-31 15:45 ` [PATCH 2/2] samples/bpf: add a test for bpf_override_return Josef Bacik
2017-11-01  1:55 ` [PATCH 0/2][v2] Add the ability to do BPF directed error injection David Miller
2017-11-01  1:58   ` Alexei Starovoitov [this message]
2017-11-01  2:44     ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d01b9aa5-2571-2c43-a521-ea47567ab0d1@fb.com \
    --to=ast@fb.com \
    --cc=ast@kernel.org \
    --cc=davem@davemloft.net \
    --cc=josef@toxicpanda.com \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®