1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-12 09:58:36 +00:00

Initialize the count of saved register windows to 0 in the pcb created

for the new thread.  The rest of the fields in the pcb wind up being
written to before they're read as a normal part of the pcb usage but
this field may be read upon return to userland, having it be uninitialized
garbage is bad.

Submitted by:	Andrew Belashov (bel at orel dot ru)
Reviewed by:	jake
MFC after:	3 days
This commit is contained in:
Ken Smith 2004-09-27 12:34:47 +00:00
parent eb7b5f46a3
commit 705ea0213d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=135853

View File

@ -141,6 +141,7 @@ cpu_thread_setup(struct thread *td)
pcb = (struct pcb *)((td->td_kstack + td->td_kstack_pages * PAGE_SIZE -
sizeof(struct pcb)) & ~0x3fUL);
pcb->pcb_nsaved = 0;
td->td_frame = (struct trapframe *)pcb - 1;
td->td_pcb = pcb;
}