From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932569AbdJPWWk (ORCPT ); Mon, 16 Oct 2017 18:22:40 -0400 Received: from mail.sigma-star.at ([95.130.255.111]:45996 "EHLO mail.sigma-star.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751859AbdJPWWi (ORCPT ); Mon, 16 Oct 2017 18:22:38 -0400 From: Richard Weinberger To: Alexei Starovoitov , Al Viro Cc: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Daniel Borkmann , Alexei Starovoitov , linux-arch@vger.kernel.org Subject: Re: [PATCH 1/3] bpf: Don't check for current being NULL Date: Tue, 17 Oct 2017 00:23:13 +0200 Message-ID: <1838884.qlCOuH57mO@blindfold> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Alexei, Am Dienstag, 17. Oktober 2017, 00:06:08 CEST schrieb Alexei Starovoitov: > On Mon, Oct 16, 2017 at 11:18 AM, Richard Weinberger wrote: > > current is never NULL. > > > > Signed-off-by: Richard Weinberger > > --- > > > > 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. Thanks, //richard