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]
Date:	Mon, 31 Mar 2014 17:24:26 -0700
From:	Guenter Roeck <linux@...ck-us.net>
To:	One Thousand Gnomes <gnomes@...rguk.ukuu.org.uk>,
	Harini Katakam <harinik@...inx.com>
CC:	grant.likely@...aro.org, robh+dt@...nel.org, pawel.moll@....com,
	mark.rutland@....com, ijc+devicetree@...lion.org.uk,
	galak@...eaurora.org, rob@...dley.net, michals@...inx.com,
	linux-watchdog@...r.kernel.org, linux-kernel@...r.kernel.org,
	devicetree@...r.kernel.org, linux-doc@...r.kernel.org
Subject: Re: [PATCH 1/2] watchdog: Add Cadence WDT driver

On 03/31/2014 03:30 AM, One Thousand Gnomes wrote:
>
>> +	wdt->cdns_wdt_notifier.notifier_call = &cdns_wdt_notify_sys;
>> +	/* Register the reboot notifier */
>> +	ret = register_reboot_notifier(&wdt->cdns_wdt_notifier);
>> +	if (ret != 0) {
>> +		dev_err(&pdev->dev, "cannot register reboot notifier err=%d)\n",
>> +			ret);
>> +		return ret;
>
> Your ordering is wrong. If the box reboots between here and the spin lock
> in it further down it'll crash in your notifier.
>
Not only that, the callback also ends up using watchdog_get_drvdata()
which is only set after registering the notifier.

Guenter

> As
>
>> +	spin_lock_init(&wdt->io_lock);
>
> is needed before the code your notifier calls will work.
>
>> +	dev_info(&pdev->dev, "Xilinx Watchdog Timer at %p with timeout %ds%s\n",
>> +		 wdt->regs, cdns_wdt_device->timeout,
>> +		 nowayout ? ", nowayout" : "");
>
> dev_dbg
>
> if every driver felt the need to announce itself on boot you'd have pages
> and pages of junk.
>
> Alan
> --
> To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>

--
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