From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) by sourceware.org (Postfix) with ESMTPS id 50FD3385703C for ; Wed, 3 Mar 2021 07:15:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 50FD3385703C Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Tue, 02 Mar 2021 23:15:28 -0800 Received: from HKMAIL102.nvidia.com (10.18.16.11) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 3 Mar 2021 07:15:27 +0000 Received: from HKMAIL103.nvidia.com (10.18.16.12) by HKMAIL102.nvidia.com (10.18.16.11) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 3 Mar 2021 07:15:25 +0000 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.176) by HKMAIL103.nvidia.com (10.18.16.12) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Wed, 3 Mar 2021 07:15:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WybKPG+9fYmET2BehM/trSjk1jw7MVz3Xiv/S56Bcb42mZG1cg0kY/0fKPqOlVZyDRbmUA21qxnpNkWsZuJdymrR46v/H6R6diwj6Bdfzqi3XHP5/vn77Hg1kKEpyXsgv4kQ9vwXMjC/ALmqXgBHKVa4DG560yCwpzvl9UImRpOkfUzMwwaZaaq11c+XpMD+0/6IUtImcQH/qVQD7Jt+7Y20t3YOyoP0oyZf9yW0Cb5+SyOVpbMVyix85VZGS86cexUzXlyNWvcZAKOlJk02AB7dps821f8BnKmzBLN7QiLRju+EFXcHpV7pAtBUozCPG1QwhjVe713bmiCS4J2RzQ== 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-SenderADCheck; bh=P4LyLYRdm17DhHpArJ1gknZzpG6j8pZLRkNiTLogW6I=; b=kwezr1fMRajnzQE00OltpbZc9+oKOJkuSCG6S5FmsIL3RGj2+v18xhZa61YCR/1kHe4f1Pk6qYw7qsZSj+2qXCYzDNCod0dGOJJUGwRRktIj4Sbj64/3tyKhSJcmoYwNxsw3sdwLsDQENecbdcnyxGDttjYRz+7WHI5lZTJIIDGD9Yq6U5Q7SE0ADoKqv6SglgtzJtLlJXIjKDpFCifVOUKjPn+MjiC/iOoLur8eFRiHmFg1kcA5ymF7++vj51CwyfIrbysk6lvDXGn7maa5IZ/z5UDw6E4k+cXEh3MpKsvfHLydvrQYjJxYi9F0KhW3iFefQmuNemaVNJOyQT7o0w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none Received: from CH2PR12MB4151.namprd12.prod.outlook.com (2603:10b6:610:78::16) by CH2PR12MB4262.namprd12.prod.outlook.com (2603:10b6:610:af::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17; Wed, 3 Mar 2021 07:15:22 +0000 Received: from CH2PR12MB4151.namprd12.prod.outlook.com ([fe80::59b0:157a:e9d6:99af]) by CH2PR12MB4151.namprd12.prod.outlook.com ([fe80::59b0:157a:e9d6:99af%7]) with mapi id 15.20.3846.042; Wed, 3 Mar 2021 07:15:22 +0000 From: Ketan Patil To: Matthias Maennich CC: "libabigail@sourceware.org" , Sachin Nikam , Nicolin Chen Subject: RE: abidw for non-exported structures Thread-Topic: abidw for non-exported structures Thread-Index: AdcLZ9oZE+/4xuNRQlGbPWSyKFwLzAAFAmcAAR/878A= Date: Wed, 3 Mar 2021 07:15:22 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Enabled=True; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_SiteId=43083d15-7273-40c1-b7db-39efd9ccc17a; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Owner=ketanp@nvidia.com; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_SetDate=2021-03-03T07:15:18.9083060Z; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Name=Unrestricted; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Application=Microsoft Azure Information Protection; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_ActionId=ceb42871-7e01-4df6-91e5-e72b45b114a2; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Extended_MSFT_Method=Automatic x-originating-ip: [115.114.90.35] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: de5d725e-967e-494d-9e52-08d8de141c38 x-ms-traffictypediagnostic: CH2PR12MB4262: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-header: ProcessedBy-CMR-outbound x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: D5ggbgsiSeewtsQD8EAEp/iznSiHFKiFsPzzuE5PhEBDkCvQC2QgKKFJzYIEP8W0W7Nw5A9/9hj97bbKlt7/bj+b1fCLAZDIsKtCHn/Vx6Dy66t62BDAzPJRpvcV6m87URxdzS/59brpfMBBbn3VHWBLC59Bc+9Z0mfD+8GUvj5ISUQJnr/r8BxryZcu4CJoPOk1zx+KXwc3nYykQDtZXuR0/yN86GrvQ95sOV/8Lw59ckaV3gcSUKeAm0Z7sEYSFHezf7vV4V1uBhKKken2YhYRgkJBMFH23U5GgFJpmyaTyTAh7OwtOkRBiyYSbIb/2cKrB+C7NDNtzW0j4ePDnG1vas9LDl2nZGNedUsH2Y9AB0FsXSG7R5xMqOpeeLN35ijgmeqAcq7pwvcWbGzjclpndCB2k6e1NNtHzhSgvUkKTRoiqY96tz8kHZSv91CuwS3z6n2Jgfgi5zuTAM2XXjG7WMgOxZ7+wToiOmDlJS4fH+cKkO/VWcdr/9UyJfhRSavXVMOnIMZsI7ACahdQznjJwDXp04J4AMZqB3UOzZMpQrvXUp6WrfMyLUrt1SCTH8DJjQFQ3LL9coZ+F9aziw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4151.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(39860400002)(346002)(136003)(376002)(396003)(8936002)(55016002)(2906002)(7696005)(316002)(86362001)(966005)(8676002)(66446008)(64756008)(66476007)(71200400001)(54906003)(9686003)(66946007)(76116006)(107886003)(66556008)(6916009)(4326008)(478600001)(33656002)(53546011)(6506007)(83380400001)(55236004)(5660300002)(3480700007)(186003)(26005)(52536014); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?Qc65y3Zf5RUfhxm7oaxx3Lhtf0FNQ/mYG5yBJUzuBhDR40lBx3b4He6nXPAd?= =?us-ascii?Q?pbJn2EWK8nneNaiSc1N9Bgu0jTjS34904qB0tITszuiZKqMbdKcAexVBmAwV?= =?us-ascii?Q?2kG+37U8aVjIEe4Occb3Tv7nQBSPngsTll4awM88FGGgWmGAXSo+a/0qUYpw?= =?us-ascii?Q?yVRYD5mrsj4jNAzATUWqbeogVCz8Yq+mr+BMEzLW3IS56tWvqN7Fy98Om7hP?= =?us-ascii?Q?fvE7zGKEKCUD1MZQPcKFp1rPhP7i/k0nZtXtDDW9x9YLdBcSOqQHF/8Zo7/I?= =?us-ascii?Q?GOTgZ8r3oTkXynX/PGNY3lEc6f/iKujovvSNtZOwrw6POTOwiUrSCgAVJQhs?= =?us-ascii?Q?98uIbwx17AU8bUEaoyp8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?= =?us-ascii?Q?DRaxX+OdJatM0n6/D9tcrkt4jQ6tyJ+qJrDWfivTYZRuagUZzHKGn8WpoYN9?= =?us-ascii?Q?OKZcNIdFu4obaGWS0C3Jrh8c?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4151.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: de5d725e-967e-494d-9e52-08d8de141c38 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Mar 2021 07:15:22.6393 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: B9azZiZWvP9WYOLVwCH23qLnqOfe56DjU/Ay6A9uLYD1tU6EU9xBBqhuvflRAKcb8kw+qitSq0dArqORQYTlsQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4262 X-OriginatorOrg: Nvidia.com X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2021 07:15:31 -0000 Thanks a lot Matthias for the detailed answer. -----Original Message----- From: Matthias Maennich =20 Sent: Thursday, February 25, 2021 7:11 PM To: Ketan Patil Cc: libabigail@sourceware.org; Sachin Nikam ; Nicolin Ch= en Subject: Re: abidw for non-exported structures External email: Use caution opening links or attachments Hi! On Thu, Feb 25, 2021 at 11:25:53AM +0000, Ketan Patil via Libabigail wrote: >Hi, > >I was experimenting with abidw and abidiff tools to check ABI changes in l= inux kernel. >I had performed few experiments: > > 1. Changing exported structures: > * I changed few structures (added some dummy members in between) wh= ich were exported and build the kernel and created abi xml file using abidw= tool. > * Then I compared this xml with the baseline xml (kernel without an= y changes) using abidiff tool and I found that it catches this ABI change. > 2. Changing non-exported structures: > * I changed few non-exported structures e.g. struct dm_ioctl In htt= ps://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/include/= uapi/linux/dm-ioctl.h?h=3Dv5.10.18 > * This struct is being used by a number of ioctls. So I think, chan= ging this struct should be flagged as an ABI change. > * Then I build the kernel and created the new abi xml file using ab= idw tool and compared with baseline xml using abidiff tool. > * abidiff tool is not able to catch this. Also, I don't see any ent= ry for dm_ioctl in the xml generated using abidw. > > >Does it mean that, abidw tool does not work for the non exported symbols? = If yes, are you planning to add this feature? >Can you please let me know or redirect? libabigail works roughly like this (in its default mode): It reads symbol i= nformation from the ELF symbol table and matches symbols with corresponding= DWARF information to gather type information associated with it. The type = information is recursively resolved to capture nested types. So, fundamenta= lly, to capture and eventually report a structure in the ABI, it needs to b= e contributing to the definition of an exported symbol. E.g. consider this = snippet. | enum my_enum { | VALUE, ANOTHER_VALUE | }; | | struct my_struct { | // some interesting bits | }; | | struct another_struct; | | // consider publicly exported function | int my_function(int my_enum, struct my_struct s1, struct another_struc= t* s2) { | if (my_enum =3D=3D VALUE) { | // something | } | } The enum technically participates in the ABI, but this is invisible for lib= abigail as the type information is not connected. As opposed to my_struct. = This is part of the type information of my_function and changes therefore w= ould be discoverable. For the forward declared another_struct, we have agai= n the case that changes to this data structure can't be captured as the typ= e is passed by reference and the details are hidden from the ABI. Not even = we know anything further about this struct. If my_function is not exported = at all (i.e. not part of the observable ABI), any analysis will ignore it, = entirely and rightfully. For the Linux kernel there is an additional fact to consider. In the defaul= t way (without using whitelists), symbols are considered part of the ABI (o= r in this case Kernel Module Interface (KMI)), if they are exported via EXP= ORT_SYMBOL* macros and therefore part of the ksymtab. If a data structure is not participating in the type information of an expo= rted symbol, changes to it will not be discoverable. In order to discover c= hanges to those, you need to make them discoverable, e.g. by exporting a fu= nction that takes 'struct dm_ioctl' as an argument type. Cheers, Matthias > >Thanks, >Ketan Patil >