]> git.baikalelectronics.ru Git - kernel.git/commit
Tools: hv: correct payload size in netlink_send
authorOlaf Hering <olaf@aepfle.de>
Wed, 7 Aug 2013 13:07:21 +0000 (15:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 12 Aug 2013 22:44:57 +0000 (15:44 -0700)
commitf92d173e22ae924025c2a457cf6e5429466fc39e
treed4d4b6e5554887ee55d7340f3251757bb8992d21
parent6dbf10e6d11b59298f19bb4a15ca457c1976415f
Tools: hv: correct payload size in netlink_send

netlink_send is supposed to send just the cn_msg+hv_kvp_msg via netlink.
Currently it sets an incorrect iovec size, as reported by valgrind.

In the case of registering with the kernel the allocated buffer is large
enough to hold nlmsghdr+cn_msg+hv_kvp_msg, no overrun happens. In the
case of responding to the kernel the cn_msg is located in the middle of
recv_buffer, after the nlmsghdr. Currently the code in netlink_send adds
also the size of nlmsghdr to the payload. But nlmsghdr is a separate
iovec. This leads to an (harmless) out-of-bounds access when the kernel
processes the iovec. Correct the iovec size of the cn_msg to be just
cn_msg + its payload.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/hv/hv_kvp_daemon.c
tools/hv/hv_vss_daemon.c