All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch "rtnetlink: NUL-terminate IFLA_PHYS_PORT_NAME string" has been added to the 4.4-stable tree
@ 2017-05-11 10:48 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-05-11 10:48 UTC (permalink / raw)
  To: mschmidt, davem, gregkh; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    rtnetlink: NUL-terminate IFLA_PHYS_PORT_NAME string

to the 4.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     rtnetlink-nul-terminate-ifla_phys_port_name-string.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From foo@baz Thu May 11 12:38:23 CEST 2017
From: Michal Schmidt <mschmidt@redhat.com>
Date: Thu, 4 May 2017 16:48:58 +0200
Subject: rtnetlink: NUL-terminate IFLA_PHYS_PORT_NAME string

From: Michal Schmidt <mschmidt@redhat.com>


[ Upstream commit 77ef033b687c3e030017c94a29bf6ea3aaaef678 ]

IFLA_PHYS_PORT_NAME is a string attribute, so terminate it with \0.
Otherwise libnl3 fails to validate netlink messages with this attribute.
"ip -detail a" assumes too that the attribute is NUL-terminated when
printing it. It often was, due to padding.

I noticed this as libvirtd failing to start on a system with sfc driver
after upgrading it to Linux 4.11, i.e. when sfc added support for
phys_port_name.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/core/rtnetlink.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1018,7 +1018,7 @@ static int rtnl_phys_port_name_fill(stru
 		return err;
 	}
 
-	if (nla_put(skb, IFLA_PHYS_PORT_NAME, strlen(name), name))
+	if (nla_put_string(skb, IFLA_PHYS_PORT_NAME, name))
 		return -EMSGSIZE;
 
 	return 0;


Patches currently in stable-queue which might be from mschmidt@redhat.com are

queue-4.4/rtnetlink-nul-terminate-ifla_phys_port_name-string.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-05-11 10:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-11 10:48 Patch "rtnetlink: NUL-terminate IFLA_PHYS_PORT_NAME string" has been added to the 4.4-stable tree gregkh

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.