lkml.org 
[lkml]   [2017]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] bpf: Don't check for current being NULL
On Tue, Oct 17, 2017 at 12:23:13AM +0200, Richard Weinberger wrote:
> Alexei,
>
> Am Dienstag, 17. Oktober 2017, 00:06:08 CEST schrieb Alexei Starovoitov:
> > On Mon, Oct 16, 2017 at 11:18 AM, Richard Weinberger <richard@nod.at> wrote:
> > > current is never NULL.
> > >
> > > Signed-off-by: Richard Weinberger <richard@nod.at>
> > > ---
> > >
> > > kernel/bpf/helpers.c | 12 ------------
> > > 1 file changed, 12 deletions(-)
> > >
> > > diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c
> > > index 3d24e238221e..e8845adcd15e 100644
> > > --- a/kernel/bpf/helpers.c
> > > +++ b/kernel/bpf/helpers.c
> > > @@ -120,9 +120,6 @@ BPF_CALL_0(bpf_get_current_pid_tgid)
> > >
> > > {
> > >
> > > struct task_struct *task = current;
> > >
> > > - if (unlikely(!task))
> > > - return -EINVAL;
> > > -
> >
> > really? in all context? including irq and nmi?
>
> I would be astonished current is NULL in such a context.
>
> To be sure, let's CC linux-arch.
> IIRC I talked also with Al about this and he also assumed that current
> cannot be NULL.

Hmm I probably mistakenly stole the !current check from somewhere.
Happy to delete all these checks then.

\
 
 \ /
  Last update: 2017-10-17 00:32    [W:0.046 / U:0.692 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site