Skip to content

Commit

Permalink
MFC r343784:
Browse files Browse the repository at this point in the history
Avoid leaking fp references when truncating SCM_RIGHTS control messages.

Approved by:	so
Security:	CVE-2019-5596
  • Loading branch information
markjdb committed Feb 5, 2019
1 parent 7ecad8e commit 70e1efc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sys/kern/uipc_syscalls.c
Expand Up @@ -1831,8 +1831,10 @@ m_dispose_extcontrolm(struct mbuf *m)
fd = *fds++;
error = fget(td, fd,
cap_rights_init(&rights), &fp);
if (error == 0)
if (error == 0) {
fdclose(td, fp, fd);
fdrop(fp, td);
}
}
}
clen -= datalen;
Expand Down

0 comments on commit 70e1efc

Please sign in to comment.