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: <4F567E1C.80003@gmail.com>
Date:	Wed, 07 Mar 2012 01:14:04 +0400
From:	"avagin@...il.com" <avagin@...il.com>
To:	Kay Sievers <kay.sievers@...y.org>
CC:	Andrew Vagin <avagin@...nvz.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	linux-hotplug@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] uevent: send events in correct order according to seqnum

On 03/07/2012 01:03 AM, Kay Sievers wrote:
> On Tue, Mar 6, 2012 at 21:06, Andrew Vagin<avagin@...nvz.org>  wrote:
>>
>> The queue handling in the udev daemon assumes that the events are
>> ordered.
>>
>> Before this patch uevent_seqnum is incremented under sequence_lock,
>> than an event is send uner uevent_sock_mutex. I want to say that code
>> contained a window between incrementing seqnum and sending an event.
>>
>> This patch locks uevent_sock_mutex before incrementing uevent_seqnum.
>
> I think we can remove the spin_lock(&sequence_lock); entirely now, right?

I thought about that too. sequence_lock is used when CONFIG_NET isn't 
defined. I've looked on this code one more time and we may leave only 
uevent_sock_mutex and use it even when CONFIG_NET isn't defined.
Thanks for the comment.

Greg, do you have other objections about this patch?

>
> Also the section with:
>    seq = ++uevent_seqnum;
> can just be:
>    add_uevent_var(env, "SEQNUM=%llu", (unsigned long long) ++uevent_seqnum);
> right?
>
> And the:
>    mutex_lock(&uevent_sock_mutex);
> can just move outside of the _NET ifdef and we always use the mutex
> instead of the spinlock?
>
> That could look much simpler than the current code, I think.
>
> Thanks,
> Kay

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