From patchwork Thu Jun 17 20:39:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian May X-Patchwork-Id: 1493959 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G5Ync2xS2z9sSs; Fri, 18 Jun 2021 06:39:31 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1ltynP-0007q4-Rh; Thu, 17 Jun 2021 20:39:27 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ltynN-0007pZ-De for kernel-team@lists.ubuntu.com; Thu, 17 Jun 2021 20:39:25 +0000 Received: from mail-ed1-f69.google.com ([209.85.208.69]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1ltynN-0004gz-5M for kernel-team@lists.ubuntu.com; Thu, 17 Jun 2021 20:39:25 +0000 Received: by mail-ed1-f69.google.com with SMTP id ch5-20020a0564021bc5b029039389929f28so2281002edb.16 for ; Thu, 17 Jun 2021 13:39:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=r0j+LHpWhxxhQFYb2GaX307RBDDnSS4i15B9BpnLERk=; b=EfoHlzv9gE5o8ss8k/dbCy+ETVY503cYQW0FFAJnvTnvlycOiisbXY1MZH5rbw0HAv I5OsHPq5zLz2B3yUf7S5iTdmVwwmMsUTpNeokTtRPgZc5X1tdUXeDJOckMllu4eo1nVi hq3vLokZAGBRd4jNx/6o1B8Ml3mhqKQiZKRKF3m8GN5Mu6rS/XjvTs8OjElyMvoLZKId yP6culcwCxVsCAIMsuZFxtWpUKh/Jil8cQFSBoP1z2dtB/dyR6AI7Pi6S0eROhWsgacc DGeWFRugu2pzXv0iwGsllFs5akwUuRXUC+++EpAalVkSz9KEe3yftC2bRRgcl0RU3+St 1wNQ== X-Gm-Message-State: AOAM533hkyYTglILJP+qtF16iUYm10ufURV3fmSSmlYiidINPJgeCHZU ytdASdz5Uukx2oVVZnrqa+XnkWT48eE91xZZMXdBAYxoC49ln12oWJmfIFnjAN88/IeMBhVC74s 6Lqg5CyLcR9U6EaWjETMLijGnuotM32kLYVnk5fTIFw== X-Received: by 2002:a05:6402:49:: with SMTP id f9mr224741edu.178.1623962364897; Thu, 17 Jun 2021 13:39:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwcbMyhWfBgchP02z2jA2fanpCDrcPB094Hng58TALyABgRNydHVnaBzayABm5oLWK6dKbuDQ== X-Received: by 2002:a05:6402:49:: with SMTP id f9mr224722edu.178.1623962364681; Thu, 17 Jun 2021 13:39:24 -0700 (PDT) Received: from uws.buildd ([2001:67c:1562:8007::aac:44bb]) by smtp.gmail.com with ESMTPSA id lu21sm50623ejb.31.2021.06.17.13.39.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jun 2021 13:39:24 -0700 (PDT) From: Ian May To: kernel-team@lists.ubuntu.com Subject: [SRU][G][PATCH 1/8] UBUNTU: SAUCE: Revert "modules: inherit TAINT_PROPRIETARY_MODULE" Date: Thu, 17 Jun 2021 15:39:10 -0500 Message-Id: <20210617203917.1583344-2-ian.may@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210617203917.1583344-1-ian.may@canonical.com> References: <20210617203917.1583344-1-ian.may@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1932065 This reverts commit a1364c5c1c767f8fac7cc17293324d46db255410. Upstream introduced 'module' patches that removed exported symbols that might cause potential disruption and breakage for customers. Reverting as SAUCE patches to prevent regressions. Signed-off-by: Ian May --- include/linux/module.h | 1 - kernel/module.c | 26 -------------------------- 2 files changed, 27 deletions(-) diff --git a/include/linux/module.h b/include/linux/module.h index e30ed5fa33a7..30b0f5fcdb3c 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -389,7 +389,6 @@ struct module { unsigned int num_gpl_syms; const struct kernel_symbol *gpl_syms; const s32 *gpl_crcs; - bool using_gplonly_symbols; #ifdef CONFIG_UNUSED_SYMBOLS /* unused exported symbols. */ diff --git a/kernel/module.c b/kernel/module.c index b7677f38d2a9..f0e8f2c417f9 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -1432,24 +1432,6 @@ static int verify_namespace_is_imported(const struct load_info *info, return 0; } -static bool inherit_taint(struct module *mod, struct module *owner) -{ - if (!owner || !test_bit(TAINT_PROPRIETARY_MODULE, &owner->taints)) - return true; - - if (mod->using_gplonly_symbols) { - pr_err("%s: module using GPL-only symbols uses symbols from proprietary module %s.\n", - mod->name, owner->name); - return false; - } - - if (!test_bit(TAINT_PROPRIETARY_MODULE, &mod->taints)) { - pr_warn("%s: module uses symbols from proprietary module %s, inheriting taint.\n", - mod->name, owner->name); - set_bit(TAINT_PROPRIETARY_MODULE, &mod->taints); - } - return true; -} /* Resolve a symbol for this module. I.e. if we find one, record usage. */ static const struct kernel_symbol *resolve_symbol(struct module *mod, @@ -1475,14 +1457,6 @@ static const struct kernel_symbol *resolve_symbol(struct module *mod, if (!sym) goto unlock; - if (license == GPL_ONLY) - mod->using_gplonly_symbols = true; - - if (!inherit_taint(mod, owner)) { - sym = NULL; - goto getname; - } - if (!check_version(info, name, mod, crc)) { sym = ERR_PTR(-EINVAL); goto getname; From patchwork Thu Jun 17 20:39:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian May X-Patchwork-Id: 1493960 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G5Ynd3YKCz9sW6; Fri, 18 Jun 2021 06:39:33 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1ltynS-0007rP-36; Thu, 17 Jun 2021 20:39:30 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ltynO-0007ps-Lm for kernel-team@lists.ubuntu.com; Thu, 17 Jun 2021 20:39:26 +0000 Received: from mail-ej1-f72.google.com ([209.85.218.72]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1ltynO-0004h5-Eu for kernel-team@lists.ubuntu.com; Thu, 17 Jun 2021 20:39:26 +0000 Received: by mail-ej1-f72.google.com with SMTP id n8-20020a1709067b48b02904171dc68f87so2947674ejo.21 for ; Thu, 17 Jun 2021 13:39:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Dc9yclm0dBLjijdmpiPxZmWe8lpyWmmMsIttHHLsd40=; b=g2vQLfwpv0fCBlRC7K2gN3krXifqTu9n8DGoWgEBGjq3rtSsWsMSmh989Bz/tcVfrX ZwUs5WBMoAoZGSa7BdnveGPtwpxdUrav1xYmR/YFHXDu9XEdco5PN73rmERGdvOtsfX2 poVHStjP0x49IYLHYZLQGHGlaWSqinNRgTUoARnfhoD4tSwyWAVFE6VQmUzud64thm7P z9vsLUbsWkUHcwIgmuYtRoNbNJSMbjfct54R27Zs9YzHSA5Dk9TVk+TFU7L9zlVJOOnt R0oa748Zaqiaek/pO4b/wkrPYST5Cle13mo5/wgeAmelR2/sQGsGfkVMhxP5UDkZiWm7 VAtg== X-Gm-Message-State: AOAM533bGjiZvxYs6VIbYT/ySX8ad4n4gdZWhXQ4nkNzg/P+eCb/+G+N H5bKwPK6M423lVjeCJDk7O4YPUwSIpU7CWFlJZ4ZdgU7JnT0JRgBvozKRRR5elzHb1Ap2UsOc/d 1E+0eWymMkcvC9Kv5IpzzZoAEIT0ZjhDxiJNHdIuNDg== X-Received: by 2002:a17:906:7946:: with SMTP id l6mr7252011ejo.50.1623962366088; Thu, 17 Jun 2021 13:39:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6weSRED3zNy2KRKlXRcIiLbmE0gKbPC4gxQ1MHUztl0Uzl8YLj3AvWitW5vkquadQ7SxWnA== X-Received: by 2002:a17:906:7946:: with SMTP id l6mr7251992ejo.50.1623962365822; Thu, 17 Jun 2021 13:39:25 -0700 (PDT) Received: from uws.buildd ([2001:67c:1562:8007::aac:44bb]) by smtp.gmail.com with ESMTPSA id lu21sm50623ejb.31.2021.06.17.13.39.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jun 2021 13:39:25 -0700 (PDT) From: Ian May To: kernel-team@lists.ubuntu.com Subject: [SRU][G][PATCH 2/8] UBUNTU: SAUCE: Revert "modules: return licensing information from find_symbol" Date: Thu, 17 Jun 2021 15:39:11 -0500 Message-Id: <20210617203917.1583344-3-ian.may@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210617203917.1583344-1-ian.may@canonical.com> References: <20210617203917.1583344-1-ian.may@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1932065 This reverts commit b43557395d45608d263e785da2cb0c2cb50f94ff. Upstream introduced 'module' patches that removed exported symbols that might cause potential disruption and breakage for customers. Reverting as SAUCE patches to prevent regressions. Signed-off-by: Ian May --- include/linux/module.h | 2 +- kernel/module.c | 16 +++++----------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/include/linux/module.h b/include/linux/module.h index 30b0f5fcdb3c..be04ba2f881d 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -582,7 +582,7 @@ struct module *find_module(const char *name); struct symsearch { const struct kernel_symbol *start, *stop; const s32 *crcs; - enum mod_license { + enum { NOT_GPL_ONLY, GPL_ONLY, WILL_BE_GPL_ONLY, diff --git a/kernel/module.c b/kernel/module.c index f0e8f2c417f9..03e0170a0d65 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -496,7 +496,6 @@ struct find_symbol_arg { struct module *owner; const s32 *crc; const struct kernel_symbol *sym; - enum mod_license license; }; static bool check_exported_symbol(const struct symsearch *syms, @@ -530,7 +529,6 @@ static bool check_exported_symbol(const struct symsearch *syms, fsa->owner = owner; fsa->crc = symversion(syms->crcs, symnum); fsa->sym = &syms->start[symnum]; - fsa->license = syms->license; return true; } @@ -590,7 +588,6 @@ static bool find_exported_symbol_in_section(const struct symsearch *syms, static const struct kernel_symbol *find_symbol(const char *name, struct module **owner, const s32 **crc, - enum mod_license *license, bool gplok, bool warn) { @@ -605,8 +602,6 @@ static const struct kernel_symbol *find_symbol(const char *name, *owner = fsa.owner; if (crc) *crc = fsa.crc; - if (license) - *license = fsa.license; return fsa.sym; } @@ -1080,7 +1075,7 @@ void __symbol_put(const char *symbol) struct module *owner; preempt_disable(); - if (!find_symbol(symbol, &owner, NULL, NULL, true, false)) + if (!find_symbol(symbol, &owner, NULL, true, false)) BUG(); module_put(owner); preempt_enable(); @@ -1358,7 +1353,7 @@ static inline int check_modstruct_version(const struct load_info *info, * locking is necessary -- use preempt_disable() to placate lockdep. */ preempt_disable(); - if (!find_symbol("module_layout", NULL, &crc, NULL, true, false)) { + if (!find_symbol("module_layout", NULL, &crc, true, false)) { preempt_enable(); BUG(); } @@ -1442,7 +1437,6 @@ static const struct kernel_symbol *resolve_symbol(struct module *mod, struct module *owner; const struct kernel_symbol *sym; const s32 *crc; - enum mod_license license; int err; /* @@ -1452,7 +1446,7 @@ static const struct kernel_symbol *resolve_symbol(struct module *mod, */ sched_annotate_sleep(); mutex_lock(&module_mutex); - sym = find_symbol(name, &owner, &crc, &license, + sym = find_symbol(name, &owner, &crc, !(mod->taints & (1 << TAINT_PROPRIETARY_MODULE)), true); if (!sym) goto unlock; @@ -2237,7 +2231,7 @@ void *__symbol_get(const char *symbol) const struct kernel_symbol *sym; preempt_disable(); - sym = find_symbol(symbol, &owner, NULL, NULL, true, true); + sym = find_symbol(symbol, &owner, NULL, true, true); if (sym && strong_try_module_get(owner)) sym = NULL; preempt_enable(); @@ -2273,7 +2267,7 @@ static int verify_exported_symbols(struct module *mod) for (i = 0; i < ARRAY_SIZE(arr); i++) { for (s = arr[i].sym; s < arr[i].sym + arr[i].num; s++) { if (find_symbol(kernel_symbol_name(s), &owner, NULL, - NULL, true, false)) { + true, false)) { pr_err("%s: exports duplicate symbol %s" " (owned by %s)\n", mod->name, kernel_symbol_name(s), From patchwork Thu Jun 17 20:39:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian May X-Patchwork-Id: 1493961 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G5Ynh3Y1qz9sSn; Fri, 18 Jun 2021 06:39:36 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1ltynU-0007st-F6; Thu, 17 Jun 2021 20:39:32 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ltynP-0007py-PA for kernel-team@lists.ubuntu.com; Thu, 17 Jun 2021 20:39:27 +0000 Received: from mail-ed1-f71.google.com ([209.85.208.71]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1ltynP-0004hA-Hy for kernel-team@lists.ubuntu.com; Thu, 17 Jun 2021 20:39:27 +0000 Received: by mail-ed1-f71.google.com with SMTP id ch5-20020a0564021bc5b029039389929f28so2281053edb.16 for ; Thu, 17 Jun 2021 13:39:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=D0CeYcw7B065E3WwVznJ5IDAh60/Uztm0vOB6GaxP40=; b=XY9uUwKmU3TzqZ4NHe6lXRxHp2JGiDoePLoY3dUvFkuTcJ6Fiel1COZopa9ubnA2Ic /ilzDVOphfWYGdltvLEYrMqml+EdE7xMdBaxnktjA2I+v2Ho56O4E41RGH65tayzkeIG pdBV6qzXlB5o3sbWpqOBcP0BVl/yMbsAwqzE6XbnooIsFCIEUfadG2bH2clAkCjBsxx7 Wknk+yU6+YJmpTYrKEpN3hqCpefU6vypfQLshIE8lekewcGMZv+U0lgpcEc9W3/98mC3 Htrg3euplD//4OuSbFxquJsGp3t5IspHJh3p79mPmVBDOyNrw7jHQH8DivqnAn7hytkx qO5A== X-Gm-Message-State: AOAM532dPd6rSjyICGVqNAfSWsgkJFPBBk+j0f8WHn5bMe3aSBYWbBtO GhoNapGYCGftMS+U3dPxGP1SXbnc3RTaC4w4X0piXSmktjFJNSFsK6TlYpstabgQ8lLjDUyUZku ptkbB4xEa/16dCAE0sVYy9l+E8urXQys6oX1XZAV5Hw== X-Received: by 2002:a17:906:9713:: with SMTP id k19mr7380450ejx.516.1623962367195; Thu, 17 Jun 2021 13:39:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzK5n2/VcM/I2idqBGSJqDrWDiv0NvsJoIO5XyE7+4FbpjUyCU5dIvxOTP9JEORf919io046A== X-Received: by 2002:a17:906:9713:: with SMTP id k19mr7380436ejx.516.1623962367010; Thu, 17 Jun 2021 13:39:27 -0700 (PDT) Received: from uws.buildd ([2001:67c:1562:8007::aac:44bb]) by smtp.gmail.com with ESMTPSA id lu21sm50623ejb.31.2021.06.17.13.39.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jun 2021 13:39:26 -0700 (PDT) From: Ian May To: kernel-team@lists.ubuntu.com Subject: [SRU][G][PATCH 3/8] UBUNTU: SAUCE: Revert "modules: rename the licence field in struct symsearch to license" Date: Thu, 17 Jun 2021 15:39:12 -0500 Message-Id: <20210617203917.1583344-4-ian.may@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210617203917.1583344-1-ian.may@canonical.com> References: <20210617203917.1583344-1-ian.may@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1932065 This reverts commit e63bce648bdcd094a42da9bf45a89a68403a0636. Upstream introduced 'module' patches that removed exported symbols that might cause potential disruption and breakage for customers. Reverting as SAUCE patches to prevent regressions. Signed-off-by: Ian May --- include/linux/module.h | 2 +- kernel/module.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/module.h b/include/linux/module.h index be04ba2f881d..b79219eed83c 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -586,7 +586,7 @@ struct symsearch { NOT_GPL_ONLY, GPL_ONLY, WILL_BE_GPL_ONLY, - } license; + } licence; bool unused; }; diff --git a/kernel/module.c b/kernel/module.c index 03e0170a0d65..9ebcdab96b43 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -505,9 +505,9 @@ static bool check_exported_symbol(const struct symsearch *syms, struct find_symbol_arg *fsa = data; if (!fsa->gplok) { - if (syms->license == GPL_ONLY) + if (syms->licence == GPL_ONLY) return false; - if (syms->license == WILL_BE_GPL_ONLY && fsa->warn) { + if (syms->licence == WILL_BE_GPL_ONLY && fsa->warn) { pr_warn("Symbol %s is being used by a non-GPL module, " "which will not be allowed in the future\n", fsa->name); From patchwork Thu Jun 17 20:39:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian May X-Patchwork-Id: 1493962 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G5Ynj6ZF4z9sVt; Fri, 18 Jun 2021 06:39:37 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1ltynV-0007tl-It; Thu, 17 Jun 2021 20:39:33 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ltynQ-0007qm-Sf for kernel-team@lists.ubuntu.com; Thu, 17 Jun 2021 20:39:28 +0000 Received: from mail-ed1-f69.google.com ([209.85.208.69]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1ltynQ-0004hF-LO for kernel-team@lists.ubuntu.com; Thu, 17 Jun 2021 20:39:28 +0000 Received: by mail-ed1-f69.google.com with SMTP id x12-20020a05640226ccb0290393aaa6e811so2292861edd.19 for ; Thu, 17 Jun 2021 13:39:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=K/yfgNFp4nJ9yOQpwVdPzFiggnxErPwPQaFRfpr7hNQ=; b=iUeTwCTi3oxuBDqP7yAOlqOLEDuOy+cyRQP2VLHieGoGEQNLM4h83shdOiUBSTHLlZ tUeah9SBK1pao9kQL9c8vkajCtnZHk+BD59196Rf+2t+bPAo1fDkATvalLH5JYrx5pkB DvCY+pmdLCjTm9jzHKAu5wj0ctVrbhvsMttC7W/QZmCSbxidAX8Sjq6aE4M35OPXCVnS rL6m5sfYXg2/PUYasPZWcgCCwp/4WEuN7jhXL8QrI1ZZXsJ1Fp5hbiKHRzo+loBrOv24 tIMS2eAlVYhY7TxVh4pBURVWPmToRVIZdlRJye+al4zY3LREU6KWCIYB27oJzvNe9XVg WyXw== X-Gm-Message-State: AOAM532OGkIUJzgmj1tOmQFs/y9uNns58vtwNksXDBrTMP0Z6TgQP3H3 mFluKsmX21Is17IKb5NpgnuYKC1KgaYqUtZc4TqpJYH9zMC8fdglvw6P5LaCrwoCMdBjY/2HPp3 jPTD2y7HVhlgjzNgEu3hfXwc9gBOb/OA7PfrpOObbCQ== X-Received: by 2002:a17:907:7ba3:: with SMTP id ne35mr1609804ejc.12.1623962368336; Thu, 17 Jun 2021 13:39:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOQSMGcyLyXw57xKGMPYohdM5A/PaA7rHqIOX4UdWWWURCYS17/KDINtL1A0j/xErpvLy6zg== X-Received: by 2002:a17:907:7ba3:: with SMTP id ne35mr1609791ejc.12.1623962368133; Thu, 17 Jun 2021 13:39:28 -0700 (PDT) Received: from uws.buildd ([2001:67c:1562:8007::aac:44bb]) by smtp.gmail.com with ESMTPSA id lu21sm50623ejb.31.2021.06.17.13.39.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jun 2021 13:39:27 -0700 (PDT) From: Ian May To: kernel-team@lists.ubuntu.com Subject: [SRU][G][PATCH 4/8] UBUNTU: SAUCE: Revert "modules: unexport __module_address" Date: Thu, 17 Jun 2021 15:39:13 -0500 Message-Id: <20210617203917.1583344-5-ian.may@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210617203917.1583344-1-ian.may@canonical.com> References: <20210617203917.1583344-1-ian.may@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1932065 This reverts commit b4eb66555d5fc8487204ad700c7ab0ac4748d06f. Upstream introduced 'module' patches that removed exported symbols that might cause potential disruption and breakage for customers. Reverting as SAUCE patches to prevent regressions. Signed-off-by: Ian May --- kernel/module.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/module.c b/kernel/module.c index 9ebcdab96b43..9529982d11d7 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -4605,6 +4605,7 @@ struct module *__module_address(unsigned long addr) } return mod; } +EXPORT_SYMBOL_GPL(__module_address); /* * is_module_text_address - is this address inside module code? From patchwork Thu Jun 17 20:39:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian May X-Patchwork-Id: 1493963 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G5Ynk5lTYz9sSn; Fri, 18 Jun 2021 06:39:38 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1ltynW-0007ud-Fh; Thu, 17 Jun 2021 20:39:34 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ltynR-0007rF-To for kernel-team@lists.ubuntu.com; Thu, 17 Jun 2021 20:39:29 +0000 Received: from mail-ej1-f69.google.com ([209.85.218.69]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1ltynR-0004hK-Mc for kernel-team@lists.ubuntu.com; Thu, 17 Jun 2021 20:39:29 +0000 Received: by mail-ej1-f69.google.com with SMTP id l6-20020a1709062a86b029046ec0ceaf5cso537473eje.8 for ; Thu, 17 Jun 2021 13:39:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hmdV9fQS8iRiRJxoBAuGnJkJIyeg/tl/F3xskCJrCAU=; b=gmqdCwS8WfT+fYg+oJ3eDF285vQKUSYz/ny+cbTsdvphwgIBQovZbuyRJV7ljBKARq KLb51bsYGZ+PMeoJJQBDEJxudUkk+eGTXR1hcUfKOfRzozNQgGoWi/crLqQWCQR/GOgx THZ8k0WRoPoGvQmaPCSjaXMbNDrgYInXr/BvZNxlZZPTjyAuD5nv+GHLf5EBg9n0O9n3 2mao+EI00us7ZR0+nVzq7hvYSaWWvWdsTzxORlaqvpMgreBX6M9SgX1ey3nouPOarGsU CGkwSpxucwisORB5nX2dn++f842C5Ka7/rQtsixTE+sFfLeok4A+FQ060BzDmunNjW7l k21A== X-Gm-Message-State: AOAM530p4DsMRS7wxijR+aono5tIAmZjkVDHqqv2RkWUML/zAtJQKy8V LsPsPRNBObKAnG70+PPzIzDl3E7sXj3KsRBVxWbo2Gwd8jPx4kadQIsQuhGUkUKqOO0hmus6Kps AawE/Dg8x7YBYyojuxWZdhp0UsfjOP6dQEzehXOkekA== X-Received: by 2002:aa7:d5c6:: with SMTP id d6mr211903eds.290.1623962369441; Thu, 17 Jun 2021 13:39:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwh5DQyGUYYNRdNRuPZ5yPWUikDVt7EVGE1fuYrIFLa1em7Ql56vt0BWoXRX4KPDPFu7mMYGg== X-Received: by 2002:aa7:d5c6:: with SMTP id d6mr211884eds.290.1623962369251; Thu, 17 Jun 2021 13:39:29 -0700 (PDT) Received: from uws.buildd ([2001:67c:1562:8007::aac:44bb]) by smtp.gmail.com with ESMTPSA id lu21sm50623ejb.31.2021.06.17.13.39.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jun 2021 13:39:28 -0700 (PDT) From: Ian May To: kernel-team@lists.ubuntu.com Subject: [SRU][G][PATCH 5/8] UBUNTU: SAUCE: Revert "modules: unexport __module_text_address" Date: Thu, 17 Jun 2021 15:39:14 -0500 Message-Id: <20210617203917.1583344-6-ian.may@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210617203917.1583344-1-ian.may@canonical.com> References: <20210617203917.1583344-1-ian.may@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1932065 This reverts commit 926e81d17c29629ed8713ac8c023270ca97106b2. Upstream introduced 'module' patches that removed exported symbols that might cause potential disruption and breakage for customers. Reverting as SAUCE patches to prevent regressions. Signed-off-by: Ian May --- kernel/module.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/module.c b/kernel/module.c index 9529982d11d7..80d83e68fcb4 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -4644,6 +4644,7 @@ struct module *__module_text_address(unsigned long addr) } return mod; } +EXPORT_SYMBOL_GPL(__module_text_address); /* Don't grab lock, we're oopsing. */ void print_modules(void) From patchwork Thu Jun 17 20:39:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian May X-Patchwork-Id: 1493967 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G5Ynt4Qxxz9sSn; Fri, 18 Jun 2021 06:39:46 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1ltyne-00081w-Lg; Thu, 17 Jun 2021 20:39:42 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ltynT-0007s8-C4 for kernel-team@lists.ubuntu.com; Thu, 17 Jun 2021 20:39:31 +0000 Received: from mail-ed1-f71.google.com ([209.85.208.71]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1ltynT-0004hT-2M for kernel-team@lists.ubuntu.com; Thu, 17 Jun 2021 20:39:31 +0000 Received: by mail-ed1-f71.google.com with SMTP id i19-20020a05640200d3b02903948b71f25cso246052edu.4 for ; Thu, 17 Jun 2021 13:39:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=A1/tNSYh9O5OrrwjZLmHZW1urE0ZnqaUOTFhfiruf+4=; b=WYS8GenQcW87cpZMhci/UGw61zwXr1swJ+56cJt/lrByZfeszzCrxGt5/wMun9Jdne fGtiSVSnLC3NaN+n9AjMEBDlialpbzc1c2tfCHHtEOO8k3heg0uIqCN4N9b9zEVBVGad oeL6T2xfwoVouu8n7X8Rpo7UdSkwZxLciAf/3PkJL1+jzzGdhn7VBJXQf7igD84MwIJ1 hWl3d8tSHg0wBn9aUCvYkyT67RA4LspBhj2brkNpJMKR4KsYmqitVH8o89/ZVaOHuHPu 5oiQ8uKmHvdhUGWMm851vkrMyxDh/AZso4Co0savJaiqXBkmdpceUak1JF9LnMfULNNK 5MIA== X-Gm-Message-State: AOAM532teCo5wLlErts+3c64fvRQYnWP59IwN0QEZC0OhbOm4N9fsPjr qkKbwAQvzwqTs1nyh2ol0ViriS3xG/b7+LqG5F5wz79watZ5TYYZjCT3Eu689+1DFyffLX4GjDE z2CXHbsRvEdeHOUeCVnsFdHpZZdpExVP0I3IXa6cbFg== X-Received: by 2002:a05:6402:40c4:: with SMTP id z4mr214241edb.364.1623962370702; Thu, 17 Jun 2021 13:39:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeD4mZ5I0ewdGb+FdywSEDuURUuXQYB+3d9jRNuKFl2KKGxJlpLb7kWkMstmhqv6mIg9BlZA== X-Received: by 2002:a05:6402:40c4:: with SMTP id z4mr214230edb.364.1623962370522; Thu, 17 Jun 2021 13:39:30 -0700 (PDT) Received: from uws.buildd ([2001:67c:1562:8007::aac:44bb]) by smtp.gmail.com with ESMTPSA id lu21sm50623ejb.31.2021.06.17.13.39.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jun 2021 13:39:30 -0700 (PDT) From: Ian May To: kernel-team@lists.ubuntu.com Subject: [SRU][G][PATCH 6/8] UBUNTU: SAUCE: Revert "modules: mark each_symbol_section static" Date: Thu, 17 Jun 2021 15:39:15 -0500 Message-Id: <20210617203917.1583344-7-ian.may@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210617203917.1583344-1-ian.may@canonical.com> References: <20210617203917.1583344-1-ian.may@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1932065 This reverts commit e3636033dba208822b9df6f472b359d6baa34007. Upstream introduced 'module' patches that removed exported symbols that might cause potential disruption and breakage for customers. Reverting as SAUCE patches to prevent regressions. Signed-off-by: Ian May --- include/linux/module.h | 9 +++++++++ kernel/module.c | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/linux/module.h b/include/linux/module.h index b79219eed83c..90bdc362be36 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -590,6 +590,15 @@ struct symsearch { bool unused; }; +/* + * Walk the exported symbol table + * + * Must be called with module_mutex held or preemption disabled. + */ +bool each_symbol_section(bool (*fn)(const struct symsearch *arr, + struct module *owner, + void *data), void *data); + /* Returns 0 and fills in value, defined and namebuf, or -ERANGE if symnum out of range. */ int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type, diff --git a/kernel/module.c b/kernel/module.c index 80d83e68fcb4..2fbda6d7633f 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -423,7 +423,7 @@ static bool each_symbol_in_section(const struct symsearch *arr, } /* Returns true as soon as fn returns true, otherwise false. */ -static bool each_symbol_section(bool (*fn)(const struct symsearch *arr, +bool each_symbol_section(bool (*fn)(const struct symsearch *arr, struct module *owner, void *data), void *data) @@ -485,6 +485,7 @@ static bool each_symbol_section(bool (*fn)(const struct symsearch *arr, } return false; } +EXPORT_SYMBOL_GPL(each_symbol_section); struct find_symbol_arg { /* Input */ From patchwork Thu Jun 17 20:39:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian May X-Patchwork-Id: 1493965 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G5Ynn0WXkz9sSs; Fri, 18 Jun 2021 06:39:41 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1ltynY-0007wj-Ud; Thu, 17 Jun 2021 20:39:36 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ltynU-0007ss-S5 for kernel-team@lists.ubuntu.com; Thu, 17 Jun 2021 20:39:32 +0000 Received: from mail-ej1-f69.google.com ([209.85.218.69]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1ltynU-0004hZ-87 for kernel-team@lists.ubuntu.com; Thu, 17 Jun 2021 20:39:32 +0000 Received: by mail-ej1-f69.google.com with SMTP id l6-20020a1709062a86b029046ec0ceaf5cso537508eje.8 for ; Thu, 17 Jun 2021 13:39:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5gvaJJzA5WR6F6M0jwQwQ7P4yPWETj2LAz7AoQT5bHU=; b=rq7za/QllkXjga093xU1oGiB9Y+dVbKzr7MORs1MNw9zHbnFT86a65WqybneqJV1Zq QolhYqrqyjwcewjsIel8oNVNhvcarQW1lL0OHU9IyirpVmcCgI+r1VOf9nMc/ce4fqfb eEIUXDGuSd94Kp3f/lnCemAjXOVa41o64bvnoUERyvX154JzeT2iuzNWk99LQG33vkbf ERZMOTA77HJJXQ+pYNHV+NvsKboiYYEo0Hyeg9FcLn6QJUduSBgTmmTsqguPPdwV1YJk BcpAGd/dCaQNQS6hy91tmdmjuuNmsCrLy+QDO2nMqJbAFllqw1JT5s10r13B9uGB3r9I 5dxw== X-Gm-Message-State: AOAM5328JwFQsP0GZrHixUmfnza4Kr2uN3nbwoLiN5a5Ieh+kGBB7Q+/ JcbDcPmit5cHShGh8oO5tU5M6H/WVQSyvevoKw5ngSk0QsTCRETj8rXYd19ImPDVi7jJmBJJtIn /qZMmtI0gDHV28LsvaKjSEY2oMDF2W1F4fLfoK0oznA== X-Received: by 2002:a17:906:a0a:: with SMTP id w10mr7280542ejf.416.1623962371850; Thu, 17 Jun 2021 13:39:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEM1D1PK6DeUEl6VrAdg0x2MeLzFJ0pAHt0n+dvA0Ml1y2ADoz89PrqXn2oK1CS7qfoKwu1g== X-Received: by 2002:a17:906:a0a:: with SMTP id w10mr7280530ejf.416.1623962371652; Thu, 17 Jun 2021 13:39:31 -0700 (PDT) Received: from uws.buildd ([2001:67c:1562:8007::aac:44bb]) by smtp.gmail.com with ESMTPSA id lu21sm50623ejb.31.2021.06.17.13.39.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jun 2021 13:39:31 -0700 (PDT) From: Ian May To: kernel-team@lists.ubuntu.com Subject: [SRU][G][PATCH 7/8] UBUNTU: SAUCE: Revert "modules: mark find_symbol static" Date: Thu, 17 Jun 2021 15:39:16 -0500 Message-Id: <20210617203917.1583344-8-ian.may@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210617203917.1583344-1-ian.may@canonical.com> References: <20210617203917.1583344-1-ian.may@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1932065 This reverts commit 6b06873e4de070dc61a7f343c6f7490bb9bf989d. Upstream introduced 'module' patches that removed exported symbols that might cause potential disruption and breakage for customers. Reverting as SAUCE patches to prevent regressions. Signed-off-by: Ian May --- include/linux/module.h | 11 +++++++++++ kernel/module.c | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/include/linux/module.h b/include/linux/module.h index 90bdc362be36..f1fdbeef2153 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -590,6 +590,17 @@ struct symsearch { bool unused; }; +/* + * Search for an exported symbol by name. + * + * Must be called with module_mutex held or preemption disabled. + */ +const struct kernel_symbol *find_symbol(const char *name, + struct module **owner, + const s32 **crc, + bool gplok, + bool warn); + /* * Walk the exported symbol table * diff --git a/kernel/module.c b/kernel/module.c index 2fbda6d7633f..41d576a23545 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -586,7 +586,7 @@ static bool find_exported_symbol_in_section(const struct symsearch *syms, /* Find an exported symbol and return it, along with, (optional) crc and * (optional) module which owns it. Needs preempt disabled or module_mutex. */ -static const struct kernel_symbol *find_symbol(const char *name, +const struct kernel_symbol *find_symbol(const char *name, struct module **owner, const s32 **crc, bool gplok, @@ -609,6 +609,7 @@ static const struct kernel_symbol *find_symbol(const char *name, pr_debug("Failed to find symbol %s\n", name); return NULL; } +EXPORT_SYMBOL_GPL(find_symbol); /* * Search for module by name: must hold module_mutex (or preempt disabled From patchwork Thu Jun 17 20:39:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian May X-Patchwork-Id: 1493966 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G5Yns5sCgz9sSs; Fri, 18 Jun 2021 06:39:45 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1ltynd-000815-OX; Thu, 17 Jun 2021 20:39:41 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ltynW-0007to-3h for kernel-team@lists.ubuntu.com; Thu, 17 Jun 2021 20:39:34 +0000 Received: from mail-ed1-f71.google.com ([209.85.208.71]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1ltynV-0004he-7j for kernel-team@lists.ubuntu.com; Thu, 17 Jun 2021 20:39:33 +0000 Received: by mail-ed1-f71.google.com with SMTP id q7-20020aa7cc070000b029038f59dab1c5so2293020edt.23 for ; Thu, 17 Jun 2021 13:39:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yFV4YgffERI+o0MTXcvc34bu9nhfkku7bW3CODJcRSI=; b=aCYlXkPpTNXGbAS4RLDCfqavLcwDCVE2qv0D9tKcqsinzTZFnL/M8cpa7NPKUCj/Au r2NzA+JJsYuIcNtPYXmdu9D8iDK+2qPLwvQ8RGCE0Wt4X1cIe9/zAW8h8Xg+wgJJx5GG 3PNGGz08hPwH9GYT2DkWwAn8BkQ4rCliqEi3bH7K65bvybmKT16zacc5Ge+gd/gNC9Lm ArEkHvo9jDCvYNXYX6LYDBThSBnzjBz7nkWpw4slGsr5TKa9G4fkET2H7Xg9RQCv2r06 vCQkS9VI+decOm00HF56Zn4s9y+phBUnxnT8d65QukjG5Sydl8gF5GNfLKnSW2HinHxc EQ4A== X-Gm-Message-State: AOAM533bdDy6Sw9sKcD36vYAgi5MomTiwGCyERnSAs9RTSGtD/Sw9whS 8A/cIgI+nb2SsHNlVzV2kF6M5wv4pKINm+Yc6vys36DHA+fn2ztFcE4BtgXu5NtYmpfORmn6fEU 1p2SoNvIFTMBfDIbKiML7wSOzPiY2ePL3xS85ITXPOA== X-Received: by 2002:a05:6402:51cd:: with SMTP id r13mr224813edd.218.1623962372958; Thu, 17 Jun 2021 13:39:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIlURNU+J1ybSn4Cb+GtdwFPbT/K3cMAVlj4AQ7t48cyuSfXNIJNOy4iBjktx63k4XdaVzag== X-Received: by 2002:a05:6402:51cd:: with SMTP id r13mr224800edd.218.1623962372765; Thu, 17 Jun 2021 13:39:32 -0700 (PDT) Received: from uws.buildd ([2001:67c:1562:8007::aac:44bb]) by smtp.gmail.com with ESMTPSA id lu21sm50623ejb.31.2021.06.17.13.39.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jun 2021 13:39:32 -0700 (PDT) From: Ian May To: kernel-team@lists.ubuntu.com Subject: [SRU][G][PATCH 8/8] UBUNTU: SAUCE: Revert "modules: mark ref_module static" Date: Thu, 17 Jun 2021 15:39:17 -0500 Message-Id: <20210617203917.1583344-9-ian.may@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210617203917.1583344-1-ian.may@canonical.com> References: <20210617203917.1583344-1-ian.may@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1932065 This reverts commit 49ea3be5063837093b76477b67445094b0ad45ef. Upstream introduced 'module' patches that removed exported symbols that might cause potential disruption and breakage for customers. Reverting as SAUCE patches to prevent regressions. Signed-off-by: Ian May --- include/linux/module.h | 1 + kernel/module.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/linux/module.h b/include/linux/module.h index f1fdbeef2153..2e6670860d27 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -657,6 +657,7 @@ static inline void __module_get(struct module *module) #define symbol_put_addr(p) do { } while (0) #endif /* CONFIG_MODULE_UNLOAD */ +int ref_module(struct module *a, struct module *b); /* This is a #define so the string doesn't get put in every .o file */ #define module_name(mod) \ diff --git a/kernel/module.c b/kernel/module.c index 41d576a23545..d619f1d5b36c 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -870,7 +870,7 @@ static int add_module_usage(struct module *a, struct module *b) } /* Module a uses b: caller needs module_mutex() */ -static int ref_module(struct module *a, struct module *b) +int ref_module(struct module *a, struct module *b) { int err; @@ -889,6 +889,7 @@ static int ref_module(struct module *a, struct module *b) } return 0; } +EXPORT_SYMBOL_GPL(ref_module); /* Clear the unload stuff of the module. */ static void module_unload_free(struct module *mod) @@ -1169,10 +1170,11 @@ static inline void module_unload_free(struct module *mod) { } -static int ref_module(struct module *a, struct module *b) +int ref_module(struct module *a, struct module *b) { return strong_try_module_get(b); } +EXPORT_SYMBOL_GPL(ref_module); static inline int module_unload_init(struct module *mod) {