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] [day] [month] [year] [list]
Message-ID: <6b6e7d3e-7219-4459-b177-1e4123c531be@gmail.com>
Date: Thu, 20 Nov 2025 12:48:45 +0100
From: Johannes Thumshirn <morbidrsa@...il.com>
To: Jose Javier Rodriguez Barbarin <dev-josejavier.rodriguez@...gon.com>,
 gregkh@...uxfoundation.org
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mcb: Fix incorrect sanity check

On 11/20/25 12:37 PM, Jose Javier Rodriguez Barbarin wrote:
> __mcb_register_driver() makes some sanity checks over mcb_driver
> to check if .probe and .remove callbacks are set. However, not all
> mcb device drivers implement .remove callback.
>
> Remove .remove check to ensure all mcb device drivers can be loaded.

The only driver I can see that doesn't implement a .remove method is 
gpio-menz127.c.

Is this safe?


>
> Signed-off-by: Jose Javier Rodriguez Barbarin <dev-josejavier.rodriguez@...gon.com>
> ---
>   drivers/mcb/mcb-core.c | 9 +++++----
>   1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mcb/mcb-core.c b/drivers/mcb/mcb-core.c
> index c1367223e71a..3d487d75c483 100644
> --- a/drivers/mcb/mcb-core.c
> +++ b/drivers/mcb/mcb-core.c
> @@ -85,7 +85,8 @@ static void mcb_remove(struct device *dev)
>   	struct mcb_device *mdev = to_mcb_device(dev);
>   	struct module *carrier_mod;
>   
> -	mdrv->remove(mdev);
> +	if (mdrv->remove)
> +		mdrv->remove(mdev);
>   
>   	carrier_mod = mdev->dev.parent->driver->owner;
>   	module_put(carrier_mod);
> @@ -176,13 +177,13 @@ static const struct device_type mcb_carrier_device_type = {
>    * @owner: The @mcb_driver's module
>    * @mod_name: The name of the @mcb_driver's module
>    *
> - * Register a @mcb_driver at the system. Perform some sanity checks, if
> - * the .probe and .remove methods are provided by the driver.
> + * Register a @mcb_driver at the system. Perform a sanity check, if
> + * .probe method is provided by the driver.
>    */
>   int __mcb_register_driver(struct mcb_driver *drv, struct module *owner,
>   			const char *mod_name)
>   {
> -	if (!drv->probe || !drv->remove)
> +	if (!drv->probe)
>   		return -EINVAL;
>   
>   	drv->driver.owner = owner;



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ