2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

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>
This commit is contained in:
Paul Boca
2016-04-27 08:05:47 +00:00
committed by Ben Pfaff
parent 59936df6f4
commit e6b298ef73
7 changed files with 152 additions and 55 deletions

View File

@@ -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,