diff options
author | Timo Teräs <timo.teras@iki.fi> | 2015-07-28 11:33:38 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2015-07-28 11:35:47 +0300 |
commit | fc1ceeb02b3e149645205e67bcc009e742140590 (patch) | |
tree | b559837b40485a7c0f77ce6459c03f131191283d /main/strongswan/0101-kernel-netlink-Actually-verify-if-the-netlink-messag.patch | |
parent | c3aa1460dbeb4e1e10972fc00314d7a80413707e (diff) | |
download | aports-fc1ceeb02b3e149645205e67bcc009e742140590.tar.bz2 aports-fc1ceeb02b3e149645205e67bcc009e742140590.tar.xz |
main/strongswan: cherry-pick upstream fixes
also fixes a minor memory leak in patch 1001 (the offending hunk is
now just deleted, as other upstream commits fixed the issue it tried
to address)
Diffstat (limited to 'main/strongswan/0101-kernel-netlink-Actually-verify-if-the-netlink-messag.patch')
-rw-r--r-- | main/strongswan/0101-kernel-netlink-Actually-verify-if-the-netlink-messag.patch | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/main/strongswan/0101-kernel-netlink-Actually-verify-if-the-netlink-messag.patch b/main/strongswan/0101-kernel-netlink-Actually-verify-if-the-netlink-messag.patch new file mode 100644 index 0000000000..945f1da2b0 --- /dev/null +++ b/main/strongswan/0101-kernel-netlink-Actually-verify-if-the-netlink-messag.patch @@ -0,0 +1,31 @@ +From e0e3b6d92b37ba6633a9cd7f0ed2bd3ce56fdcc0 Mon Sep 17 00:00:00 2001 +From: Tobias Brunner <tobias@strongswan.org> +Date: Thu, 16 Jul 2015 11:43:44 +0200 +Subject: [PATCH] kernel-netlink: Actually verify if the netlink message + exceeds the buffer size + +It might equal it and that's fine. With MSG_TRUNC we get the actual +message size and can only report an error if we haven't received the +complete message. +--- + src/libhydra/plugins/kernel_netlink/kernel_netlink_shared.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/libhydra/plugins/kernel_netlink/kernel_netlink_shared.c b/src/libhydra/plugins/kernel_netlink/kernel_netlink_shared.c +index b0e3103..809d0f4 100644 +--- a/src/libhydra/plugins/kernel_netlink/kernel_netlink_shared.c ++++ b/src/libhydra/plugins/kernel_netlink/kernel_netlink_shared.c +@@ -185,8 +185,8 @@ static ssize_t read_msg(private_netlink_socket_t *this, + return -1; + } + } +- len = recv(this->socket, buf, buflen, block ? 0 : MSG_DONTWAIT); +- if (len == buflen) ++ len = recv(this->socket, buf, buflen, (block ? 0 : MSG_DONTWAIT)|MSG_TRUNC); ++ if (len > buflen) + { + DBG1(DBG_KNL, "netlink response exceeds buffer size"); + return 0; +-- +2.4.6 + |