Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp8309696rwp; Wed, 19 Jul 2023 08:07:22 -0700 (PDT) X-Google-Smtp-Source: APBJJlHaBOMowBopim/G2THeKHJkkhf5c3crTpshCOAM8SxnuY+7/YyRy6YvOBpX8K46OlfIHZ6O X-Received: by 2002:a05:6a20:7da9:b0:133:f0a8:fb60 with SMTP id v41-20020a056a207da900b00133f0a8fb60mr14335981pzj.15.1689779242256; Wed, 19 Jul 2023 08:07:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689779242; cv=none; d=google.com; s=arc-20160816; b=jumvEDmzqJWgdosgZi757ude136DOLuHXhxA4VnZ3jK+KWJuhtZRv0Ep9Ajqc9M32Z tj60exJTjl2PaneIagZe9O47BD6z1fAwgy2Zj8uo7Q/3JSS49sC9lZ/UUlp4ocFUrhFM pMc22joLncrw/mAM7Eqmx43YllTprCTyGBA8lp7zZxvXDPvgc3YBg6yahM1pKizz25nN MWgOlF8+hko8PDeZY2gEddWkJY0YcSBVOQMicQj2+wcYSlEmGINxZysR642QIY6Gpac4 ptYEguNqdGIiKosMzd17XGuhL0cb/WPFgEzQDmA1njQHJQ1jkiGfhX53rEnCaXHgB+98 Q4WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=Kqsb0fKqXuddaGLRwkdYnwQAM8mRnY5GWRE0NyPAsTA=; fh=06ZE+wDxNVAlyPG4uHcisYDPT1UO+VjKgCB2NY4H6Lw=; b=MHYIluYXwPT66gKrUANhasfeisx2SRSNLWM3ue3E3/A2aQReVjiOJDB1VcpjcAB0lO 8ZZ/YTW9LDuq+y1rrA2/GiJIxz3yYpleAZfWmzi0UkWb2yyh2ceSaepYups3vVo+7RdD zh2KhU00h+QnaXm4g9rZ91vuP6LI5gkMVboJqzosVRfgea/JlK0JTx7+CkFhBY/D4qQX 2G2GnyCDcli73A8hpsjEkAwuuFBSIXWADpZaslmN6hgiwJXvX0lQC6R/iihvHwtJkOIP lc6wcQjD512oOlYVlMmQzeCfFkoDipGi+UaUrc+PjIgoqCT1ShGXCYE7Bxo1Abd47dPv ZuIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@iogearbox.net header.s=default2302 header.b="nhHbNdt/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=iogearbox.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t34-20020a056a0013a200b00665dfbf3b1esi3624620pfg.270.2023.07.19.08.07.08; Wed, 19 Jul 2023 08:07:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@iogearbox.net header.s=default2302 header.b="nhHbNdt/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=iogearbox.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230144AbjGSOw4 (ORCPT + 99 others); Wed, 19 Jul 2023 10:52:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229716AbjGSOwZ (ORCPT ); Wed, 19 Jul 2023 10:52:25 -0400 Received: from www62.your-server.de (www62.your-server.de [213.133.104.62]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E8BD10A; Wed, 19 Jul 2023 07:52:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=iogearbox.net; s=default2302; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=Kqsb0fKqXuddaGLRwkdYnwQAM8mRnY5GWRE0NyPAsTA=; b=nhHbNdt/DyZ/I6ng+OyngPze8D Vdv/VkVPTd2pV16U0xpAGakdfaIsi3jZviBeJPdnrKBgEMJFTE1AKrHW+U6pYBxAFfB7QESgSb2/D qLFaHVonxam59UdGHvY1No8cpGir1LoNscJj4TJ24fcHyAUbydy6cH6zX6j0sLk+yJQuoJrOg3GVl SVFzTW/YW55trd/4DvTNoMFofZJEylKruG85JoCFu7JLyWAElm6W4kafJzGn1l/4ti4sYR1yzvLx4 CQ1j5rpLoWzDGyvp9+Ozj5rYlsvs8ULGdTBHWmjgbgSF68yCmEt19j3gTOvHLam+8L811m43UlGrC bqmfsHPw==; Received: from sslproxy05.your-server.de ([78.46.172.2]) by www62.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qM8XL-000FxS-G6; Wed, 19 Jul 2023 16:52:19 +0200 Received: from [124.148.184.141] (helo=192-168-1-114.tpgi.com.au) by sslproxy05.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qM8XK-000RUH-5H; Wed, 19 Jul 2023 16:52:18 +0200 Subject: Re: [PATCH v2 1/3] bpf: Allow NULL buffers in bpf_dynptr_slice(_rw) To: Jakub Kicinski , Alexei Starovoitov Cc: Daniel Rosenberg , bpf , Alexei Starovoitov , John Fastabend , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Shuah Khan , Jonathan Corbet , Joanne Koong , Mykola Lysenko , LKML , "open list:KERNEL SELFTEST FRAMEWORK" , Android Kernel Team References: <20230502005218.3627530-1-drosen@google.com> <20230718082615.08448806@kernel.org> <20230718090632.4590bae3@kernel.org> <20230718101841.146efae0@kernel.org> <20230718111101.57b1d411@kernel.org> <20230718160612.71f09752@kernel.org> <20230718162138.24329391@kernel.org> From: Daniel Borkmann Message-ID: Date: Wed, 19 Jul 2023 16:51:51 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20230718162138.24329391@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.103.8/26974/Wed Jul 19 09:28:18 2023) X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/19/23 1:21 AM, Jakub Kicinski wrote: > On Tue, 18 Jul 2023 16:17:24 -0700 Alexei Starovoitov wrote: >> Which would encourage bnxt-like hacks. >> I don't like it tbh. >> At least skb_pointer_if_linear() has a clear meaning. >> It's more run-time overhead, since buffer__opt is checked early, >> but that's ok. > > Alright, your version fine by me, too. Thanks! Looks good to me too. Agree that the !buffer check should not live in __skb_header_pointer() and is better handled in the bpf_dynptr_slice() internals. Thanks, Daniel