diff options
author | Paul Boca <pboca@cloudbasesolutions.com> | 2016-04-27 08:05:47 +0000 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2016-05-16 22:04:58 -0700 |
commit | e6b298ef73816355e94e22a7df0cd28414957087 (patch) | |
tree | 502a15bcf85497676f561f13e5fcb8b98dd19e67 /lib/netlink-socket.c | |
parent | 59936df6f45cf554ca201a08d8335af04d82a82c (diff) | |
download | openvswitch-e6b298ef73816355e94e22a7df0cd28414957087.tar.gz |
datapath-windows: Validate Netlink packets' integrity.
Solved access violation when trying to access Netlink message - obtained
with forged IOCTLs.
Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'lib/netlink-socket.c')
-rw-r--r-- | lib/netlink-socket.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/netlink-socket.c b/lib/netlink-socket.c index cad949096..32b0cc34c 100644 --- a/lib/netlink-socket.c +++ b/lib/netlink-socket.c @@ -127,6 +127,7 @@ nl_sock_create(int protocol, struct nl_sock **sockp) sock = xmalloc(sizeof *sock); #ifdef _WIN32 + sock->overlapped.hEvent = NULL; sock->handle = CreateFile(OVS_DEVICE_NAME_USER, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, @@ -1191,6 +1192,7 @@ pend_io_request(struct nl_sock *sock) ovs_header = ofpbuf_put_uninit(&request, sizeof *ovs_header); ovs_header->dp_ifindex = 0; + nlmsg->nlmsg_len = request.size; if (!DeviceIoControl(sock->handle, OVS_IOCTL_WRITE, request.data, request.size, |