svn commit: r343785 - stable/12/sys/kern

Mark Johnston markj at FreeBSD.org
Tue Feb 5 17:56:23 UTC 2019


Author: markj
Date: Tue Feb  5 17:56:22 2019
New Revision: 343785
URL: https://svnweb.freebsd.org/changeset/base/343785

Log:
  MFC r343784:
  Avoid leaking fp references when truncating SCM_RIGHTS control messages.
  
  Approved by:	so
  Security:	CVE-2019-5596

Modified:
  stable/12/sys/kern/uipc_syscalls.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/kern/uipc_syscalls.c
==============================================================================
--- stable/12/sys/kern/uipc_syscalls.c	Tue Feb  5 17:55:08 2019	(r343784)
+++ stable/12/sys/kern/uipc_syscalls.c	Tue Feb  5 17:56:22 2019	(r343785)
@@ -1607,8 +1607,10 @@ m_dispose_extcontrolm(struct mbuf *m)
 					fd = *fds++;
 					error = fget(td, fd, &cap_no_rights,
 					    &fp);
-					if (error == 0)
+					if (error == 0) {
 						fdclose(td, fp, fd);
+						fdrop(fp, td);
+					}
 				}
 			}
 			clen -= datalen;


More information about the svn-src-stable mailing list