]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r342937:
authorAndrew Turner <andrew@FreeBSD.org>
Mon, 16 Sep 2019 15:00:11 +0000 (15:00 +0000)
committerAndrew Turner <andrew@FreeBSD.org>
Mon, 16 Sep 2019 15:00:11 +0000 (15:00 +0000)
commitc16adfb55ee10866d5b48c1656648ce7e065b721
tree61aabe194f3271f5bbfa6e06107e4c01259b1fcf
parent06910a50c8f52041b6fea90c20bc1e8ed03517f9
MFC r342937:

Fix the location of td->td_frame at the top of the kernel stack.

In cpu_thread_alloc we would allocate space for the trap frame at the top of
the kernel stack. This is just below the pcb, however due to a missing cast
the pointer arithmetic would use the pcb size, not the trapframe size. As
the pcb is larger than the trapframe this is safe, however later in cpu_fork
we include the case leading to the two disagreeing on the location.

Fix by using the same arithmetic in both locations.

Found by: An early KASAN patch
Sponsored by: DARPA, AFRL
sys/arm64/arm64/vm_machdep.c