lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 29 May 2020 01:21:22 +0200 (CEST)
From:   Michal Kubecek <mkubecek@...e.cz>
To:     John Linville <linville@...driver.com>, netdev@...r.kernel.org
Cc:     Andrew Lunn <andrew@...n.ch>,
        Oleksij Rempel <o.rempel@...gutronix.de>
Subject: [PATCH ethtool 03/21] netlink: fix msgbuff_append() helper

As msgbuff_append() only copies protocol payload, i.e. part of the buffer
without netlink and genetlink header, and mnl_nlmsg_get_payload_len() only
subtracts netlink header length, we need to subtract genetlink header
length manually to get correct length of appended data block.

Fixes: 5050607946b6 ("netlink: message buffer and composition helpers")
Reported-by: Andrew Lunn <andrew@...n.ch>
Signed-off-by: Michal Kubecek <mkubecek@...e.cz>
---
 netlink/msgbuff.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/netlink/msgbuff.c b/netlink/msgbuff.c
index 74065709ef7d..216f5b946236 100644
--- a/netlink/msgbuff.c
+++ b/netlink/msgbuff.c
@@ -79,6 +79,7 @@ int msgbuff_append(struct nl_msg_buff *dest, struct nl_msg_buff *src)
 	unsigned int dest_len = MNL_ALIGN(msgbuff_len(dest));
 	int ret;
 
+	src_len -= GENL_HDRLEN;
 	ret = msgbuff_realloc(dest, dest_len + src_len);
 	if (ret < 0)
 		return ret;
-- 
2.26.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ