kobj_uevent: Ignore if some listeners cannot handle message
authorMilan Broz <mbroz@redhat.com>
Mon, 22 Aug 2011 13:51:34 +0000 (15:51 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 23 Aug 2011 01:31:24 +0000 (18:31 -0700)
kobject_uevent() uses a multicast socket and should ignore
if one of listeners cannot handle messages or nobody is
listening at all.

Easily reproducible when a process in system is cloned
with CLONE_NEWNET flag.

(See also http://article.gmane.org/gmane.linux.kernel.device-mapper.dm-crypt/5256)

Signed-off-by: Milan Broz <mbroz@redhat.com>
Acked-by: Kay Sievers <kay.sievers@vrfy.org>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
lib/kobject_uevent.c

index 70af0a7f97c0eb4801e177458d182ab6baad2767..ad72a03ce5e96d6b5e84727bf092bdc2ef25641a 100644 (file)
@@ -282,7 +282,7 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
                                                            kobj_bcast_filter,
                                                            kobj);
                        /* ENOBUFS should be handled in userspace */
-                       if (retval == -ENOBUFS)
+                       if (retval == -ENOBUFS || retval == -ESRCH)
                                retval = 0;
                } else
                        retval = -ENOMEM;