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: <20150208065952.GC3670@norris-Latitude-E6410>
Date:	Sat, 7 Feb 2015 22:59:52 -0800
From:	Brian Norris <computersforpeace@...il.com>
To:	Niklas Cassel <nks@...wful.org>
Cc:	dwmw2@...radead.org, linux-mtd@...ts.infradead.org,
	linux-kernel@...r.kernel.org,
	Ricard Wanderlof <ricard.wanderlof@...s.com>
Subject: Re: [PATCH] mtd: avoid registering reboot notifier twice

On Sun, Feb 01, 2015 at 02:08:50AM +0100, Niklas Cassel wrote:
> Calling mtd_device_parse_register with the same mtd_info
> (e.g. registering several partitions on a single device)
> would add the same reboot notifier twice, causing an
> infinte loop in notifier_chain_register during boot up.
> 
> Signed-off-by: Niklas Cassel <nks@...wful.org>

Begrudgingly applied to l2-mtd.git. It's better to fix this bug than for
me just to complain about badly written board files and drivers...

> ---
>  drivers/mtd/mtdcore.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
> index de79576..98efc1e 100644
> --- a/drivers/mtd/mtdcore.c
> +++ b/drivers/mtd/mtdcore.c
> @@ -556,7 +556,7 @@ int mtd_device_parse_register(struct mtd_info *mtd, const char * const *types,
>  			err = -ENODEV;
>  	}
>  

Also added a FIXME comment here to note that some drivers are doing odd
things to require this workaround.

> -	if (mtd->_reboot) {
> +	if (mtd->_reboot && !mtd->reboot_notifier.notifier_call) {
>  		mtd->reboot_notifier.notifier_call = mtd_reboot_notifier;
>  		register_reboot_notifier(&mtd->reboot_notifier);
>  	}

Brian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ