lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <86b73242-94bb-4537-92ec-51da02127848@app.fastmail.com>
Date:   Mon, 31 Jul 2023 18:12:22 +0200
From:   "Arnd Bergmann" <arnd@...db.de>
To:     "Christoph Hellwig" <hch@....de>,
        "Luis Chamberlain" <mcgrof@...nel.org>,
        "Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
        "Daniel Mack" <daniel@...que.org>,
        "Haojian Zhuang" <haojian.zhuang@...il.com>,
        "Robert Jarzmik" <robert.jarzmik@...e.fr>,
        "Ulf Hansson" <ulf.hansson@...aro.org>,
        "Yangbo Lu" <yangbo.lu@....com>, "Joshua Kinard" <kumba@...too.org>
Cc:     "Daniel Vetter" <daniel.vetter@...ll.ch>,
        linux-arm-kernel@...ts.infradead.org,
        "open list" <linux-kernel@...r.kernel.org>,
        "linux-mmc @ vger . kernel . org" <linux-mmc@...r.kernel.org>,
        Netdev <netdev@...r.kernel.org>, linux-rtc@...r.kernel.org,
        linux-modules@...r.kernel.org
Subject: Re: [PATCH 1/5] ARM/pxa: use EXPORT_SYMBOL_GPL for sharpsl_battery_kick

On Mon, Jul 31, 2023, at 10:38, Christoph Hellwig wrote:
> 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 <hch@....de>

The reasoning makes sense, and the patch looks good, so feel
free to take this through your tree.

Acked-by: Arnd Bergmann <arnd@...db.de>

Or let me know if you want a better fix. Since sharpsl_pm.c and
spitz.c are no longer loadable modules and just get linked together
these days, I think the variant below would be simpler (this could
be cleanup up further, endlessly, of course):

--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -518,17 +518,6 @@ static struct gpiod_lookup_table spitz_ads7846_gpio_table = {
        },
 };
 
-static void spitz_bl_kick_battery(void)
-{
-       void (*kick_batt)(void);
-
-       kick_batt = symbol_get(sharpsl_battery_kick);
-       if (kick_batt) {
-               kick_batt();
-               symbol_put(sharpsl_battery_kick);
-       }
-}
-
 static struct gpiod_lookup_table spitz_lcdcon_gpio_table = {
        .dev_id = "spi2.1",
        .table = {
@@ -556,7 +545,7 @@ static struct corgi_lcd_platform_data spitz_lcdcon_info = {
        .max_intensity          = 0x2f,
        .default_intensity      = 0x1f,
        .limit_mask             = 0x0b,
-       .kick_battery           = spitz_bl_kick_battery,
+       .kick_battery           = sharpsl_battery_kick,
 };
 
 static struct spi_board_info spitz_spi_devices[] = {

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ