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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <526A7CE5.8040205@redhat.com>
Date:	Fri, 25 Oct 2013 16:15:01 +0200
From:	Nikolay Aleksandrov <nikolay@...hat.com>
To:	Francois Romieu <romieu@...zoreil.com>
CC:	David Miller <davem@...emloft.net>, David.Laight@...LAB.COM,
	vfalico@...hat.com, netdev@...r.kernel.org
Subject: Re: [PATCH net] netconsole: fix NULL pointer dereference

On 10/24/2013 10:59 PM, Francois Romieu wrote:
> Nikolay Aleksandrov <nikolay@...hat.com> :
>> On 10/24/2013 07:56 PM, David Miller wrote:
>>> From: "David Laight" <David.Laight@...LAB.COM>
> [...]
>>>> Ditto - might be worth saying:
>>>>     /* Acquire lock to wait for any write_msg() to complete. */
>>>
>>> Something this subtle definitely requires a comment.
>>>
>> Okay, thank you all for the reviews. I will re-submit a v2 with
>> the comment edited.
> 
> "edited" as in "removed" because:
> 1. an irq disabling spinlock loudly states what the intent is ("hey, this
>    netconsole stuff could be concurrently used in irq or softirq context").
> 2. the target_list_lock spinlock itself tells where to look for:
> 
> drivers/net/netconsole.c
> [...]
> /* This needs to be a spinlock because write_msg() cannot sleep */
> static DEFINE_SPINLOCK(target_list_lock);
> 
I thought so too. Although I also mentioned the problem and that it involves
write_msg in the current comment:
+		/* We need to disable the netconsole before cleaning it up
+		 * otherwise we might end up in write_msg() with
+		 * nt->np.dev == NULL and nt->enabled == 1
+		 */

I thought this implies that the spinlock protects us against running with
write_msg().
It's fine by me either way (with or w/o the addition to the comment). It's up to
you Dave, do you still want it explicitly there ?

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ