Skip to content

Commit

Permalink
Validate that user supplied control message length is not negative.
Browse files Browse the repository at this point in the history
Submitted by:	C Turt <cturt hardenedbsd.org>
Security:	SA-16:19
Security:	CVE-2016-1887
  • Loading branch information
glebius committed May 17, 2016
1 parent 1d7ec4d commit 5e838e0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sys/kern/uipc_syscalls.c
Expand Up @@ -1699,6 +1699,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)
Expand Down

0 comments on commit 5e838e0

Please sign in to comment.