Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1639555
| Path | csiph.com!goblin1!goblin2!goblin.stu.neva.ru!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| Newsgroups | linux.kernel |
| Subject | [PATCH 4.9 092/103] rtnetlink: NUL-terminate IFLA_PHYS_PORT_NAME string |
| Date | Thu, 11 May 2017 16:30:04 +0200 |
| Message-ID | <tFXgo-7ta-67@gated-at.bofh.it> (permalink) |
| References | <tFXgl-7ta-7@gated-at.bofh.it> |
| X-Mailer | git-send-email 2.12.2 |
| User-Agent | quilt/0.65 |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 36 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, Michal Schmidt <mschmidt@redhat.com>, "David S. Miller" <davem@davemloft.net> |
| X-Original-Date | Thu, 11 May 2017 16:13:01 +0200 |
| X-Original-Message-ID | <20170511141217.708783526@linuxfoundation.org> |
| X-Original-References | <20170511141210.778405364@linuxfoundation.org> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1639555 |
Show key headers only | View raw
4.9-stable review patch. If anyone has any objections, please let me know. ------------------ 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 @@ -1059,7 +1059,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;
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH 4.9 092/103] rtnetlink: NUL-terminate IFLA_PHYS_PORT_NAME string Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-05-11 16:30 +0200
csiph-web