linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Corbet <corbet@lwn.net>
To: Josef Bacik <josef@toxicpanda.com>
Cc: rostedt@goodmis.org, mingo@redhat.com, davem@davemloft.net,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	ast@kernel.org, kernel-team@fb.com, daniel@iogearbox.net,
	linux-btrfs@vger.kernel.org, Josef Bacik <jbacik@fb.com>
Subject: Re: [PATCH v7 1/5] add infrastructure for tagging functions as error injectable
Date: Tue, 28 Nov 2017 11:58:41 -0700	[thread overview]
Message-ID: <20171128115841.4958113d@lwn.net> (raw)
In-Reply-To: <1511385814-20863-2-git-send-email-josef@toxicpanda.com>

On Wed, 22 Nov 2017 16:23:30 -0500
Josef Bacik <josef@toxicpanda.com> wrote:

> From: Josef Bacik <jbacik@fb.com>
> 
> Using BPF we can override kprob'ed functions and return arbitrary
> values.  Obviously this can be a bit unsafe, so make this feature opt-in
> for functions.  Simply tag a function with KPROBE_ERROR_INJECT_SYMBOL in
> order to give BPF access to that function for error injection purposes.
> 
> Signed-off-by: Josef Bacik <jbacik@fb.com>
> Acked-by: Ingo Molnar <mingo@kernel.org>
> ---
>  arch/x86/include/asm/asm.h        |   6 ++
>  include/asm-generic/vmlinux.lds.h |  10 +++
>  include/linux/bpf.h               |  11 +++
>  include/linux/kprobes.h           |   1 +
>  include/linux/module.h            |   5 ++
>  kernel/kprobes.c                  | 163 ++++++++++++++++++++++++++++++++++++++
>  kernel/module.c                   |   6 +-
>  7 files changed, 201 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/include/asm/asm.h b/arch/x86/include/asm/asm.h
> index b0dc91f4bedc..340f4cc43255 100644
> --- a/arch/x86/include/asm/asm.h
> +++ b/arch/x86/include/asm/asm.h
> @@ -85,6 +85,12 @@
>  	_ASM_PTR (entry);					\
>  	.popsection
>  
> +# define _ASM_KPROBE_ERROR_INJECT(entry)			\
> +	.pushsection "_kprobe_error_inject_list","aw" ;		\
> +	_ASM_ALIGN ;						\
> +	_ASM_PTR (entry);					\
> +	.popseciton

So this stuff is not my area of greatest expertise, but I do have to wonder
how ".popseciton" can work ... ?

Thanks,

jon

  reply	other threads:[~2017-11-28 18:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-22 21:23 [PATCH v7 0/4] Add the ability to do BPF directed error injection Josef Bacik
2017-11-22 21:23 ` [PATCH v7 1/5] add infrastructure for tagging functions as error injectable Josef Bacik
2017-11-28 18:58   ` Jonathan Corbet [this message]
2017-11-28 20:02     ` Josef Bacik
2017-11-29 16:59       ` Daniel Borkmann
2017-11-30 20:15         ` Josef Bacik
2017-11-22 21:23 ` [PATCH v7 2/5] btrfs: make open_ctree " Josef Bacik
2017-11-22 21:23 ` [PATCH v7 3/5] bpf: add a bpf_override_function helper Josef Bacik
2017-11-24  9:46   ` Daniel Borkmann
2017-11-22 21:23 ` [PATCH v7 4/5] samples/bpf: add a test for bpf_override_return Josef Bacik
2017-11-22 21:23 ` [PATCH v7 5/5] btrfs: allow us to inject errors at io_ctl_init Josef Bacik
2017-11-23  1:19 ` [PATCH v7 0/4] Add the ability to do BPF directed error injection Alexei Starovoitov
2017-11-28 16:22 ` Daniel Borkmann

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=20171128115841.4958113d@lwn.net \
    --to=corbet@lwn.net \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=jbacik@fb.com \
    --cc=josef@toxicpanda.com \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=rostedt@goodmis.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;
as well as URLs for NNTP newsgroup(s).