From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 972A3C04AA7 for ; Mon, 13 May 2019 23:05:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 62BB020879 for ; Mon, 13 May 2019 23:05:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=fomichev-me.20150623.gappssmtp.com header.i=@fomichev-me.20150623.gappssmtp.com header.b="R/2KTcWR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726412AbfEMXFQ (ORCPT ); Mon, 13 May 2019 19:05:16 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:42014 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726319AbfEMXFP (ORCPT ); Mon, 13 May 2019 19:05:15 -0400 Received: by mail-pf1-f195.google.com with SMTP id 13so7994922pfw.9 for ; Mon, 13 May 2019 16:05:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fomichev-me.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ClSQw8ycEIIMQiIBxg9FdUvY7G6QgeWAD+x2eOpvAXA=; b=R/2KTcWRwnIXYNDjiLDd3shxRbS8G0DBxdB8Qy8s95MKg1RMJODSLnUFDLhXBcmQ5z Nof4ATB84T/kUJ3rueMamQKZgIANiCKUfyrjz31P3MUR0NyLvt0omozmFxri3vszkCQc akEuDePzDv+ohxb8RO9bwRxiBELiWj21/WWVRAKJQEnF4zYK4V4fou6LfEQx5t8oVi3L uers4z+kM1973r6ObZlzzENAU8fnsbyUmQncDUwn31qkBKGr6BbI4S0WsEQCz04c+6M+ qAEyVcRM8R4r0w80JuCS57f5r/nbpLY2UQzVnY6qKu7zuDgyaX8z6mqFX1mJTk0OxgLe mXgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ClSQw8ycEIIMQiIBxg9FdUvY7G6QgeWAD+x2eOpvAXA=; b=UuiClN1uMzRye5mABG9xYBM+t/Gk5k/qW2uvdd3J4fbzmHg+U/3u3g9h+5w8ZKikAU pm/dWx4r22pqPvYpyrTBEqBLmaJ4amglRVTEEsf10xI3noxjByRYg81iYuk+mHNFxZQt pFjY9Nxz9fPLhC49rPGelbpitYcElNH55sXX1ckUSlcp3/gwG83zYXZLlDABUHNcbKeP uXmrTJk5vNZPleiiTq4QY6xeLt/KYnlQagdYr2WYfkpnOaOUmn5OxbNbS5mza4lTUbpZ aV4SgeXRPnjK/NAHQhyxzGahMjdnSaoLXJcr87yBMGtVaE4xs5UOg6RRnfp/y3Ccy08e vgpA== X-Gm-Message-State: APjAAAUrjY1orWOZ5KuU/JEUCMTM4ibcKET8MDBLUO61tGtVUUPTH3a8 G9mAhiO3riJuNhuJFubusE1zng== X-Google-Smtp-Source: APXvYqy1YmyEWgT2uzXvu2WwT5J6UaGme+PcUzptgCYmTHmO9565PrR7j4LrYxY49rsNY3DVbG0N8w== X-Received: by 2002:a63:fd0c:: with SMTP id d12mr34983924pgh.391.1557788714740; Mon, 13 May 2019 16:05:14 -0700 (PDT) Received: from localhost ([2601:646:8f00:18d9:d0fa:7a4b:764f:de48]) by smtp.gmail.com with ESMTPSA id d85sm3556653pfd.94.2019.05.13.16.05.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 May 2019 16:05:14 -0700 (PDT) Date: Mon, 13 May 2019 16:05:13 -0700 From: Stanislav Fomichev To: Willem de Bruijn Cc: Stanislav Fomichev , Network Development , bpf , David Miller , Alexei Starovoitov , Daniel Borkmann , Willem de Bruijn , Petar Penkov Subject: Re: [PATCH bpf 1/2] flow_dissector: support FLOW_DISSECTOR_KEY_ETH_ADDRS with BPF Message-ID: <20190513230513.GA10244@mini-arch> References: <20190513185402.220122-1-sdf@google.com> <20190513210239.GC24057@mini-arch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On 05/13, Willem de Bruijn wrote: > On Mon, May 13, 2019 at 5:21 PM Willem de Bruijn > wrote: > > > > On Mon, May 13, 2019 at 5:02 PM Stanislav Fomichev wrote: > > > > > > On 05/13, Willem de Bruijn wrote: > > > > On Mon, May 13, 2019 at 3:53 PM Stanislav Fomichev wrote: > > > > > > > > > > If we have a flow dissector BPF program attached to the namespace, > > > > > FLOW_DISSECTOR_KEY_ETH_ADDRS won't trigger because we exit early. > > > > > > > > I suppose that this is true for a variety of keys? For instance, also > > > > FLOW_DISSECTOR_KEY_IPV4_ADDRS. > > > > > I though the intent was to support most of the basic stuff (eth/ip/tcp/udp) > > > without any esoteric protocols. > > > > Indeed. But this applies both to protocols and the feature set. Both > > are more limited. > > > > > Not sure about FLOW_DISSECTOR_KEY_IPV4_ADDRS, > > > looks like we support that (except FLOW_DISSECTOR_KEY_TIPC part). > > > > Ah, I chose a bad example then. > > > > > > We originally intended BPF flow dissection for all paths except > > > > tc_flower. As that catches all the vulnerable cases on the ingress > > > > path on the one hand and it is infeasible to support all the > > > > flower features, now and future. I think that is the real fix. > > > > > Sorry, didn't get what you meant by the real fix. > > > Don't care about tc_flower? Just support a minimal set of features > > > needed by selftests? > > > > I do mean exclude BPF flow dissector (only) for tc_flower, as we > > cannot guarantee that the BPF program can fully implement the > > requested feature. > > Though, the user inserting the BPF flow dissector is the same as the > user inserting the flower program, the (per netns) admin. So arguably > is aware of the constraints incurred by BPF flow dissection. And else > can still detect when a feature is not supported from the (lack of) > output, as in this case of Ethernet address. I don't think we want to > mix BPF and non-BPF flow dissection though. That subverts the safety > argument of switching to BPF for flow dissection. Yes, we cannot completely avoid tc_flower because we use it to do the end-to-end testing. That's why I was trying to make sure "basic" stuff works (it might feel confusing that tc_flower {src,dst}_mac stop working with a bpf program installed). TBH, I'd not call this particular piece of code that exports src/dst addresses a dissection. At this point, it's a well-formed skb with a proper l2 header and we just copy the addresses out. It's probably part of the reason the original patch didn't include any skb->protocol checks.