avoid kernel stack data leak in core dump thrmisc note
bzero the entire thrmisc struct, not just the padding. Other core dump notes are already done this way. Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com> Reviewed by: markj MFC after: 3 days Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
c09aa2145a
commit
2e5f9189bb
@ -2229,7 +2229,7 @@ __elfN(note_thrmisc)(void *arg, struct sbuf *sb, size_t *sizep)
|
|||||||
td = (struct thread *)arg;
|
td = (struct thread *)arg;
|
||||||
if (sb != NULL) {
|
if (sb != NULL) {
|
||||||
KASSERT(*sizep == sizeof(thrmisc), ("invalid size"));
|
KASSERT(*sizep == sizeof(thrmisc), ("invalid size"));
|
||||||
bzero(&thrmisc._pad, sizeof(thrmisc._pad));
|
bzero(&thrmisc, sizeof(thrmisc));
|
||||||
strcpy(thrmisc.pr_tname, td->td_name);
|
strcpy(thrmisc.pr_tname, td->td_name);
|
||||||
sbuf_bcat(sb, &thrmisc, sizeof(thrmisc));
|
sbuf_bcat(sb, &thrmisc, sizeof(thrmisc));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user