From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D6AE1C9DE5 for ; Wed, 30 Oct 2024 23:05:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730329511; cv=none; b=iG9wbD9dLFkyfartUJ/X7pzqGVSMvAx19a/T3DRVhKiBtsvQX0RSmPOU/y44LAtYCt5NYeqAYnOo0e0R03b3IF/iIIRVLJ/JZAV7H3/Lbmrge7b5K6uCbmD+48nyKd0KS6NpTZTW43Vczo0/lMaDTOcQFXAFk3iY9HFLJMdzydc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730329511; c=relaxed/simple; bh=caVe8KUg4p0c7ymHU2yLmoxpVlKecGLB8YQ6QefrTCo=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=GlrZD7zFZ6/MMut2lG65atpUsLORTfUD+edIL86GZD+itwLb1j5bdqoKrSHGaGNWC1zNc0+OpbZqGPDrGRrF8e6UBfoxh23CB8qwQf3LuXqos2Um283zbmMFqwkZPOce54uwtsPt8poeHDrcfvtdPlW/esFMSFwuWbFI3AbL3MI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--mmaurer.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=aDg7weAd; arc=none smtp.client-ip=209.85.219.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--mmaurer.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="aDg7weAd" Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-e30df208cadso878827276.0 for ; Wed, 30 Oct 2024 16:05:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1730329506; x=1730934306; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=mwCfAovhpPAvFtkBAaRUtvlrChVtTdt/SXipMI6/liY=; b=aDg7weAdvelrTfNpX+eJjZap/wLk5M04DDdxiJAKoBWzl0Y3/0+ufbcv+nSkUwaoH6 McQZK4antoPiegc2gP1vM5CjYspOYntqmuRsWSsX4o4Z0QX4L73Pwnl8KNzUTLd/cQ30 FsQJx8k12yScffjv0pQ/WVocINDwjGdrDwF22r6oj1x40jCH+bUOm6TBW1L8Xzag3xV5 yZT3CUKE4J4j6+cX465GxsUjzh17tYHu/L7HzvJyMiJJG0TDmnHXleztPJ/YKoFQDCqU zn/Qq7JW85wzpQdqrdv030d4+VEM2Ov3sdUnilJtNQAG5H4Z8RZ1zk2nv3wf/bZPRyEt l/Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730329506; x=1730934306; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=mwCfAovhpPAvFtkBAaRUtvlrChVtTdt/SXipMI6/liY=; b=Vuc8LAns7gIxP9ZWwv6YR5Ej+ojKQwi9fjDvLZAL6rDM4ExwcqCs4YY9Nh2zddbGSu gme7SBFjfY0vkJebyORDGoTWG8CFfZenXHwmyfrBo//8M7qJK3umR6OzDbSMyDL933eI Y1mmwSnYJcZeBIhfNr618U3AR7tRCvh1G0J+ukFKsLKIXVTQjvufEWFH995Aev7djMJ+ mh4flaHGj084bbnkChT7sd1jjiTUMzl/W8vwXQN07TlXeKxowByER7FdRB2EpQBSYobD WEcV0ya1QgCS5sKxYT3W8785/uMfea3bFbUd0JEyRE5vckx7vCdqeZrQr3/13j2ReGu7 cJcQ== X-Forwarded-Encrypted: i=1; AJvYcCWIL2gx4VnwrVc5MBfXxseE3WAsCt7PFh9mrXcHH+94yn+0PK3YTjKauJ0caOOOBHVdssXKHIMlc5/81VlEdw==@vger.kernel.org X-Gm-Message-State: AOJu0YxYO96Sikv8QA6zZIr/PerI1tx3erp9q8Mxdz/xIABbaeH5922I uBJiKOr18T4S8WefRCWZy/nDeKgwAE7ZTMFWHxiZ2FWLk6EMeeYXt2GfsEP/FLzq1WNvN8I2RD7 AIYmMAA== X-Google-Smtp-Source: AGHT+IEVxCPJ8KY+daO6sXzeep+OX1tLKz9cP/KzhVx9mKCU3r73WaJnmvG2rqaP9yNNj71dEIj2Eigx8el+ X-Received: from anyblade.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:1791]) (user=mmaurer job=sendgmr) by 2002:a25:ad54:0:b0:e2b:db24:905e with SMTP id 3f1490d57ef6-e30e8da06f9mr779276.5.1730329506200; Wed, 30 Oct 2024 16:05:06 -0700 (PDT) Date: Wed, 30 Oct 2024 23:05:01 +0000 Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAJ67ImcC/22QzW6DMBCEXwX53EX+wZigqup7VDkYWBNLMU5tY qWKePcamgOquO1IO59m5kkiBouRtMWTBEw2Wj9l0bwVpL/oaUSwQ9aEU14xyjngY8ZpwAGcHxK G9T+CVl1VDaYzxjCSrbeAxj427Nc5axO8g/kSUO9gTHLBTlyWopEVFxQYOKfvAcPn6P14xbL37 kUL+H3P2eY/JHEYo96ytcX7jlZLttIYE80h7WPFHZgFZYoyWpdM5qsWwBlE7ezsr0lPOP1HdDo iZJE/2iJlG4fQS7JWvdg4+/CzDZrUlva1nTjeLimgIMRJNXlEIZTYtz8vy/ILqBzHl6QBAAA= X-Change-Id: 20241022-extended-modversions-a7b44dfbfff1 X-Mailer: b4 0.15-dev Message-ID: <20241030-extended-modversions-v8-0-93acdef62ce8@google.com> Subject: [PATCH v8 0/3] Extended MODVERSIONS Support From: Matthew Maurer To: Michael Ellerman , Nicholas Piggin , Christophe Leroy , Naveen N Rao , Madhavan Srinivasan , Luis Chamberlain , Petr Pavlu , Sami Tolvanen , Daniel Gomez , Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , "=?utf-8?q?Bj=C3=B6rn_Roy_Baron?=" , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, linux-kbuild@vger.kernel.org, rust-for-linux@vger.kernel.org, Matthew Maurer Content-Type: text/plain; charset="utf-8" This patch series is intended for use alongside the Implement DWARF modversions series [1] to enable RUST and MODVERSIONS at the same time. Elsewhere, we've seen a desire for long symbol name support for LTO symbol names [2], and the previous series came up [3] as a possible solution rather than hashing, which some have objected [4] to. This series adds a MODVERSIONS format which uses a section per column. This avoids userspace tools breaking if we need to make a similar change to the format in the future - we would do so by adding a new section, rather than editing the struct definition. In the new format, the name section is formatted as a concatenated sequence of NUL-terminated strings, which allows for arbitrary length names. Emitting the extended format is guarded by CONFIG_EXTENDED_MODVERSIONS, but the kernel always knows how to validate both the original and extended formats. Selecting RUST and MODVERSIONS is now possible if GENDWARFKSYMS is selected, and will implicitly select EXTENDED_MODVERSIONS. This series depends upon the module verification refactor patches [5] that were split off of v5, and DWARF-based versions [1]. [1] https://lore.kernel.org/lkml/20241030170106.1501763-21-samitolvanen@google.com/ [2] https://lore.kernel.org/lkml/20240605032120.3179157-1-song@kernel.org/ [3] https://lore.kernel.org/lkml/ZoxbEEsK40ASi1cY@bombadil.infradead.org/ [4] https://lore.kernel.org/lkml/0b2697fd-7ab4-469f-83a6-ec9ebc701ba0@suse.com/ [5] https://lore.kernel.org/linux-modules/20241015231651.3851138-1-mmaurer@google.com/T/#t Changes in v8: - Rebased onto latest version of Sami's series, on top of v6.12-rc5 - Pass --stable when KBUILD_GENDWARFKSYMS_STABLE is set. - Flipped MODVERSIONS/GENDWARFKSYMS order in deps for CONFIG_RUST - Picked up trailers v7: https://lore.kernel.org/r/20241023-extended-modversions-v7-0-339787b43373@google.com - Fix modpost to detect EXTENDED_MODVERSIONS based on a flag - Drop patches to fix export_report.pl - Switch from conditional compilation in .mod.c to conditional emission in modpost - Factored extended modversion emission into its own function - Allow RUST + MODVERSIONS if GENDWARFKSYMS is enabled by selecting EXTENDED_MODVERSIONS v6: https://lore.kernel.org/lkml/20241015231925.3854230-1-mmaurer@google.com/ - Splits verification refactor Luis requested out to a separate change - Clarifies commits around export_report.pl repairs - Add CONFIG_EXTENDED_MODVERSIONS to control whether extended information is included in the module, per Luis's request. v5: https://lore.kernel.org/all/20240925233854.90072-1-mmaurer@google.com/ - Addresses Sami's comments from v3 that I missed in v4 (missing early return, extra parens) v4: https://lore.kernel.org/asahi/20240924212024.540574-1-mmaurer@google.com/ - Fix incorrect dot munging in PPC v3: https://lore.kernel.org/lkml/87le0w2hop.fsf@mail.lhotse/T/ - Split up the module verification refactor into smaller patches, per Greg K-H's suggestion. v2: https://lore.kernel.org/all/20231118025748.2778044-1-mmaurer@google.com/ - Add loading/verification refactor before modifying, per Luis's request v1: https://lore.kernel.org/rust-for-linux/20231115185858.2110875-1-mmaurer@google.com/ -- 2.47.0.rc1.288.g06298d1525-goog --- Matthew Maurer (2): modules: Support extended MODVERSIONS info modpost: Produce extended MODVERSIONS information Sami Tolvanen (1): rust: Use gendwarfksyms + extended modversions for CONFIG_MODVERSIONS arch/powerpc/kernel/module_64.c | 24 ++++++++++- init/Kconfig | 3 +- kernel/module/Kconfig | 10 +++++ kernel/module/internal.h | 11 +++++ kernel/module/main.c | 92 +++++++++++++++++++++++++++++++++++++---- kernel/module/version.c | 45 ++++++++++++++++++++ rust/Makefile | 33 ++++++++++++++- scripts/Makefile.modpost | 1 + scripts/mod/modpost.c | 65 +++++++++++++++++++++++++++-- 9 files changed, 267 insertions(+), 17 deletions(-) --- base-commit: ac746e6156c4d6d7b46ba2102acf644ea2aa4aac change-id: 20241022-extended-modversions-a7b44dfbfff1 prerequisite-message-id: <20241015231651.3851138-1-mmaurer@google.com> prerequisite-patch-id: 7b7bf0c0c0f484703e29a452dc99dc99711c051b prerequisite-patch-id: 8cc51bc35ddd4c268b5ccba4c3a74af3dbee8bee prerequisite-patch-id: 0c4fded10660440fc59e256d6456ac865b70f04b prerequisite-patch-id: 121f9313b4bde4e374ba37132fbf36e435f7ada5 prerequisite-patch-id: bbd158ee717130fd5d5fc4b7c0613d89c2adcc45 prerequisite-patch-id: af83141b7e527e3d1936326e3c9996bddfa45642 prerequisite-patch-id: 61a51b5c2ab3dc55031fcb2a2b56b4b44b9fabd3 prerequisite-patch-id: 63b4bdc24ff078bd48b8dcec28a334042450796e prerequisite-patch-id: 429739b875bf7400ece44ec2529f43051b43dd45 prerequisite-patch-id: 55a19e6365f3d60ac5dbea13e320ece71538de25 prerequisite-patch-id: d5ab8e10e837e8193c265dc8548b97655a56db27 prerequisite-patch-id: e2f5364a0c5f3c9341aaa183f97fb7544b1c9dba prerequisite-message-id: <20241030170106.1501763-21-samitolvanen@google.com> prerequisite-patch-id: 08b46e0d1e37c262c08da6db4a87728d7b3047cc prerequisite-patch-id: 0a1e1ac99f325f4df27bd35f00bd4914f5386cb9 prerequisite-patch-id: 32a05b89083cfed15e5b877664b0c8138c40d09b prerequisite-patch-id: e192e2a692c40d96cba919e3baae68c441ab25e4 prerequisite-patch-id: 50e884d28c720e90f201aae7801590d19736541b prerequisite-patch-id: 4d6a826429c519b581d01215e1d9c7373fdfd8c6 prerequisite-patch-id: 0dcd84187b222adf52696dbcab303d683d087dd2 prerequisite-patch-id: 0abe8634eb844a85e8dc51c1cd3970cf96cc494a prerequisite-patch-id: 5fabb630792f9304f200b5996314f3c2ae4c83ae prerequisite-patch-id: 4859bef5bb0f6b2142bd7a0e89973f7a79009624 prerequisite-patch-id: a5cf20d27871bf63be64ac79cc81e5eb9d117b89 prerequisite-patch-id: f9cacaf82d1f2a93ade313c44269fb871e7b9ce2 prerequisite-patch-id: 9fcea62d87a577d69ec262fe76b81c889c1bdf92 prerequisite-patch-id: 310f411df60af62002a3898eafe60c1687c0e9b8 prerequisite-patch-id: c21f85ffe5c7684c1ffc87af716e2e50498d5c92 prerequisite-patch-id: a372f88626c3dda51eab6c6af132a76141ff20cc prerequisite-patch-id: 57d2fe708769154a6494fb1fece56911dea00687 prerequisite-patch-id: e5fb35555f6a95bc9953bddebba0612f422146c4 prerequisite-patch-id: 624e6794e5003cff734873894c2343595b45244b Best regards, -- Matthew Maurer