Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1436485rwd; Thu, 15 Jun 2023 10:27:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6yZgJkgFyBkHvIcAR8qll9ZckhsnV0t/rO9E1R6m6OjT9edrun5mQqr4D3gWBqXChNKuP5 X-Received: by 2002:a05:6a21:3993:b0:10b:8e96:561 with SMTP id ad19-20020a056a21399300b0010b8e960561mr4545223pzc.62.1686850068303; Thu, 15 Jun 2023 10:27:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686850068; cv=none; d=google.com; s=arc-20160816; b=pZ/8UODmd0fU1KJbC1ejWh71FhAj/yHMSMmJZiK9AwqpPhEnp1TKUSag3N3bSOhCYS ESXKF526BxfYNRbT7ojBtmoPbh6DX8blblhvB1gtYspRcG9C7qe6AL3gXJ8ucY+YAFxs o19VPKsHAaE7NiGWEwISIB3SFGAUq1rVkiDA/8o2MTyxRC6Dp1/R9am+IbSfaIGu1k4w bxNBAlHhFxLjN1bvNGEPQL7Yh30j4kTYjPRUxGbjpS0gihhaZpQAlfsiXMrQwd/ymT4+ vxKj3GjvqBS3klDygQYRSZoSkj3CH/6/sfq+Sjv36YQDjpArgPTroM18UgfuQBNVYTDL FXpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=crBt2ITg8SZ2kjr+v53DzcSzxyBX77tw0/FzCIW8K/M=; b=OoWMkQx/lo/tHjCw4SM125e6Xh27kffhYYzAiTwJlKcZB/TViLr95GvUBLIo19wBad +D/4OG8v2O3H7IYhoAKZuTR6L4kWWYA2TA4Yq+PAQixYBqhG1VRwWLnvF8JA4HFRq4fp FEKHZ3z2vbN3uZdgMOuMHQ+re7NeU9v8LsI05Eh+T+e6+NM1rXPoYyBZuEKs67BBFKzz sR5884iWI8p7mRBVzzMSK2/+0+cmurYvELUt0G4GDKGxCpYt5g4p+jMFHlZ7CWplncOK j4v+m4HKffY3N3HkYmL9fytcATdnGytJIfxfYQEs3buaolhL7D01WhRPYr2QHE4h3EPv tA9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=DUuKjGKk; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c5-20020a6566c5000000b0053ef158b0c2si5586527pgw.185.2023.06.15.10.27.33; Thu, 15 Jun 2023 10:27:48 -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=@gmail.com header.s=20221208 header.b=DUuKjGKk; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236010AbjFORFT (ORCPT + 99 others); Thu, 15 Jun 2023 13:05:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232502AbjFORFR (ORCPT ); Thu, 15 Jun 2023 13:05:17 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97A75194; Thu, 15 Jun 2023 10:05:16 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2b443ebae0dso16163461fa.2; Thu, 15 Jun 2023 10:05:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686848715; x=1689440715; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=crBt2ITg8SZ2kjr+v53DzcSzxyBX77tw0/FzCIW8K/M=; b=DUuKjGKkLd3xr6fw7ISZK9UObyf9IKsH9P5OAMVKBBFO2p+gWILzdkAlmpX9qvis6c rNIKx3JtA3BKucyQwwzgvgLT/405EdgBeNp5o+KsahwdLKpFFRk9rdnmg7z7SHJOZPzK YLn4jzrY3rv65y71YS5w+xMd3K7068Y2Ui+ewyGSM6j7z0BXzwe5aXPLS7TmDcO+Qqzg u3bCkITTMBXCH1+h/MQ7hxPK1TxyNbFO/XRceINXXj2lvq5Cvd0+DfnTBuN35QDj6r2X eopRfgU6pF4o7AAyjP/vnsM63+YkWAp33Gis/C6he4BMsfBKr714P9vuRcc0m1IPGn+S u2Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686848715; x=1689440715; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=crBt2ITg8SZ2kjr+v53DzcSzxyBX77tw0/FzCIW8K/M=; b=ikk9cwurbU7oeMZYoclSWrh2//W79KeWqHQwGqJsGH/kBa/XraXxiV9P/5AYnu98fB Nd6IJOmGeH/n4fwZB+v8gUA23Z4080V/d4jwCAROIJB/en6tKoduNVnFT/L8Iw9J5XJt COINcN5efdFy3nSCOiA37aODQPngNpTHPdZs0px9BmxBwHeYMJy7gTLSiyHTMXWBuuG8 E93MoEYt6Cq8lljQDl3+VW+g1EK5K2P5QVjBqBLC1sWT2ugjzSFEY8e/TEXaNqVkbGr+ r9ZQDrKt32VLiLgJa0ap096vKBhn0wF/fuoS4Ne4sRYlKrv4ixQR/HaMldHJbtzmuFXR 3kRA== X-Gm-Message-State: AC+VfDy6hnecGDlgPqjNSuBFN25HxxkonSkhOphWGsC/wdjLR7m7pXIs 9zfTh1ueL7jj+T4XBzNLShepUT8WLK5org== X-Received: by 2002:a2e:a175:0:b0:2b3:47b3:3c39 with SMTP id u21-20020a2ea175000000b002b347b33c39mr49134ljl.23.1686848714423; Thu, 15 Jun 2023 10:05:14 -0700 (PDT) Received: from [192.168.1.95] (host-176-36-0-241.b024.la.net.ua. [176.36.0.241]) by smtp.gmail.com with ESMTPSA id z27-20020a05651c023b00b002adc6c2cb3bsm3195205ljn.5.2023.06.15.10.05.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jun 2023 10:05:13 -0700 (PDT) Message-ID: Subject: Re: [PATCH bpf] bpf/btf: Accept function names that contain dots From: Eduard Zingerman To: Florent Revest , bpf@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Cc: 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 Date: Thu, 15 Jun 2023 20:05:11 +0300 In-Reply-To: References: <20230615145607.3469985-1-revest@chromium.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,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 Thu, 2023-06-15 at 17:44 +0200, Florent Revest wrote: > On Thu, Jun 15, 2023 at 4:56=E2=80=AFPM Florent Revest wrote: > >=20 > > 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. >=20 > To be fair I can't tell if this is an LLVM bug. It's sort of curious > that with LLVM_IAS=3D1, these debugging symbols are not kept and they > are with LLVM_IAS=3D0 but I don't know what the expected behavior should > be and how BTF should deal with it. I'll let people with more context > comment on this! :) >=20 > An easy reproducer is: >=20 > $ touch pwet.c >=20 > $ clang -g -fsanitize=3Dkernel-address -c -o pwet.o pwet.c > $ llvm-dwarfdump pwet.o | grep module_ctor >=20 > $ clang -fno-integrated-as -g -fsanitize=3Dkernel-address -c -o pwet.o pw= et.c > $ llvm-dwarfdump pwet.o | grep module_ctor > DW_AT_name ("asan.module_ctor") Interestingly, I am unable to reproduce it using either clang version 14.0.0-1ubuntu1 or clang main (bd66f4b1da30). >=20 > > 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 >=20 > To be precise, I meant "netfilter conntrack". >=20 > I sent the following patch as a more targeted mitigation for the uaf > https://lore.kernel.org/netfilter-devel/20230615152918.3484699-1-revest@c= hromium.org/T/#u >=20