All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Marzinski <bmarzins@redhat.com>
To: device-mapper development <dm-devel@redhat.com>
Subject: [PATCH 1/5] multipath-tools: Fix uevent handling code
Date: Mon, 3 Aug 2009 16:59:05 -0500	[thread overview]
Message-ID: <20090803215904.GR15326@ether.msp.redhat.com> (raw)

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@redhat.com>
---
 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 */

                 reply	other threads:[~2009-08-03 21:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090803215904.GR15326@ether.msp.redhat.com \
    --to=bmarzins@redhat.com \
    --cc=dm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.