Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp1369627rwb; Fri, 13 Jan 2023 11:15:57 -0800 (PST) X-Google-Smtp-Source: AMrXdXtphKj8FwwgQ9TePfLj0y5YyauKlLKxgzuZINza4U6LMK/Lhc/2pyNn+1/ZKyKmqeSEV0xd X-Received: by 2002:a05:6a21:6d95:b0:af:b909:2b3f with SMTP id wl21-20020a056a216d9500b000afb9092b3fmr17376761pzb.34.1673637356928; Fri, 13 Jan 2023 11:15:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673637356; cv=pass; d=google.com; s=arc-20160816; b=zSB8B4SWNiKdF4Jg1RVjFU9vHxhvWNqX1n09XsCVlmjQKgAkRDuFtXf4hP4U0EPSMs XLFInPRQSRl3xY9YA9id08NjPHtHE8Izcs7IYK/G/ZQfwzVdKqK8L6eQpAPbdhVvEtvs h/WYTwYT8o4s3T/5KTkCLK52k74BOFDUaKyd0AIDaijwlcuN96hlFjMBbT0LjVuCn7a/ zu4NdxJicdgmWvSKiK1cshdXrtNiyCspYs1L+sHHbxyd29gd8uxpAJcUNaNPPqDm+AuH RbCv+im1vXZlIAJiO/c5NsXt/3QEanw6O3Oje5KjkR0+QEHKIo5aTfgiPlTVd3JeShyE UlCg== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=4M03HqJ6DWROxB/SwZaIPlgw9/1z21JDfb5VsRm59yc=; b=rCIiacfrNfWFSqG8LZ+/wonGqf9c3mlKaja+YG24WcRQMAXv1Pga2pRnu2rvNl/Tqs 37JHmPjN/FB4NY3Jdn/x0KILayiu4ityW453rjkb+48GFr7XBoipTQ/1ZCS+Oe7nIrYK oJ/b14lEf/+lx3aEzlQKhN0H85lLxGpDe/gGZJIOu9vzwv2GTXFExYWbqZh3nkeKKoIJ ChVW/0UZpX6PNXk0E74j/zJXXSI/AkAuzpl7dHJyblW/l3NIspaw/F+ZvGXP3Q07f8w8 etUhWKVCyR/OzGsVtVZXi4Pgsswqw86tNxGSdPCICaqeyjpxchIUYui6e9RvNiK3dB+P PX5A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@garyguo.net header.s=selector1 header.b=0HXLH4mT; arc=pass (i=1 spf=pass spfdomain=garyguo.net dkim=pass dkdomain=garyguo.net dmarc=pass fromdomain=garyguo.net); 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m18-20020a639412000000b00497e31916dfsi21192287pge.273.2023.01.13.11.15.49; Fri, 13 Jan 2023 11:15:56 -0800 (PST) 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=@garyguo.net header.s=selector1 header.b=0HXLH4mT; arc=pass (i=1 spf=pass spfdomain=garyguo.net dkim=pass dkdomain=garyguo.net dmarc=pass fromdomain=garyguo.net); 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230252AbjAMSZn (ORCPT + 51 others); Fri, 13 Jan 2023 13:25:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229824AbjAMSZJ (ORCPT ); Fri, 13 Jan 2023 13:25:09 -0500 Received: from GBR01-CWL-obe.outbound.protection.outlook.com (mail-cwlgbr01on2107.outbound.protection.outlook.com [40.107.11.107]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B75541A6A; Fri, 13 Jan 2023 10:19:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X4tiwesCtz+Njfm7VO4MqGaZ0Fm8GoTqF1Rte4VXUJiP4qE5gufW8csVPZjFyF6Cwo8KsA9wzTpUgduZtYftFBBtEf8+/YW/RyxDAvSAgvMLsqb9xpL0N8jcr0Yeldy3BxVBpGxftmETDlfeQALiuhVwkfxGswovD4AFEnCFGy+YsX4R/KH9OzPeDkr6LnhhkuMeEMopCGUKDofdEqrfOhkVWDvbffMfQJuV9zCZuGaApA0WZHS33X7oWflxu25ga9bI3WYVxyCOzWkiX5sZT0pSqx/nTDxy3sK40AkaNPMD2qlnvGlQCRwYi+Imjgh6tyccUSyMHPrayRyRWV9nTQ== 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=4M03HqJ6DWROxB/SwZaIPlgw9/1z21JDfb5VsRm59yc=; b=badOGi5HiXzE/Auiz7vibp0BRT+2/Ez3NlH19ZsHE6el9IgNYWU/AY86lYhIaDaGB88sSlyDhUmV0pToYZWK6Hn1AVy2qCxAYP8BPfdmgn9GBU3WATSIF2c03/ljOLTY2xKymvgBlc+yqb27w0B1kErsPUzERQLT08ScPRh4ohF5vkJhAoFROxfOKk1LbgKhuIJyS9Ls3U9ZTrgZJBRJ+b7UbysTXII+Gy5pj93ecuhVF0tJTTmA/T6KKNl3O0/b6Fgcz9Bg3eQUTFPfdzv2Cs3asNmhwwSHgcMokWfK+lHHrRemCUY/wKOKzz3fLDrUZV8xIJhCg9jajkIuJupK8g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=garyguo.net; dmarc=pass action=none header.from=garyguo.net; dkim=pass header.d=garyguo.net; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=garyguo.net; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4M03HqJ6DWROxB/SwZaIPlgw9/1z21JDfb5VsRm59yc=; b=0HXLH4mT5o8yi8ijVzJBNCOqdglEGo3hjMjG2Uzff9cLznGIaOiLdZ7L//A2nwaKqEwuOEj6JnrxXHsYQqDffybBvX8r84K7GPfvrntZh527h04kmnwVnj+P+7qLLEKfBi1AWBp9ed8C7o7HQ6bhRKMC5AfDFuZmr2A7rCBbRCo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=garyguo.net; Received: from CWLP265MB5186.GBRP265.PROD.OUTLOOK.COM (2603:10a6:400:15f::14) by LO4P265MB6462.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2e0::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.12; Fri, 13 Jan 2023 18:19:15 +0000 Received: from CWLP265MB5186.GBRP265.PROD.OUTLOOK.COM ([fe80::d617:a3c0:4110:bfe]) by CWLP265MB5186.GBRP265.PROD.OUTLOOK.COM ([fe80::d617:a3c0:4110:bfe%4]) with mapi id 15.20.6002.013; Fri, 13 Jan 2023 18:19:15 +0000 Date: Fri, 13 Jan 2023 18:18:41 +0000 From: Gary Guo To: Lucas De Marchi Cc: Michael Ellerman , Nicholas Piggin , Christophe Leroy , "Luis Chamberlain" , Masahiro Yamada , Nathan Chancellor , Nick Desaulniers , Nicolas Schier , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , " =?UTF-8?B?QmrDtnJu?= Roy Baron" , Kees Cook , "Joel Stanley" , Julia Lawall , Guo Zhengkui , Wedson Almeida Filho , , , , , Subject: Re: [PATCH] modpost: support arbitrary symbol length in modversion Message-ID: <20230113181841.4d378a24.gary@garyguo.net> In-Reply-To: <20230112214059.o4vq474c47edjup6@ldmartin-desk2> References: <20230111161155.1349375-1-gary@garyguo.net> <20230112214059.o4vq474c47edjup6@ldmartin-desk2> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P265CA0035.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2ae::11) To CWLP265MB5186.GBRP265.PROD.OUTLOOK.COM (2603:10a6:400:15f::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CWLP265MB5186:EE_|LO4P265MB6462:EE_ X-MS-Office365-Filtering-Correlation-Id: 21713808-c816-4500-e97c-08daf592ad56 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wd+BW2sDytCSAmVs8dJ/vYtHn13Fhfzl1/26G0OJKtfhQ2tDFGnBg6EfsmTXhLg/zm8I6O0CtwGCVovFXNgKTVg3tEFuXvT+hQ83osct6lfA3wsdP5cp/wM8rSz5RJ2yGQGxJY4NFi7Pc0DaNHrOmE3LbzTOvjwwEZBHu6ZPN9zdPPAKoQhqAs8/V/P2M8cMqZnRSjxVxeQZXIWmUzrMGDvLTPhvP37TK5YO4FdIfwFX+KkV9EnwJ7CO04kTyD2abWtvcxV9mzCk6LBiDDgnvEvJ1Png1aQqCo98cxlvU89lhf7Ue7PLBM1ddzhekAetvMEgH/W39sCjJqnlHJQZ7HG7tGVlt31RfJXkx3LhLcYQLFDIcfAx/9eBe9s/jprzQMDEG9pS+YrItP23pi9GZCyUfsooNk1bSDDrXf4erbA8nTnTIWGYfDoylDcA0y93s7U9SRas1iGiYGkkfDXh7Sgncc4UVpqnNvTIgol5LqZe1HOx/PLfyLjFf9vybHHQVi+dvaQdiY1h+aI5wEJpjRD/Sapkk3K5/FPB2oZ1BNkxMSPVVBhtvmIrLb+SUuUFlwt/JByiw6D26UQs6KglqlmwPOdJcox/MlP8tQFKCiemN7gHUlSJQr7D9Cf6rANr X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CWLP265MB5186.GBRP265.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230022)(396003)(39830400003)(346002)(366004)(136003)(376002)(451199015)(6666004)(6486002)(2616005)(1076003)(36756003)(478600001)(7416002)(86362001)(8936002)(5660300002)(38100700002)(2906002)(83380400001)(54906003)(316002)(66946007)(41300700001)(8676002)(6916009)(4326008)(66556008)(66476007)(6506007)(6512007)(66899015)(186003)(26005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?URfMC053dfIAX/Sni3sMvF966UvWtHLbbdvoCH0d5F5uq/3ZvmH4HZ0ryaAH?= =?us-ascii?Q?H8B2LBqIHr4CitEppEmPcVMJk8858iQN6YjH5nZSHZVFnKGthowl5/C30GdN?= =?us-ascii?Q?iAQ5wAEN1T+jCUvjgaE8wfL3YP3SgpQZSAx5HjQBL5iBoXr8oyeqerYMuZk7?= =?us-ascii?Q?uHfIxta6zv2zf+UoqMJKtwz8P0M/rFD1Yg4nalUar/Un0wcafssHrpMCU5We?= =?us-ascii?Q?eM5qBZKCR292WAhkrESn8rYdgQZySTsH62h2qVEwcY6GglqNIC/78RdsgOvV?= =?us-ascii?Q?VNQaG+9NIK6XF5wv9a4NX4emFfdD09BPxspVipUfDBBeA8hcmh7rzyyoHrVU?= =?us-ascii?Q?mgHL+JbdLjlAWoD3/Ts+cAVwRTn4Q/8uZKIJCczfcMjCfn9aOvUAXS/tu/Se?= =?us-ascii?Q?VNUgDv0frXEpGx27ebSq7xDcQY85Xnr6of1nVxXOKSXH2sHGHO3Qufd/nn61?= =?us-ascii?Q?PX2b9v/Uxn6Q8bNZqyszquyQys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ii?Q?gXPP2BFDLdb7Fy7ocPs+FpYbHKIlAVJLs/BIK065vaNJEA/QSPwK0MDWZ3R+?= =?us-ascii?Q?LvGG8GWaDJaFkkdIO7dtliPci0jwt2IuTflcb5tbiSSy1K1av/tqE6M66jMv?= =?us-ascii?Q?9hdM/ZLTmlqO0llXIIb8ONXep9Gx73UNQTRTDOwlxFeOaKkztxbjxXFcyeRv?= =?us-ascii?Q?rUPwdYKq4kVoWsGBj7jAfSMYOTq6E9qNRpSI+2+Q?= X-OriginatorOrg: garyguo.net X-MS-Exchange-CrossTenant-Network-Message-Id: 21713808-c816-4500-e97c-08daf592ad56 X-MS-Exchange-CrossTenant-AuthSource: CWLP265MB5186.GBRP265.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 18:19:14.9780 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bbc898ad-b10f-4e10-8552-d9377b823d45 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: INsR39Nd1RNWA/FHpYYE1zIMaUmpbjoLKSchGm8X8WbxwD0OmSol0oT7MsQcngKjF2aLM69q5o9Wwa+QoJydxw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LO4P265MB6462 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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, 12 Jan 2023 14:40:59 -0700 Lucas De Marchi wrote: > On Wed, Jan 11, 2023 at 04:11:51PM +0000, Gary Guo wrote: > > > > struct modversion_info { > >- unsigned long crc; > >- char name[MODULE_NAME_LEN]; > >+ /* Offset of the next modversion entry in relation to this one. */ > >+ u32 next; > >+ u32 crc; > >+ char name[0]; > > although not really exported as uapi, this will break userspace as this is > used in the elf file generated for the modules. I think > this change must be made in a backward compatible way and kmod updated > to deal with the variable name length: > > kmod $ git grep "\[64" > libkmod/libkmod-elf.c: char name[64 - sizeof(uint32_t)]; > libkmod/libkmod-elf.c: char name[64 - sizeof(uint64_t)]; > > in kmod we have both 32 and 64 because a 64-bit kmod can read both 32 > and 64 bit module, and vice versa. > Hi Lucas, Thanks for the information. The change can't be "truly" backward compatible, in a sense that regardless of the new format we choose, kmod would not be able to decode symbols longer than "64 - sizeof(long)" bytes. So the list it retrieves is going to be incomplete, isn't it? What kind of backward compatibility should be expected? It could be: * short symbols can still be found by old versions of kmod, but not long symbols; * or, no symbols are found by old versions of kmod, but it does not fail; * or, old versions of kmod would fail gracefully for not able to recognise the format of __versions section, but it didn't do anything crazy (e.g. decode it as old format). Also, do you think the current modversion format should stick forever or would we be able to migrate away from it eventually and fail old versions of modprobe given enough time? Best, Gary