Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp946395rdb; Fri, 17 Nov 2023 18:58:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IGh88JK17YVo3DlaxcL+6PA5kiKFo0+gd+/HuM3a2Iu0cBMz7nyBetVt2le2n4aYHUwunYU X-Received: by 2002:a05:6358:2923:b0:16b:adb5:72d5 with SMTP id y35-20020a056358292300b0016badb572d5mr1295484rwb.14.1700276333899; Fri, 17 Nov 2023 18:58:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700276333; cv=none; d=google.com; s=arc-20160816; b=FKRCSWbyzaPPt/F0g4Hmb/XLefUM9p4Pj68H+noETGNRPMhdcpogzFa62IBdKRu+mw j2GJIleKpqNZ9Y5mt0vH6ZVdjzkJCYh7qwbrWQ+uozuWprHBJAO5+ptTJyjYYVVdvNh+ 4uKdfXsU/AlxEP1E7tYzxsQMWDG2cbL5EH2muKl+2Rnu7C5jCTY6mTTsMbiLXPIUJEpO +RJ/qzxz10ZG//S383hU3U5QgR59nOR6jFBNRhB1hqyDRWZbEPu2q8dai5JCL4wVKnDM haiiaf+buA7hggLhXlVBq3hLeYNuVXPGi6C9Wqf0GeX6YDwZR9g2p9iILjnHF7UfdBFm D8vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:mime-version:date :dkim-signature; bh=QcqINJQ5diQHGOPsun01LVrGFl32Nw5/hV5eaRRLRg8=; fh=tvII/HPajp/NlqnxeuWRc9nIfYr8jgLiigCgB7HTnyI=; b=I2LD70cjGpIGzg6xgJz1UaEAG+XVhtkBuuJXGte1qZ5Fsf1I7V0S8FRGhYnsrW4UXI 9wsKp8awsphOQvGj2cqf45JQ3S0NNSi+GqalKbgOI6F2ccWxJbk3KEvitNvdrPizW7J+ 4Mdi1nnpPF6lDufKWGRVPrxA1lRgIL2zi2alnSIvrLJSqHtaotF84mooP4fHynJTazn5 qhMZOXGOvihh7gpGqP5lzQBDxj3VH3mtgYWEx2O51Bs4YZjw0VFCyjGBxkJ5CzMTHukK T7Y79WvkDKezRlweupZ6UqMODZmgZUwVlJub/yLiRqTYtRIDaC7u4d4sw02MstthXUZa C6Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=tuNl5Lb5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id v71-20020a63894a000000b0057745d87b53si3335928pgd.686.2023.11.17.18.58.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 18:58:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=tuNl5Lb5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 5ECFF822154C; Fri, 17 Nov 2023 18:58:35 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232769AbjKRC6L (ORCPT + 99 others); Fri, 17 Nov 2023 21:58:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229789AbjKRC6K (ORCPT ); Fri, 17 Nov 2023 21:58:10 -0500 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DC76D6C for ; Fri, 17 Nov 2023 18:58:07 -0800 (PST) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-daee86e2d70so3209867276.0 for ; Fri, 17 Nov 2023 18:58:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1700276286; x=1700881086; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=QcqINJQ5diQHGOPsun01LVrGFl32Nw5/hV5eaRRLRg8=; b=tuNl5Lb5paQT0f052qeluQ+0tAGSdmaA/l4/8oASX0hOCpYfkhl30eZ7b/IQL0wQQl zXSOKlZy8pE3mjni/S0A1F5EC95HJ4exsuFi76fQR9wU8gCyEANaDN1uJCGtM+CVSacm Z8q6Hbo9ARDcAp+A/s/EunkKfcR2wB4oySt8s1gG2LUiDe+FKWGoZdaDO5ZQOXug2G9q AW5U9X6Kq5bYFCfDjkmoZuI2Eyj1kbJKSy2gL1Js6nep5EbeGxQRfDz4tA8gHABKUNhX bQu3MYQ0gPMUWFcNMtBdWx5FJM4FfstCMUkGb2jOaGTqGJs25RCPBbK4R9z0+K6CP2EN wAUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700276286; x=1700881086; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=QcqINJQ5diQHGOPsun01LVrGFl32Nw5/hV5eaRRLRg8=; b=LZ+KAibdtEagIn/1Zsh/vq+FHRDnW+4ULmxW4aNOWSQHj4su61n5MeZML2v0qiYzBN FefosD49QQ6fI1n08f6JvkeJaDR4Z5Z10r0f74E+y9iF5zGvVGeqqGjkKX2qlgZ/JTol zuZhdbz+QquyqL4/S6AaZc6P9RcIlcT7emRfcjlKX7ORUxfCVVGLKzoaCM//o6VpK7Y8 Xs27TpH1wQ/xWO728q/cPPp2JtKps+mdCZCdBjgKGtN8al/PNmv1TLVK526JTU4ZXigR z9G5cQgUWCYKY+mesd73eDzuLdMjE537JZnZy1BiGj/NRTW0u5pozYOWn1rK/dwKARkQ LMhg== X-Gm-Message-State: AOJu0Yw9F7H5MN8GtXi9lLeCDKoAL8GFV5dK8euknCpc1EoJl0vtJ05m NyxWvRX1dkdscHqsEAQ47VgFBs24JqNU X-Received: from anyblade.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:1791]) (user=mmaurer job=sendgmr) by 2002:a25:abe3:0:b0:d9c:c9a8:8c27 with SMTP id v90-20020a25abe3000000b00d9cc9a88c27mr27045ybi.13.1700276286411; Fri, 17 Nov 2023 18:58:06 -0800 (PST) Date: Sat, 18 Nov 2023 02:54:41 +0000 Mime-Version: 1.0 X-Mailer: git-send-email 2.43.0.rc0.421.g78406f8d94-goog Message-ID: <20231118025748.2778044-1-mmaurer@google.com> Subject: [PATCH v2 0/5] MODVERSIONS + RUST Redux From: Matthew Maurer To: Masahiro Yamada , Nick Desaulniers , Miguel Ojeda , Gary Guo , Luis Chamberlain Cc: Nathan Chancellor , Nicolas Schier , 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, Laura Abbott , Matthew Maurer Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 17 Nov 2023 18:58:35 -0800 (PST) The goal of this patch series is to allow MODVERSIONS and RUST to be enabled simultaneously. The primary issue with doing this at the moment is that Rust uses some extremely long symbol names - for those unfamiliar with Rust, it may be helpful to think of some of the mangled C++ names you may have seen in binaries in the past. Previously, Gary Guo attempted to accomplish this by modifying the existing modversion format [1] to support variable-length symbol names. This was unfortunately considered to be a potential userspace break because kmod tools inspect this kernel module metadata. Masahiro Yamada suggested [2] that this could instead be done with a section per-field. This gives us the ability to be more flexible with this format in the future, as a new field or additional information will be in a new section which userspace tools will not yet attempt to read. In the previous version of this patchset, Luis Chamberlain suggested [3] I move validation out of the version checking and into the elf validity checker, and also add kernel-docs over there. I found elf_validity_cached_copy to be fairly dense and difficult to directly describe, so I refactored it into easier to explain pieces. In the process, I found a few missing checks and added those as well. See [PATCH 2/5] for more details. If this is too much, I'm more than happy to drop this patch from the series in favor of just adding the kernel-doc to the original code, but figured I'd offer it up in case the added clarity and checks were valuable. [1] https://lore.kernel.org/lkml/20230111161155.1349375-1-gary@garyguo.net/ [2] https://lore.kernel.org/lkml/CAK7LNATsuszFR7JB5ZkqVS1W=hWr9=E7bTf+MvgJ+NXT3aZNwg@mail.gmail.com/ [3] https://lore.kernel.org/lkml/ZVZNh%2FPA5HiVRkeb@bombadil.infradead.org/ Matthew Maurer (5): export_report: Rehabilitate script modules: Refactor + kdoc elf_validity_cached_copy modpost: Extended modversion support rust: Allow MODVERSIONS export_report: Use new version info format arch/powerpc/kernel/module_64.c | 25 +- init/Kconfig | 1 - kernel/module/internal.h | 18 +- kernel/module/main.c | 663 +++++++++++++++++++++++++------- kernel/module/version.c | 43 +++ scripts/export_report.pl | 17 +- scripts/mod/modpost.c | 37 +- 7 files changed, 642 insertions(+), 162 deletions(-) -- 2.43.0.rc0.421.g78406f8d94-goog