bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: KP Singh <kpsingh@chromium.org>
Cc: davem@davemloft.net, daniel@iogearbox.net,
	netdev@vger.kernel.org, bpf@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH bpf-next 1/3] bpf: Introduce sleepable BPF programs
Date: Thu, 28 May 2020 21:26:20 -0700	[thread overview]
Message-ID: <20200529042620.747i342nizywycyv@ast-mbp.dhcp.thefacebook.com> (raw)
In-Reply-To: <20200528221227.GA217782@google.com>

On Fri, May 29, 2020 at 12:12:27AM +0200, KP Singh wrote:
> > +			if (ret)
> > +				verbose(env, "%s() is not modifiable\n",
> > +					prog->aux->attach_func_name);
> > +		} else if (prog->aux->sleepable && prog->type == BPF_PROG_TYPE_TRACING) {
> > +			/* fentry/fexit progs can be sleepable only if they are
> > +			 * attached to ALLOW_ERROR_INJECTION or security_*() funcs.
> > +			 * LSM progs check that they are attached to bpf_lsm_*() funcs
> > +			 * which are sleepable too.
> 
> I know of one LSM hook which is not sleepable and is executed in an
> RCU callback i.e. task_free. I don't think t's a problem to run under
> SRCU for that (I tried it and it does not cause any issues).
> 
> We can add a blacklisting mechanism later for the sleepable flags or
> just the sleeping helpers (based on some of the work going on to
> whitelist functions for helper usage).

Good catch. *_task_free() are not sleepable. I'll introduce a simple
blacklist for now. Since I'm not adding actual sleeping helpers in this
patch set nothing is broken, but it will give us the base to build stuff on top.

  reply	other threads:[~2020-05-29  4:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-28  5:33 [PATCH bpf-next 0/3] bpf: Introduce minimal support for sleepable progs Alexei Starovoitov
2020-05-28  5:33 ` [PATCH bpf-next 1/3] bpf: Introduce sleepable BPF programs Alexei Starovoitov
2020-05-28 22:12   ` KP Singh
2020-05-29  4:26     ` Alexei Starovoitov [this message]
2020-05-28  5:33 ` [PATCH bpf-next 2/3] libbpf: support sleepable progs Alexei Starovoitov
2020-05-28 22:13   ` KP Singh
2020-05-28  5:33 ` [PATCH bpf-next 3/3] selftests/bpf: basic sleepable tests Alexei Starovoitov
2020-05-28 22:15   ` KP Singh

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=20200529042620.747i342nizywycyv@ast-mbp.dhcp.thefacebook.com \
    --to=alexei.starovoitov@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=kernel-team@fb.com \
    --cc=kpsingh@chromium.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;
as well as URLs for NNTP newsgroup(s).