[PATCH 1/5] multipath-tools: Fix uevent handling code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Multipathd wasn't setting buflen when it read in a uevent message.  This was
causing buflen to be used unitialized, and would often keep multipathd from
processing uevents.  This patch correctly initializes buflen to the size of the
buffer received.

Signed-off-by: Benjamin Marzinski <bmarzins@xxxxxxxxxx>
---
 libmultipath/uevent.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Index: multipath-tools/libmultipath/uevent.c
===================================================================
--- multipath-tools.orig/libmultipath/uevent.c
+++ multipath-tools/libmultipath/uevent.c
@@ -231,7 +231,8 @@ int uevent_listen(int (*uev_trigger)(str
 		smsg.msg_control = cred_msg;
 		smsg.msg_controllen = sizeof(cred_msg);
 
-		if (recvmsg(sock, &smsg, 0) < 0) {
+		buflen = recvmsg(sock, &smsg, 0);
+		if (buflen < 0) {
 			if (errno != EINTR)
 				condlog(0, "error receiving message");
 			continue;
@@ -286,8 +287,10 @@ int uevent_listen(int (*uev_trigger)(str
 		/* action string */
 		uev->action = buffer;
 		pos = strchr(buffer, '@');
-		if (!pos)
+		if (!pos) {
+			condlog(3, "bad action string '%s'", buffer);
 			continue;
+		}
 		pos[0] = '\0';
 
 		/* sysfs path */

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel

[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux