]> www.infradead.org Git - users/jedix/linux-maple.git/commit
uevent: send events in correct order according to seqnum (v3)
authorAndrew Vagin <avagin@openvz.org>
Wed, 7 Mar 2012 10:49:56 +0000 (14:49 +0400)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Thu, 12 Apr 2012 22:14:36 +0000 (15:14 -0700)
commit10df82a2527f63009e355395c6785744bd6c59c0
tree74742d4e639cdd3c16e1ad9f1db90f4dbffb87bc
parent2181695bb9eca843ac7d8f0ce51e4cfc6383289a
uevent: send events in correct order according to seqnum (v3)

commit 7b60a18da393ed70db043a777fd9e6d5363077c4 upstream.

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.

v2: delete sequence_lock, uevent_seqnum is protected by uevent_sock_mutex
v3: unlock the mutex before the goto exit

Thanks for Kay for the comments.

Signed-off-by: Andrew Vagin <avagin@openvz.org>
Tested-By: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
lib/kobject_uevent.c