svn commit: r325642 - stable/11/sys/kern
Konstantin Belousov
kib at FreeBSD.org
Fri Nov 10 12:28:45 UTC 2017
Author: kib
Date: Fri Nov 10 12:28:43 2017
New Revision: 325642
URL: https://svnweb.freebsd.org/changeset/base/325642
Log:
MFC r325567:
Zero whole struct ptrace_lwpinfo to not leak kernel stack data.
Security: CVE-2017-1086
Modified:
stable/11/sys/kern/sys_process.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/kern/sys_process.c
==============================================================================
--- stable/11/sys/kern/sys_process.c Fri Nov 10 12:07:56 2017 (r325641)
+++ stable/11/sys/kern/sys_process.c Fri Nov 10 12:28:43 2017 (r325642)
@@ -504,6 +504,7 @@ ptrace_lwpinfo_to32(const struct ptrace_lwpinfo *pl,
struct ptrace_lwpinfo32 *pl32)
{
+ bzero(pl32, sizeof(*pl32));
pl32->pl_lwpid = pl->pl_lwpid;
pl32->pl_event = pl->pl_event;
pl32->pl_flags = pl->pl_flags;
@@ -1316,6 +1317,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi
} else
#endif
pl = addr;
+ bzero(pl, sizeof(*pl));
pl->pl_lwpid = td2->td_tid;
pl->pl_event = PL_EVENT_NONE;
pl->pl_flags = 0;
@@ -1336,8 +1338,6 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi
pl->pl_siginfo = td2->td_si;
}
}
- if ((pl->pl_flags & PL_FLAG_SI) == 0)
- bzero(&pl->pl_siginfo, sizeof(pl->pl_siginfo));
if (td2->td_dbgflags & TDB_SCE)
pl->pl_flags |= PL_FLAG_SCE;
else if (td2->td_dbgflags & TDB_SCX)
More information about the svn-src-all
mailing list