summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_syscalls.c
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2016-05-17 22:28:27 +0000
committerglebius <glebius@FreeBSD.org>2016-05-17 22:28:27 +0000
commit8a232783c3444677eb1faa3048123dda21767094 (patch)
treeccd86deeb58379db2f326456a2e165b650a17e07 /sys/kern/uipc_syscalls.c
parent1fbf92c3ea82371bfc10d47cb9dc715a18f1287b (diff)
downloadFreeBSD-src-8a232783c3444677eb1faa3048123dda21767094.zip
FreeBSD-src-8a232783c3444677eb1faa3048123dda21767094.tar.gz
- Use unsigned version of min() when handling arguments of SETFKEY ioctl.
- Validate that user supplied control message length in sendmsg(2) is not negative. Security: SA-16:18 Security: CVE-2016-1886 Security: SA-16:19 Security: CVE-2016-1887 Submitted by: C Turt <cturt hardenedbsd.org> Approved by: so
Diffstat (limited to 'sys/kern/uipc_syscalls.c')
-rw-r--r--sys/kern/uipc_syscalls.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index fa36849..97ca115 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -1787,6 +1787,9 @@ sockargs(mp, buf, buflen, type)
struct mbuf *m;
int error;
+ if (buflen < 0)
+ return (EINVAL);
+
if (buflen > MLEN) {
#ifdef COMPAT_OLDSOCK
if (type == MT_SONAME && buflen <= 112)
OpenPOWER on IntegriCloud