From patchwork Mon Jul 31 08:38:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13334049 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B9DABC001DF for ; Mon, 31 Jul 2023 08:38:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=N96X+/5sv36i5E3wuG9HzE+FQKV7S72zOSbh/jcRdsk=; b=wCKNRzUl8ygRz7 pFVb5kU0YqdkA3r/KVFGDKiu6zT0TKPRbP8uPstlznDxu7nSa8ngboy/RamIFircemKV6iWWjJJbP /NkoboGcT47Z4ZSyljLyo4vEhpold9kHFEPkZNC8exBopr824VVWaVWXuJmzlLSaWjiRkXV6B6Xql 3ubRLv4Tp3BnBbm6Dr82sVm1ZyaTEk47Q3RgXMYhv4dtOHAaKlnNJIGALmd04BFvTfnySqkWxFp/R hxc0rdt1ZowV+g2XsUT+DO2WcrbVQEPOFi+Aia+f6y5ylGALXSOtd6ghbvnVGnA+2vFJ36OtM65i7 QukHGPzovCfmpB0q1h9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qQOQ4-00EYu2-0H; Mon, 31 Jul 2023 08:38:24 +0000 Received: from 2a02-8389-2341-5b80-39d3-4735-9a3c-88d8.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:39d3:4735:9a3c:88d8] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qQOPt-00EYrF-2B; Mon, 31 Jul 2023 08:38:14 +0000 From: Christoph Hellwig To: Luis Chamberlain , Greg Kroah-Hartman , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Ulf Hansson , Yangbo Lu , Joshua Kinard Cc: Daniel Vetter , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org (open list), linux-mmc@vger.kernel.org, netdev@vger.kernel.org, linux-rtc@vger.kernel.org, linux-modules@vger.kernel.org Subject: [PATCH 1/5] ARM/pxa: use EXPORT_SYMBOL_GPL for sharpsl_battery_kick Date: Mon, 31 Jul 2023 10:38:02 +0200 Message-Id: <20230731083806.453036-2-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230731083806.453036-1-hch@lst.de> References: <20230731083806.453036-1-hch@lst.de> MIME-Version: 1.0 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org sharpsl_battery_kick is only used via symbol_get, which was only ever intended for very internal symbols like this one. Use EXPORT_SYMBOL_GPL for it so that symbol_get can enforce only being used on EXPORT_SYMBOL_GPL symbols. Signed-off-by: Christoph Hellwig Acked-by: Arnd Bergmann --- arch/arm/mach-pxa/sharpsl_pm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c index d29bdcd5270e0f..08eec58632c988 100644 --- a/arch/arm/mach-pxa/sharpsl_pm.c +++ b/arch/arm/mach-pxa/sharpsl_pm.c @@ -216,7 +216,7 @@ void sharpsl_battery_kick(void) { schedule_delayed_work(&sharpsl_bat, msecs_to_jiffies(125)); } -EXPORT_SYMBOL(sharpsl_battery_kick); +EXPORT_SYMBOL_GPL(sharpsl_battery_kick); static void sharpsl_battery_thread(struct work_struct *private_) From patchwork Mon Jul 31 08:38:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13334051 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 788B8C04E69 for ; Mon, 31 Jul 2023 08:38:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8LsohNT3CJ2kRpOKKwOxtdX23Hkas5QRz42CIMnNGig=; b=ElmzHU5Kp2ig34 sn8z3+KOMlczBpXd6C0niRr4cdwGr1k60n28w/XJoAxYTepMEY0sD18PtVsWIbbsYtzzY/rt0nxvh 3p1LzN8Zf3MAKVjGWiP+QWJNdqBPwvqYkhZKGwhvO4D/mQhRQ6wbWVQiTHvXhw7cm0hNrxIjI/OjU RdIbJ4nMImwftkoITLjmCbEcO36kIIaYSwYoLNM5tXjwVmNlKeSglCHFrpFJcvi+YsXL6bVwdSv7J knZRE8To5MdJ2KNscZIhWNEfw8QRXmuwjKTcJJ2TaK+4Y1VzmwnpRiiCdyCnSpBERwWLJPE1hX808 VD+ym4nDWYr34QtSNm9w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qQOQ4-00EYuL-1m; Mon, 31 Jul 2023 08:38:24 +0000 Received: from 2a02-8389-2341-5b80-39d3-4735-9a3c-88d8.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:39d3:4735:9a3c:88d8] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qQOPw-00EYrm-34; Mon, 31 Jul 2023 08:38:17 +0000 From: Christoph Hellwig To: Luis Chamberlain , Greg Kroah-Hartman , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Ulf Hansson , Yangbo Lu , Joshua Kinard Cc: Daniel Vetter , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org (open list), linux-mmc@vger.kernel.org, netdev@vger.kernel.org, linux-rtc@vger.kernel.org, linux-modules@vger.kernel.org Subject: [PATCH 2/5] net: enetc: use EXPORT_SYMBOL_GPL for enetc_phc_index Date: Mon, 31 Jul 2023 10:38:03 +0200 Message-Id: <20230731083806.453036-3-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230731083806.453036-1-hch@lst.de> References: <20230731083806.453036-1-hch@lst.de> MIME-Version: 1.0 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org enetc_phc_index is only used via symbol_get, which was only ever intended for very internal symbols like this one. Use EXPORT_SYMBOL_GPL for it so that symbol_get can enforce only being used on EXPORT_SYMBOL_GPL symbols. Signed-off-by: Christoph Hellwig Reviewed-by: Jakub Kicinski --- drivers/net/ethernet/freescale/enetc/enetc_ptp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/freescale/enetc/enetc_ptp.c b/drivers/net/ethernet/freescale/enetc/enetc_ptp.c index 17c097cef7d45f..5243fc03105890 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_ptp.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_ptp.c @@ -8,7 +8,7 @@ #include "enetc.h" int enetc_phc_index = -1; -EXPORT_SYMBOL(enetc_phc_index); +EXPORT_SYMBOL_GPL(enetc_phc_index); static struct ptp_clock_info enetc_ptp_caps = { .owner = THIS_MODULE, From patchwork Mon Jul 31 08:38:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13334050 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EFBAEC41513 for ; Mon, 31 Jul 2023 08:38:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9AmcUtdZ7PkXcRd7b3bwth3703jJmXP2zV/GkjItAsk=; b=K3P2tFtK6zeTWj LeA8ihc5NfWrJcoqeKhETHWe+CLiTTinl6DBPFagsH4M/rlXfkEj+zz7t0teMi8zFn+64luoDRonc FOb29QyvVJ693cZ2JPmM+C5V54Xu7W3NbFYM/6SOKVFk3rggQNazabHssL3Yxu5gY3rwtwzsmKhLH ++z2iDsmE8DS68oIkxFILHO0kZh/gNSg8yngW9DnwFhZMa99a0WTRCqwJGmLYih1ObNL8W2fr8rFt WbTX9Kq/i+aDZv3MhDnT1nTWG6IdaO1J0ol1rrl80Goq0i74qeB3MyUsSq50KrbQr5asDy/nCGnaK c9oK2a6+iw62GQ6YbA0A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qQOQ5-00EYvF-0e; Mon, 31 Jul 2023 08:38:25 +0000 Received: from 2a02-8389-2341-5b80-39d3-4735-9a3c-88d8.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:39d3:4735:9a3c:88d8] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qQOQ0-00EYsE-1O; Mon, 31 Jul 2023 08:38:20 +0000 From: Christoph Hellwig To: Luis Chamberlain , Greg Kroah-Hartman , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Ulf Hansson , Yangbo Lu , Joshua Kinard Cc: Daniel Vetter , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org (open list), linux-mmc@vger.kernel.org, netdev@vger.kernel.org, linux-rtc@vger.kernel.org, linux-modules@vger.kernel.org Subject: [PATCH 3/5] rtc: ds1685: use EXPORT_SYMBOL_GPL for ds1685_rtc_poweroff Date: Mon, 31 Jul 2023 10:38:04 +0200 Message-Id: <20230731083806.453036-4-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230731083806.453036-1-hch@lst.de> References: <20230731083806.453036-1-hch@lst.de> MIME-Version: 1.0 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org ds1685_rtc_poweroff is only used externally via symbol_get, which was only ever intended for very internal symbols like this one. Use EXPORT_SYMBOL_GPL for it so that symbol_get can enforce only being used on EXPORT_SYMBOL_GPL symbols. Signed-off-by: Christoph Hellwig Acked-by: Joshua Kinard --- drivers/rtc/rtc-ds1685.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-ds1685.c b/drivers/rtc/rtc-ds1685.c index 0f707be0eb87fa..04dbf35cf3b706 100644 --- a/drivers/rtc/rtc-ds1685.c +++ b/drivers/rtc/rtc-ds1685.c @@ -1432,7 +1432,7 @@ ds1685_rtc_poweroff(struct platform_device *pdev) unreachable(); } } -EXPORT_SYMBOL(ds1685_rtc_poweroff); +EXPORT_SYMBOL_GPL(ds1685_rtc_poweroff); /* ----------------------------------------------------------------------- */ From patchwork Mon Jul 31 08:38:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13334053 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 67A9AC001DF for ; Mon, 31 Jul 2023 08:39:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lxveKUn1P6C+Ub6bvyS8KNyHFnnwR7kN2YEu0bqAAZY=; b=RmZUrbvyNn8738 nqp1KqMg8iH7hDHaZUQ7WtN9mDc6iimIwBGibSzMPDZVOpb/kc9u7212OweAOX4bpUYnDf+fEc7Y+ 7dn9H7h6Bo5vhnZ4nmz2N40i8VJ/gYlcQjCHK2gjzO2PB+EIdaShkyw4+wAXFQKj+UBtJaO5Ifnd1 Wta02jf3e7Xw44DxcwSYT/Ov5sXZ5t3DxZB6Qa0KhmPJWxZNPHhqJn/fMNZcgF7ykt/7u1LJJbiez mIpnvI5DB/P2M+KH3y0IxYOlM/4l92IqbHcB9/KayvWOoVv6LgYxUOfxZsIqMwriDTGlz9qCy0IY3 SfW0SBP2DZJF00+ME8vQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qQOQW-00EZ6S-1v; Mon, 31 Jul 2023 08:38:52 +0000 Received: from 2a02-8389-2341-5b80-39d3-4735-9a3c-88d8.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:39d3:4735:9a3c:88d8] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qQOQ3-00EYtG-2z; Mon, 31 Jul 2023 08:38:24 +0000 From: Christoph Hellwig To: Luis Chamberlain , Greg Kroah-Hartman , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Ulf Hansson , Yangbo Lu , Joshua Kinard Cc: Daniel Vetter , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org (open list), linux-mmc@vger.kernel.org, netdev@vger.kernel.org, linux-rtc@vger.kernel.org, linux-modules@vger.kernel.org Subject: [PATCH 4/5] mmc: use EXPORT_SYMBOL_GPL for mmc_detect_change Date: Mon, 31 Jul 2023 10:38:05 +0200 Message-Id: <20230731083806.453036-5-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230731083806.453036-1-hch@lst.de> References: <20230731083806.453036-1-hch@lst.de> MIME-Version: 1.0 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org mmc_detect_change is used via symbol_get, which was only ever intended for very internal symbols like this one. Use EXPORT_SYMBOL_GPL for it so that symbol_get can enforce only being used on EXPORT_SYMBOL_GPL symbols. Signed-off-by: Christoph Hellwig --- drivers/mmc/core/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 3d3e0ca5261481..8ffd78fae1e7b9 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -1433,7 +1433,7 @@ void mmc_detect_change(struct mmc_host *host, unsigned long delay) { _mmc_detect_change(host, delay, true); } -EXPORT_SYMBOL(mmc_detect_change); +EXPORT_SYMBOL_GPL(mmc_detect_change); void mmc_init_erase(struct mmc_card *card) { From patchwork Mon Jul 31 08:38:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13334052 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 48CCBC001DF for ; Mon, 31 Jul 2023 08:39:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7xHFvHGg35EgVKuIueU8zHVrybfIuzPDNiQNVJWLZUA=; b=cM4lhEgq9WxxcF E8uEXLTz+iK2zk+b2992DegVqbL9OxdU58dCBbslbwM0eYkv/tDjRN7By4jgh4FM3qKw3lfLi6ICh LPYQVFOOH4UrLll1rWkoOek6v3Tz7smrkXExghM+aCHT7SgZ81S8PA6vDpbjfD7ZyMb/Cke/M9/xS HckWZ/Y9MHhn+JQyMMdKhFgCg2aBYwZk4ieZbjqvjOpNb4GlVxOOc5a2KQaNR8DSkFxZjVjWzrpt5 L+LgcvpNcBAtLpq3N8fsmXeG+Id64YRznpRjagT0v5x5VZkOMenhDmgYvAE51hcDwj5GScvvq3LXN zFAyN6aeN8sWXYqCUFFQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qQOQX-00EZ6k-0F; Mon, 31 Jul 2023 08:38:53 +0000 Received: from 2a02-8389-2341-5b80-39d3-4735-9a3c-88d8.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:39d3:4735:9a3c:88d8] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qQOQ6-00EYvK-1x; Mon, 31 Jul 2023 08:38:26 +0000 From: Christoph Hellwig To: Luis Chamberlain , Greg Kroah-Hartman , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Ulf Hansson , Yangbo Lu , Joshua Kinard Cc: Daniel Vetter , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org (open list), linux-mmc@vger.kernel.org, netdev@vger.kernel.org, linux-rtc@vger.kernel.org, linux-modules@vger.kernel.org Subject: [PATCH 5/5] modules: only allow symbol_get of EXPORT_SYMBOL_GPL modules Date: Mon, 31 Jul 2023 10:38:06 +0200 Message-Id: <20230731083806.453036-6-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230731083806.453036-1-hch@lst.de> References: <20230731083806.453036-1-hch@lst.de> MIME-Version: 1.0 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org It has recently come to my attention that nvidia is circumventing the protection added in 262e6ae7081d ("modules: inherit TAINT_PROPRIETARY_MODULE") by importing exports from their propriertary modules into an allegedly GPL licensed module and then rexporting them. Given that symbol_get was only ever inteded for tightly cooperating modules using very internal symbols it is logical to restrict it to being used on EXPORY_SYMBOL_GPL and prevent nvidia from costly DMCA circumvention of access controls law suites. All symbols except for four used through symbol_get were already exported as EXPORT_SYMBOL_GPL, and the remaining four ones were switched over in the preparation patches. Fixes: 262e6ae7081d ("modules: inherit TAINT_PROPRIETARY_MODULE") Signed-off-by: Christoph Hellwig Reviewed-by: Greg Kroah-Hartman --- kernel/module/internal.h | 1 + kernel/module/main.c | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/kernel/module/internal.h b/kernel/module/internal.h index c8b7b4dcf7820d..add687c2abde8b 100644 --- a/kernel/module/internal.h +++ b/kernel/module/internal.h @@ -93,6 +93,7 @@ struct find_symbol_arg { /* Input */ const char *name; bool gplok; + bool gplonly; bool warn; /* Output */ diff --git a/kernel/module/main.c b/kernel/module/main.c index 59b1d067e52890..85d3f00ca65758 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -281,6 +281,8 @@ static bool find_exported_symbol_in_section(const struct symsearch *syms, if (!fsa->gplok && syms->license == GPL_ONLY) return false; + if (fsa->gplonly && syms->license != GPL_ONLY) + return false; sym = bsearch(fsa->name, syms->start, syms->stop - syms->start, sizeof(struct kernel_symbol), cmp_name); @@ -776,8 +778,9 @@ SYSCALL_DEFINE2(delete_module, const char __user *, name_user, void __symbol_put(const char *symbol) { struct find_symbol_arg fsa = { - .name = symbol, - .gplok = true, + .name = symbol, + .gplok = true, + .gplonly = true, }; preempt_disable(); @@ -1289,14 +1292,18 @@ static void free_module(struct module *mod) void *__symbol_get(const char *symbol) { struct find_symbol_arg fsa = { - .name = symbol, - .gplok = true, - .warn = true, + .name = symbol, + .gplok = true, + .gplonly = true, + .warn = true, }; preempt_disable(); if (!find_symbol(&fsa) || strong_try_module_get(fsa.owner)) { preempt_enable(); + if (fsa.gplonly) + pr_warn("failing symbol_get of non-GPLONLY symbol %s.\n", + symbol); return NULL; } preempt_enable();