From patchwork Fri Apr 24 18:49:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 11508805 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 205E11575 for ; Fri, 24 Apr 2020 18:49:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 09B5420781 for ; Fri, 24 Apr 2020 18:49:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587754169; bh=mFm/kXQHhsWPpMEmXWij3iYQKwYKbZWlNKUSWFVvDdY=; h=From:To:Cc:Subject:Date:List-ID:From; b=XAM5yBjKBaRAYfRsLJbXRe+wUSdjf1DeSHKJQFUWeRGoY8rmVV7e83KpsSagWO/Wq 3q1kaO58Np0De86NCiZfEBfyqbN1ZEDHSF1ad99r34CAaz7LawoAh29UGBtpaO9kW8 GEDfYI/r/jVkdYa4EOj/sdU5HmKcekI88fDvbnS8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728497AbgDXStU (ORCPT ); Fri, 24 Apr 2020 14:49:20 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:38507 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727022AbgDXStU (ORCPT ); Fri, 24 Apr 2020 14:49:20 -0400 Received: by mail-pf1-f193.google.com with SMTP id y25so5212118pfn.5; Fri, 24 Apr 2020 11:49:20 -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:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dnrdoD7nmACg/ZcofKqMNFF5jN6vuaerLfx/Qx9DPPc=; b=kacqRBdxwzcFxPk43qDM6P0s1HxZZbMkh/Y1WYFhZLOFtVuRujjYLWeFf+fFWTfe/P 8U/5Nu/UdYjYlzt8YntmeBT+bDv12SVBEe5ACyBdJSfkf/D782eG7rNOQYvkBnaBQVDK 5ibhi6LYHgSpisXfg+qBlPrdTsC5S0VQAguhq/FQ2cAL/zRgJugY0Tn7WNlMECvexo8N cZ3bPm230/5/jJ59A7AqRtwGeBRtm/p0kl1JD1Z3Rz5Jk55AHwkdGEEdG8HbSx4ZETVQ gXiYaVgk/+X0sPGWOySkZEGSNiZdjli18uvJDfOLFp7cq2Ll2Vbf3W9w6IOZjFP3q2E5 XD/A== X-Gm-Message-State: AGi0PuZW8/X7s8RovHwLBZnei4syqU2WL4IX/Fg/DiGDLtOr1q9WB7md INTBSEWtzI7XNDJIEkkYal0= X-Google-Smtp-Source: APiQypKS/Krkami4O3Ig5kxq8u0/B8rJ9D1wPXZ5S66dUFNYWrEFGiRqwPOe2N19TWYG+SlCQ0y47g== X-Received: by 2002:aa7:9251:: with SMTP id 17mr10452124pfp.315.1587754159592; Fri, 24 Apr 2020 11:49:19 -0700 (PDT) Received: from 42.do-not-panic.com (42.do-not-panic.com. [157.230.128.187]) by smtp.gmail.com with ESMTPSA id x4sm6334099pfj.76.2020.04.24.11.49.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Apr 2020 11:49:18 -0700 (PDT) Received: by 42.do-not-panic.com (Postfix, from userid 1000) id 99D05403AB; Fri, 24 Apr 2020 18:49:17 +0000 (UTC) From: "Luis R. Rodriguez" To: gregkh@linuxfoundation.org Cc: akpm@linux-foundation.org, josh@joshtriplett.org, rishabhb@codeaurora.org, kubakici@wp.pl, maco@android.com, david.brown@linaro.org, bjorn.andersson@linaro.org, linux-wireless@vger.kernel.org, keescook@chromium.org, shuah@kernel.org, mfuzzey@parkeon.com, zohar@linux.vnet.ibm.com, dhowells@redhat.com, pali.rohar@gmail.com, tiwai@suse.de, arend.vanspriel@broadcom.com, zajec5@gmail.com, nbroeking@me.com, broonie@kernel.org, dmitry.torokhov@gmail.com, dwmw2@infradead.org, torvalds@linux-foundation.org, Abhay_Salunke@dell.com, jewalt@lgsinnovations.com, cantabile.desu@gmail.com, ast@fb.com, andresx7@gmail.com, dan.rue@linaro.org, brendanhiggins@google.com, yzaikin@google.com, sfr@canb.auug.org.au, rdunlap@infradead.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Luis Chamberlain Subject: [PATCH v2 1/2] firmware_loader: revert removal of the fw_fallback_config export Date: Fri, 24 Apr 2020 18:49:15 +0000 Message-Id: <20200424184916.22843-1-mcgrof@kernel.org> X-Mailer: git-send-email 2.23.0.rc1 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Luis Chamberlain Christoph's patch removed two unsused exported symbols, however, one symbol is used by the firmware_loader itself. If CONFIG_FW_LOADER=m so the firmware_loader is modular but CONFIG_FW_LOADER_USER_HELPER=y we fail the build at mostpost. ERROR: modpost: "fw_fallback_config" [drivers/base/firmware_loader/firmware_class.ko] undefined! This happens because the variable fw_fallback_config is built into the kernel if CONFIG_FW_LOADER_USER_HELPER=y always, so we need to grant access to the firmware loader module by exporting it. Revert only one hunk from his patch. Fixes: 739604734bd8e4ad71 ("firmware_loader: remove unused exports") Reported-by: Randy Dunlap Signed-off-by: Luis Chamberlain --- drivers/base/firmware_loader/fallback_table.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/base/firmware_loader/fallback_table.c b/drivers/base/firmware_loader/fallback_table.c index 0a737349f78f..a182e318bd09 100644 --- a/drivers/base/firmware_loader/fallback_table.c +++ b/drivers/base/firmware_loader/fallback_table.c @@ -21,6 +21,7 @@ struct firmware_fallback_config fw_fallback_config = { .loading_timeout = 60, .old_timeout = 60, }; +EXPORT_SYMBOL_GPL(fw_fallback_config); #ifdef CONFIG_SYSCTL struct ctl_table firmware_config_table[] = { From patchwork Fri Apr 24 18:49:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 11508803 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 380BD15AB for ; Fri, 24 Apr 2020 18:49:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 222E221569 for ; Fri, 24 Apr 2020 18:49:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587754167; bh=vkjWNW1oICQEHI4zNCUePLvc/BFCB9ZHWb5Myn6P8+o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=mr7MlP6Jkc/q0gX6Eo/ki++SGdf9zm+lDH3Vn4Y9KYVaF4L+pglBBldwm5FqIDvuK GLznlXM1BNonEchJ7o5lI/6Hg9EGTHW3SEKtYOjbD722cZj38CYDcQ9cZWJyyDQuah NDvOxSsjN6Qv9svqWNF3OkaX7IDx8cuxp/S+wu5s= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729147AbgDXStX (ORCPT ); Fri, 24 Apr 2020 14:49:23 -0400 Received: from mail-pj1-f65.google.com ([209.85.216.65]:38323 "EHLO mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728943AbgDXStV (ORCPT ); Fri, 24 Apr 2020 14:49:21 -0400 Received: by mail-pj1-f65.google.com with SMTP id t40so4226397pjb.3; Fri, 24 Apr 2020 11:49:21 -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:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/KdHtw0iNxBT1mFzOs+kCctxSiinEZ8vRaXskeLEpas=; b=pdaOj6pEaDXTihKXkV73LUwSFoz8TyKEK6IG22e4ovvT2bJnJI1BCM7wwjfBZS1MGZ IjeXc1RPO+T4jelk2RWNA6pZr3l17EqnyNprXCWEQiIYo1hltkw/RlzOkqbNLqfI0jRg wTi4SaorJ02IVol8pZJel+kfUr55m+D04oEVKZPu7u3kGOLWVbG/aJ8cY88yCRygajX1 wJ4SSi+Y367FemwH6srOiR0tyArQaVWqbl5xZhDIgjtfq33t4CCDcfJkVKs0ggeqxIqd WfXHNueca5EsdaC9eK97GMPa0gPoUm7NhNOPypt5hO54LH74fh+LKNEbf49vgtbJnZS+ 04rA== X-Gm-Message-State: AGi0PubAhw311A9egTWKucMfESVaiCqjP2KOvwZIJrVcphEtTi/8Jema tiBwCNWyAlE1grYE2ut2af0= X-Google-Smtp-Source: APiQypIy/NnmBc8N2fwBt1MHd/4L7BZFYNQtg6fsCXmGZgGhKnNZkb3oP0XC/BVldP8PcIiE8PGbIA== X-Received: by 2002:a17:902:8e8b:: with SMTP id bg11mr10147371plb.139.1587754160563; Fri, 24 Apr 2020 11:49:20 -0700 (PDT) Received: from 42.do-not-panic.com (42.do-not-panic.com. [157.230.128.187]) by smtp.gmail.com with ESMTPSA id 14sm6389640pfy.38.2020.04.24.11.49.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Apr 2020 11:49:18 -0700 (PDT) Received: by 42.do-not-panic.com (Postfix, from userid 1000) id AC5244096E; Fri, 24 Apr 2020 18:49:17 +0000 (UTC) From: "Luis R. Rodriguez" To: gregkh@linuxfoundation.org Cc: akpm@linux-foundation.org, josh@joshtriplett.org, rishabhb@codeaurora.org, kubakici@wp.pl, maco@android.com, david.brown@linaro.org, bjorn.andersson@linaro.org, linux-wireless@vger.kernel.org, keescook@chromium.org, shuah@kernel.org, mfuzzey@parkeon.com, zohar@linux.vnet.ibm.com, dhowells@redhat.com, pali.rohar@gmail.com, tiwai@suse.de, arend.vanspriel@broadcom.com, zajec5@gmail.com, nbroeking@me.com, broonie@kernel.org, dmitry.torokhov@gmail.com, dwmw2@infradead.org, torvalds@linux-foundation.org, Abhay_Salunke@dell.com, jewalt@lgsinnovations.com, cantabile.desu@gmail.com, ast@fb.com, andresx7@gmail.com, dan.rue@linaro.org, brendanhiggins@google.com, yzaikin@google.com, sfr@canb.auug.org.au, rdunlap@infradead.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Luis Chamberlain Subject: [PATCH v2 2/2] firmware_loader: move fw_fallback_config to a private kernel symbol namespace Date: Fri, 24 Apr 2020 18:49:16 +0000 Message-Id: <20200424184916.22843-2-mcgrof@kernel.org> X-Mailer: git-send-email 2.23.0.rc1 In-Reply-To: <20200424184916.22843-1-mcgrof@kernel.org> References: <20200424184916.22843-1-mcgrof@kernel.org> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Luis Chamberlain Take advantage of the new kernel symbol namespacing functionality, and export the fw_fallback_config symbol only to a new private firmware loader namespace. This would prevent misuses from other drivers and makes it clear the goal is to keep this private to the firmware loader only. It should also make it clearer for folks git grep'ing for users of the symbol that this exported symbol is private, and prevent future accidental removals of the exported symbol. Signed-off-by: Luis Chamberlain --- drivers/base/firmware_loader/fallback.c | 3 +++ drivers/base/firmware_loader/fallback_table.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/base/firmware_loader/fallback.c b/drivers/base/firmware_loader/fallback.c index 1e9c96e3ed63..d9ac7296205e 100644 --- a/drivers/base/firmware_loader/fallback.c +++ b/drivers/base/firmware_loader/fallback.c @@ -9,6 +9,7 @@ #include #include #include +#include #include "fallback.h" #include "firmware.h" @@ -17,6 +18,8 @@ * firmware fallback mechanism */ +MODULE_IMPORT_NS(FIRMWARE_LOADER_PRIVATE); + extern struct firmware_fallback_config fw_fallback_config; /* These getters are vetted to use int properly */ diff --git a/drivers/base/firmware_loader/fallback_table.c b/drivers/base/firmware_loader/fallback_table.c index a182e318bd09..46a731dede6f 100644 --- a/drivers/base/firmware_loader/fallback_table.c +++ b/drivers/base/firmware_loader/fallback_table.c @@ -21,7 +21,7 @@ struct firmware_fallback_config fw_fallback_config = { .loading_timeout = 60, .old_timeout = 60, }; -EXPORT_SYMBOL_GPL(fw_fallback_config); +EXPORT_SYMBOL_NS_GPL(fw_fallback_config, FIRMWARE_LOADER_PRIVATE); #ifdef CONFIG_SYSCTL struct ctl_table firmware_config_table[] = {