Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1459005ybe; Wed, 11 Sep 2019 15:30:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqyFhmjC3lj1Ea6eE5V6uMPPfYplc6+pYy9RphcZaxJDndo1g9rwtOKMGBP3DegzV3k2y4Qt X-Received: by 2002:a50:f41a:: with SMTP id r26mr16800282edm.300.1568241054410; Wed, 11 Sep 2019 15:30:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568241054; cv=none; d=google.com; s=arc-20160816; b=vwnown31fQ6ZNPrFlhiZrvOg60+0ZHrMBp1JQlD3r6RxalrCFOFn+2mwYygbnNlSHj bA1/WUp39+NuJWrzKQdyP81X0tWFgfoLBvEeUlmg34PDIBgD83p1avbyyClDpsgqeAMn HKEOtBG9SAeBwXHmShlvChbk87ZU9ZDAgR5KWTxPU1jhogA2e/Tijn4fiI5XaDLbKb/M g4pD5XE+rFdpgl8D2QURCrOSEhF8y4+RDVZ9WLORDSSUlpFOG2d3Pgnhxe/yJdaIgzKH OgaKfrurUBBlSkk/Jvd2NHJH5L2MJkSbg8/TsdTHu8z28HqdfbL5he5M2dNutyIncTET BWYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=XJHMobu+BW8e+V93RysuqAgvySnrHLkRIzv4bFfI7f4=; b=ZcyuvNl324PVjuUKBEtgjyBRw8+umU4vQ69QqU2mznUzxIpitvasMWmyBjRB7kq2Dm 3RxmK7PAJj4S2oWZdYbgSQEvNmWZF4VBCjqMckj1/kGDgFy+MjniIpp/c3g4/0knayL+ uHYFTZ1ZiAaJnMmFJIkZ8jFZLhJ0UYbXy65WL+e84rf1tOc9JrC9omduDGU+Aux5/+50 nV9+X/wT97mojkTNorn3AZp9XOVSkohWNYsyKUkoBpFY1+j51EeSWHSf0c2kMkgZHvig 2sOuH5jwXvC/MhTyHQab+FjO2p4TLmX4SXbCUZBaK+soV4Agty10nTzzk27zxN9bpAsQ vQ3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=rLaITkTe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e57si13457486ede.356.2019.09.11.15.30.30; Wed, 11 Sep 2019 15:30:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=rLaITkTe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730681AbfIKVHw (ORCPT + 99 others); Wed, 11 Sep 2019 17:07:52 -0400 Received: from mail-vs1-f67.google.com ([209.85.217.67]:46336 "EHLO mail-vs1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730669AbfIKVHw (ORCPT ); Wed, 11 Sep 2019 17:07:52 -0400 Received: by mail-vs1-f67.google.com with SMTP id z14so14705282vsz.13 for ; Wed, 11 Sep 2019 14:07:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=XJHMobu+BW8e+V93RysuqAgvySnrHLkRIzv4bFfI7f4=; b=rLaITkTegfgDMi+pB/j2GYgfbd6BDMH+O8pwlAubC6Z5n5kBe90cnyi48On+jQNA9m baSrbYQ59tXUdZLYPMx3QGsc/mNPgpai5FUjX2j4kJNpm01e2LBSRiiMCVycweKWx29F n2QZ7KQZPwv5UqS+w6i5mDg7DGJmRcULePrDjgC+78lhrCqZq6dMTxvqH1oui/kEYQPM reYg7Ub6C0ts0aefaw+ybSvD4KteJ5fluoZHKnSzOCzb4HXsFcDAn8swltoqO4hMwSLN tq+MfJQ0P8ajLboT7nYDwDWBR7DkiGnrhlLPoxQHgCIkKf6YdD/uAoJTUpoR71KYDK1a IFIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=XJHMobu+BW8e+V93RysuqAgvySnrHLkRIzv4bFfI7f4=; b=YosD9GHXRULmkARZ2gxkY8pScPqhah+LZFysPIwA5ESSIlsXubdggz/1XmKBScpxN7 8dPvJNsfHQe1yR14FtAiSsiquJcWy7am0GSLo818PNJlQsYH2HthAHpxu5gYL2+x+HKR Sk4/fEzud1VhPyboo/pCC4aY69U+KkpYIrlKaBELTrk8IiaMjicpAYWovWpL+wrnxGXq fE2PlsO8wzNS4Wg2nH7ahiYwQaHhKAnL78YqY5HsGQD8ZKJJWT/QxaxtWB8lxmcgDMQB jKWHtZkb4Ac2aCerfk7sO4gEvoT2O1TqqtnhLD1vDeBuYhW4dUZim2J+hLFJrfFxdOqt Zbqg== X-Gm-Message-State: APjAAAUBcTm3fA/V+xEzoEhUZrU4FvYnZG90HEtueD0UidZ0jfL121oE kk9FbJ+/oSnFmXoxsm8j9EvwiKqSymFqQtUqUzQcbw== X-Received: by 2002:a67:6d06:: with SMTP id i6mr21756050vsc.5.1568236069615; Wed, 11 Sep 2019 14:07:49 -0700 (PDT) MIME-Version: 1.0 References: <20190909223236.157099-1-samitolvanen@google.com> <4f4136f5-db54-f541-2843-ccb35be25ab4@fb.com> <20190910172253.GA164966@google.com> <87impzt4pu.fsf@toke.dk> In-Reply-To: <87impzt4pu.fsf@toke.dk> From: Sami Tolvanen Date: Wed, 11 Sep 2019 14:07:38 -0700 Message-ID: Subject: Re: [PATCH] bpf: validate bpf_func when BPF_JIT is enabled To: =?UTF-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= Cc: =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Yonghong Song , Alexei Starovoitov , Daniel Borkmann , Kees Cook , Martin Lau , Song Liu , "netdev@vger.kernel.org" , "bpf@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Jesper Dangaard Brouer Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 11, 2019 at 5:09 AM Toke H=C3=B8iland-J=C3=B8rgensen wrote: > > Bj=C3=B6rn T=C3=B6pel writes: > > I ran the "xdp_rxq_info" sample with and without Sami's patch: > > Thanks for doing this! Yes, thanks for testing this Bj=C3=B6rn! > Or (1/22998700 - 1/23923874) * 10**9 =3D=3D 1.7 nanoseconds of overhead. > > I guess that is not *too* bad; but it's still chipping away at > performance; anything we could do to lower the overhead? The check is already rather minimal, but I could move this to a static inline function to help ensure the compiler doesn't generate an additional function call for this. I'm also fine with gating this behind a separate config option, but I'm not sure if that's worth it. Any thoughts? Sami