Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1435151rwr; Thu, 27 Apr 2023 18:23:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5nImedipFPKQVXwhY+Zf6BFcvoWoX2eD/jdNAu9EpEnjpqfRCfsY/lOZsP+ovwPxXJMbps X-Received: by 2002:a17:90b:90b:b0:246:aeee:e61c with SMTP id bo11-20020a17090b090b00b00246aeeee61cmr4699200pjb.11.1682645032177; Thu, 27 Apr 2023 18:23:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1682645032; cv=pass; d=google.com; s=arc-20160816; b=fkLBAtxOF/OJDNqV3mr/gbQXwQiNlQVLGajR2+eTTBtL+blU3uPrBE6YWHpsR5UV2J EBi67L/LiBDBNRHW/wrBA+sg5c0RwplkxvB5oU14g0qAkGoFCpz7tSokTKaA7u+NLQmi 87h16B2NqPNKCRKsrQdct9dp/fXbPs1tMwz7DL02NcuysZfmMnDVAlSa7AT1kz88qDPC rUaBoXgD4XaIkXRQFu1/mQ30L0CQBR+LVtCXIzfSdmnAmPWLFR8JQWSnBwCaM/MxADjX rNZ6h1/P0P305Fn7GfjBcZ7mIbcdG7NBQrcawrGgqxH/lK00HrjOQ1HJozorng69nn+/ doIg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=b+IL6lki3t07t+VRGNFFC2DRyZWTeBGI3jrGva87ies=; b=B8qci6Y/92A3P0ng2AdOeHJa90hG/Kqnjs3E7dhPWTaegSgoXpO1plUdRYzY2J/r6O fw8O/N1FYxEvDi7He51QG1ZXmcUCiS+WWSI0ctG/mIdMljk7vV64/e/n0SHjKhsiJyqR qB/xEvwSGyygn51GN3rcQKRlQkLFWfpat7iFr9HtGXqpJAScwRolFbAGXMVhoo66+o5n efE/77L/t8N1hwujAgtO5F/8Ja5DVh8oeWIRHkMgBBkrdM7UJutmXWji6EoB/N8ymjeS Zy9NApKuLP4JywsJ4x0mtvJpN4F/mMEQ3gAgp2lD4bdIRzlDN4tFgGVCQZyEhJtPeGjs JMpQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@meta.com header.s=s2048-2021-q4 header.b=TS9ob6gu; arc=pass (i=1 spf=pass spfdomain=meta.com dkim=pass dkdomain=meta.com dmarc=pass fromdomain=meta.com); 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=REJECT dis=NONE) header.from=meta.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i71-20020a63874a000000b005250c0685f1si13784163pge.506.2023.04.27.18.23.40; Thu, 27 Apr 2023 18:23:52 -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=@meta.com header.s=s2048-2021-q4 header.b=TS9ob6gu; arc=pass (i=1 spf=pass spfdomain=meta.com dkim=pass dkdomain=meta.com dmarc=pass fromdomain=meta.com); 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=REJECT dis=NONE) header.from=meta.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344722AbjD1BUU (ORCPT + 99 others); Thu, 27 Apr 2023 21:20:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344665AbjD1BUS (ORCPT ); Thu, 27 Apr 2023 21:20:18 -0400 Received: from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com [67.231.145.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5836B212C; Thu, 27 Apr 2023 18:20:17 -0700 (PDT) Received: from pps.filterd (m0109333.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33S01Gt1031786; Thu, 27 Apr 2023 18:19:37 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=meta.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=s2048-2021-q4; bh=b+IL6lki3t07t+VRGNFFC2DRyZWTeBGI3jrGva87ies=; b=TS9ob6gulyBMO1DITs27lUKwlqQjEBrI6Sfb0/11eW26uzDCXbEdO5ZTRCaGe++G/muo jNjdSbPbY5T6KKrHW21iLEQ7STN/a9TCpYoKh8ksSlmMbWSkgmHPW4g1hjVvEEQhUwEc SFs2peuEelQAd33LZs0/EvFjJq+0JbO9jlekM8OPIm+2ePFVY3OO2OuCbZe3GZePaI6M E5o6PQSGXqOMOKFwFm05qdrcT7jCM6ol84Bd/e0K+PD8k0O5EBZUEu4ihRMV9KTFGG7L F8JaGtl+o6Alh8GfZtY7vzjqUZ7UX+QRa43ugKjqggJ4x0mvSwn0x/bkhZ+1hUCt4ZV8 yQ== Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2043.outbound.protection.outlook.com [104.47.66.43]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3q837ugbje-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 Apr 2023 18:19:36 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AilQBcHjZbtVqHiRlqH+Yv/nqRe9J2sW82pIDZat7MUu+Cxj0MTuroMYEk/Ws7ekpdlAqsmvmPH4s1SJsnqtzUI5crdqYtc8trnK1aSwd06IC97yyEJIA+8zIAZoIGOxPkHfjghJxWL29B/wri1btrc4m5T6Fz+2YpuX8jsZCK4ey/GzKX6KusdrgoQT7Dln7dMfQdd2v6hRt1ofQveOGBVaWgL1zyDS0Bi/P28dLurV/tLFs4+dyVDuCieOBpDv16kRJavnmRn1mMiBRyRZwAVADZNzjrvClK2EDg4hyk6nG8wQslg5BZdM8L1ioe6Hcx4LQWIl2Uy2RTzgLr5hlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=b+IL6lki3t07t+VRGNFFC2DRyZWTeBGI3jrGva87ies=; b=UIeCJFOokxGBzplFSHT9/tGO+39Gvslh9LL5SHrTjQIchdzlJlJExi7NFUPbyMeDDyADwNJmcziGsqxOKyhnnC9rnRXbIRXROdEGObw9lupTisvIbY3q6MmasNx+ad1lsivILwm2+kv3v432GVLYvMb0jMkKnFLnm6rFHL2TDZR1hmG6O8SNNtYqGkas2tOlsH2jd4GmHacDqzwpGZ7lTnAUQWRmWJvL7RYjEISnlCmVlW+qUmPRGytw8mceQyzll1w9KPu/vj8suuBkHmnDH5xQyamLaJ4Ggh7z86DwCDci8RV8xjfQw94bjOTvhm1EQEUaDoqtFQ67yDCN04OeTQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=meta.com; dmarc=pass action=none header.from=meta.com; dkim=pass header.d=meta.com; arc=none Received: from SN6PR1501MB2064.namprd15.prod.outlook.com (2603:10b6:805:d::27) by BLAPR15MB3828.namprd15.prod.outlook.com (2603:10b6:208:27d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.22; Fri, 28 Apr 2023 01:19:34 +0000 Received: from SN6PR1501MB2064.namprd15.prod.outlook.com ([fe80::589f:9230:518:7f53]) by SN6PR1501MB2064.namprd15.prod.outlook.com ([fe80::589f:9230:518:7f53%6]) with mapi id 15.20.6340.022; Fri, 28 Apr 2023 01:19:34 +0000 Message-ID: <0e7b884a-05c3-83c7-0de1-9bfe14ff77b3@meta.com> Date: Thu, 27 Apr 2023 18:19:29 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v2] libbpf: Improve version handling when attaching uprobe Content-Language: en-US To: Espen Grindhaug Cc: Andrii Nakryiko , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Mykola Lysenko , Shuah Khan , bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org References: <07e05c57-feb7-5482-9c07-eb41f976f9fd@meta.com> From: Yonghong Song In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SJ0PR03CA0156.namprd03.prod.outlook.com (2603:10b6:a03:338::11) To SN6PR1501MB2064.namprd15.prod.outlook.com (2603:10b6:805:d::27) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR1501MB2064:EE_|BLAPR15MB3828:EE_ X-MS-Office365-Filtering-Correlation-Id: ed135a75-14f3-4fb8-bd19-08db4786a012 X-FB-Source: Internal X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WtyCQTs8neUKjFmuoGHOrcVG17tMCrFDPKFxo6VpgY3sY+SYgvn2qQ55uBCbOvD4CgUO3Hkk1A1VErkQVwiAyQR0rRfZZw5g1+MF77BzrSCFeWMpPnrxVX27lgd/PXw6W9gien8TYOxufTd3R3WkvVhbuABxE+/G8PaUivJOsVMx6dpXkwWCafIZB898Aw0u7Ra/PnA34QZKP2Vi0QshMD1RilM+CRgB3QgQOc033m4ODokTa6CGaUms4rSZ0FDXCxyIfaclyIUi3szlUGSW3q2F0wDp23geYyrNr4h+PVbwXkiGrYcLjvxQrnciWkSgt8sNNuVhuUj0KPGIV5GNvh8P27lLFVW2ufF5cwpx9Ygqp3rVTKP83CLHh6CyNPMFezpk/+VuPCAuMfhBChbGKMW6Zm4AZfiFv/Q32seYjLTdurGu8xBBHfqg19gb0O19rEChD70/0EB1H6CKNZLmYjsy6oAioVmQy7glsrHoCgRmFVXy8V3YCPKhHLa+0f/Sc7IPrbMJIbtKsLVk/QHboC3HR88Bwd+L/PQqGJpb+ovM5xAqZAQ6tWrmG0/N2xu42w0ohQQJpLOfOKJetixaVIc/CBNPuhZLDW9e2Ao8H8IulkBeHXytonhIUrKe8LBTqoLoPTHYXLA1c1MEmLbCVQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR1501MB2064.namprd15.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(396003)(366004)(346002)(136003)(39860400002)(451199021)(31686004)(2616005)(36756003)(41300700001)(38100700002)(7416002)(2906002)(316002)(8676002)(86362001)(8936002)(31696002)(5660300002)(66476007)(66556008)(4326008)(66946007)(6916009)(83380400001)(186003)(54906003)(6512007)(6506007)(53546011)(6666004)(478600001)(6486002)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MVdWQ3NvZFEzbjZ4Y2l1WGo4cG1DQXA0eXRLUnRnVDdRVWdWTWwraE9CSm1m?= =?utf-8?B?TUVrbjdDUFRFeWcvV1Rjekd3eklNVkpSZzBlSlJYTUhDQVdNT2gzbWhxNUxS?= =?utf-8?B?aFY3dnZUNUFxWXhGUTAwRkdjL0tOYnk5dUxm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Bz?= =?utf-8?B?eVN4NVBEM2drWEhwcTBsOXpHNkNCZHQxdFFCYVpEWlZHWGZBeFJpQWhiQ2hB?= =?utf-8?B?eFJNMTltR1Radk0zNXNJdzdaamdQUXd5elN1NzlNVStyWmR6VDFjbzRjbHZs?= =?utf-8?B?Q0V4OUVsaXc5UWJpVmVCNGdFZGpheVlEOC9WeE1ZTWxyeW00U3dSNWxkaTIy?= =?utf-8?B?YUdlL2xYWHpJMkxlVFRwazJyM2FPNHBFQm4wVGcxVkh3blBVcmFlR0NROTVM?= =?utf-8?B?N2c9PQ==?= X-OriginatorOrg: meta.com X-MS-Exchange-CrossTenant-Network-Message-Id: ed135a75-14f3-4fb8-bd19-08db4786a012 X-MS-Exchange-CrossTenant-AuthSource: SN6PR1501MB2064.namprd15.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Apr 2023 01:19:34.1558 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: YGzqQOcDH7rQb4f98ExdhAUCQM/mhMVbb4c2CAlfa3RKXseWW9r7tbiLTkRUaTkO X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR15MB3828 X-Proofpoint-GUID: Y0AyB57-Hrj1c0Ei0AQ0Li_tajhdzrLH X-Proofpoint-ORIG-GUID: Y0AyB57-Hrj1c0Ei0AQ0Li_tajhdzrLH X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-27_09,2023-04-27_01,2023-02-09_01 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 4/27/23 12:19 PM, Espen Grindhaug wrote: > On Wed, Apr 26, 2023 at 02:47:27PM -0700, Yonghong Song wrote: >> >> >> On 4/23/23 11:55 AM, Espen Grindhaug wrote: >>> This change fixes the handling of versions in elf_find_func_offset. >>> In the previous implementation, we incorrectly assumed that the >> >> Could you give more explanation/example in the commit message >> what does 'incorrectly' mean here? In which situations the >> current libbpf implementation will not be correct? >> > > How about something like this? > > > libbpf: Improve version handling when attaching uprobe > > This change fixes the handling of versions in elf_find_func_offset. > > For example, let's assume we are trying to attach an uprobe to pthread_create in > glibc. Prior to this commit, it would fail with an error message saying 'elf: > ambiguous match [...]', this is because there are two entries in the symbol > table with that name. > > $ nm -D /lib/x86_64-linux-gnu/libc.so.6 | grep pthread_create > 0000000000094cc0 T pthread_create@GLIBC_2.2.5 > 0000000000094cc0 T pthread_create@@GLIBC_2.34 > > So we go ahead and modify our code to attach to 'pthread_create@@GLIBC_2.34', > and this also fails, but this time with the error 'elf: failed to find symbol > [...]'. This fails because we incorrectly assumed that the version information > would be present in the string found in the string table, but there is only the > string 'pthread_create'. I tried one example with my centos8 libpthread library. $ llvm-readelf -s /lib64/libc-2.28.so | grep pthread_cond_signal 39: 0000000000095f70 43 FUNC GLOBAL DEFAULT 14 pthread_cond_signal@@GLIBC_2.3.2 40: 0000000000096250 43 FUNC GLOBAL DEFAULT 14 pthread_cond_signal@GLIBC_2.2.5 3160: 0000000000096250 43 FUNC LOCAL DEFAULT 14 __pthread_cond_signal_2_0 3589: 0000000000095f70 43 FUNC LOCAL DEFAULT 14 __pthread_cond_signal 5522: 0000000000095f70 43 FUNC GLOBAL DEFAULT 14 pthread_cond_signal@@GLIBC_2.3.2 5545: 0000000000096250 43 FUNC GLOBAL DEFAULT 14 pthread_cond_signal@GLIBC_2.2.5 $ nm -D /lib64/libc-2.28.so | grep pthread_cond_signal 0000000000095f70 T pthread_cond_signal@@GLIBC_2.3.2 0000000000096250 T pthread_cond_signal@GLIBC_2.2.5 $ Note that two pthread_cond_signal functions have different addresses, which is expected as they implemented for different versions. But in your case, > $ nm -D /lib/x86_64-linux-gnu/libc.so.6 | grep pthread_create > 0000000000094cc0 T pthread_create@GLIBC_2.2.5 > 0000000000094cc0 T pthread_create@@GLIBC_2.34 Two functions have the same address which is very weird and I suspect some issues here at least needs some investigation. Second, for the symbol table, the following is ELF encoding, typedef struct { Elf64_Word st_name; unsigned char st_info; unsigned char st_other; Elf64_Half st_shndx; Elf64_Addr st_value; Elf64_Xword st_size; } Elf64_Sym; where st_name An index into the object file's symbol string table, which holds the character representations of the symbol names. If the value is nonzero, the value represents a string table index that gives the symbol name. Otherwise, the symbol table entry has no name. So, the function name (including @..., @@...) should be in string table which is the same for the above two pthread_cond_signal symbols. I think it is worthwhile to debug why in your situation pthread_create@GLIBC_2.2.5 and pthread_create@@GLIBC_2.34 do not have them in the string table. > > This patch reworks how we compare the symbol name provided by the user if it is > qualified with a version (using @ or @@). We now look up the correct version > string in the version symbol table before constructing the full name, as also > done above by nm, before comparing. > >>> version information would be present in the string found in the >>> string table. >>> >>> We now look up the correct version string in the version symbol >>> table before constructing the full name and then comparing. >>> >>> This patch adds support for both name@version and name@@version to >>> match output of the various elf parsers. >>> >>> Signed-off-by: Espen Grindhaug >> >> [...]