Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6485980rwd; Mon, 19 Jun 2023 07:59:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7WKQxnkr6dVLWFGnATxNJ6fxydXyTY0d7Lui2YlsOVljnf6kJYjieLVe3hsPdI2ehCBatO X-Received: by 2002:a05:6808:1803:b0:39e:dbbd:aae2 with SMTP id bh3-20020a056808180300b0039edbbdaae2mr3573919oib.54.1687186799449; Mon, 19 Jun 2023 07:59:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687186799; cv=none; d=google.com; s=arc-20160816; b=vGLjIfx3j77AOwuwlPonyitGIKFVqXeF/2Xi+QiMf+K+N9yd/PabrBbalwYqICYeGS w1uEQgkuFnMEFiNiUbwudvNcHVUSWxK4ieXlvak5EdvFIEzrQIV8UO+KdSGbiESckwER qA87eozV4YprPyuj2U0CsPz8S9ZNxFJGGxH667tFUIaq/kA7mEmpX/7Ev+VsPP/U5mgd /AdDkPkp1jssrSN5P0JrdLckjS68cOCXNQaYhtwBxLsM8aRtxt0b2T45TcHXGx0D7BB0 VnON9mprbw++A5qHfOca3gJ57bX027eBo+bpWbMcvZrqvXOAWEeNhXT9X6kt12cgM1VB qpPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=c4zA2x2rf1p5pzoQJxSBuzoBeRkUzNS4Bq8HFTmaCoE=; b=aniyqAAOdGW8zmOWyLybsVuIM7gjuxU5ZSRVPp+cQb6+tcszcgvrrfgTgtm+sXoN/K oMzvAvLDVy2SCABNdayl5H/uFV9xzkr2n/E84rMI8Se6+V0hrxoke2RG9mY5XAQi5M84 VNhwoBcB/X1Aqp87gk8qastUCPnKqXHq3HM8Riz4zQ/Ut7Wc6WuPbYQx25TM2A1QkQWh Dk272Oe6Fie6NrOIFqV0on2zwRFp+0ITUXLsPWMlN1R+IkMU/m7cgij35QAc0iH53hxD sPre747lLSFzS71yoirdDrIO9GaxUqRskvBcDOsulGGHm1ptEFUP/KGNBblCk1JuyoF2 3Ndg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=b+fkLYr3; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o19-20020a656a53000000b005030925d31asi22986397pgu.203.2023.06.19.07.59.46; Mon, 19 Jun 2023 07:59:59 -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=@chromium.org header.s=google header.b=b+fkLYr3; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232101AbjFSODU (ORCPT + 99 others); Mon, 19 Jun 2023 10:03:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229886AbjFSODT (ORCPT ); Mon, 19 Jun 2023 10:03:19 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB100FB for ; Mon, 19 Jun 2023 07:03:18 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1b50d7b4aaaso13164935ad.3 for ; Mon, 19 Jun 2023 07:03:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1687183398; x=1689775398; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=c4zA2x2rf1p5pzoQJxSBuzoBeRkUzNS4Bq8HFTmaCoE=; b=b+fkLYr3MnYz/OQ9BhX6fL07uLzvPcMpQDFVDzDecktXyoL50Q3ZJxYZPSun/2NE/k KAeGe8M8bNjBkwmPAz++D+U7I948YLAmWCn1fOit3orWSOPF/RnJZYfh3GMaN9pBA8N3 3V7ScFFz8VQoikvuMgU/IicArKbCOUt6tCa2c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687183398; x=1689775398; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=c4zA2x2rf1p5pzoQJxSBuzoBeRkUzNS4Bq8HFTmaCoE=; b=abu0Q0kvrhk/MfOdWA9Hn2RIuFEYMc5eDQ6Zg/nFiLsXhIcBg197igNo/rmSvgq59+ PeFvRMLgbHyCBwUbHvimsMfakVaUmE/+b99q/begpewruaDbhbG8MdYvKGC0wD6pSDwU wpieT9/5Kuc7d9jxI+v2V4BGnrOIu4Cyad/80iZWRbroRwHj5E6wBpxaTSY9tF7FdW6e 7q5AAtmgPAWHVA2JIFmcMY1TyY092YP28OmdEdyyqXW0JVUpinJQnGpvbTMcb6sa35TN R+TYFK9VJgmJvJpCNmELphbDjgtfBBA2VV1Ewvx+m5YHgjYMvYO1dZ/09TNA6aztWHKq zoVw== X-Gm-Message-State: AC+VfDytN8DFQbQll5x82vVse6bXt2KwpVhd72pe0S9IwdbdrdqcC0NW 9H86T0ha33JYpP5r84KaDaYa2WdmJNTc5+zLKIWFJQ== X-Received: by 2002:a17:903:1112:b0:1af:a293:e155 with SMTP id n18-20020a170903111200b001afa293e155mr6269262plh.16.1687183398115; Mon, 19 Jun 2023 07:03:18 -0700 (PDT) MIME-Version: 1.0 References: <20230615145607.3469985-1-revest@chromium.org> In-Reply-To: From: Florent Revest Date: Mon, 19 Jun 2023 16:03:07 +0200 Message-ID: Subject: Re: [PATCH bpf] bpf/btf: Accept function names that contain dots To: Andrii Nakryiko Cc: bpf@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, martin.lau@linux.dev, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, song@kernel.org, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, nathan@kernel.org, ndesaulniers@google.com, trix@redhat.com, stable@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Fri, Jun 16, 2023 at 6:57=E2=80=AFPM Andrii Nakryiko wrote: > > On Thu, Jun 15, 2023 at 7:56=E2=80=AFAM Florent Revest wrote: > > > > When building a kernel with LLVM=3D1, LLVM_IAS=3D0 and CONFIG_KASAN=3Dy= , LLVM > > leaves DWARF tags for the "asan.module_ctor" & co symbols. In turn, > > pahole creates BTF_KIND_FUNC entries for these and this makes the BTF > > metadata validation fail because they contain a dot. > > > > In a dramatic turn of event, this BTF verification failure can cause > > the netfilter_bpf initialization to fail, causing netfilter_core to > > free the netfilter_helper hashmap and netfilter_ftp to trigger a > > use-after-free. The risk of u-a-f in netfilter will be addressed > > separately but the existence of "asan.module_ctor" debug info under som= e > > build conditions sounds like a good enough reason to accept functions > > that contain dots in BTF. > > I don't see much harm in allowing dots. There are also all those .isra > and other modifications to functions that we currently don't have in > BTF, but with the discussions about recording function addrs we might > eventually have those as well. So: > > Acked-by: Andrii Nakryiko Thanks Andrii! :) > > Cc: stable@vger.kernel.org > > Fixes: 1dc92851849c ("bpf: kernel side support for BTF Var and DataSec"= ) So do you think these trailers should be kept ? I suppose we can either see this as a "new feature" to accommodate .isra that should go through bpf-next or as a bug fix that goes through bpf and gets backported to stable (without this, BTF wouldn't work on old kernels built under a new clang and with LLVM_IAS=3D0 and CONFIG_KASAN=3Dy so this sounds like a legitimate bug fix to me, I just wanted to double check)