proc: fork: copy all registers on fork

Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
Michael Shaw 2026-07-27 03:57:11 -04:00
commit 89714dc593

View file

@ -83,7 +83,7 @@ pid_t sys_fork()
*/ */
struct pt_regs *parent_r = current_pt_regs(); struct pt_regs *parent_r = current_pt_regs();
struct pt_regs *child_r = (struct pt_regs *)(ktop - sizeof(struct pt_regs)); struct pt_regs *child_r = (struct pt_regs *)(ktop - sizeof(struct pt_regs));
memcpy(child_r, parent_r, sizeof(struct pt_regs) - sizeof(u64)); memcpy(child_r, parent_r, sizeof(struct pt_regs));
child_r->rax = 0; child_r->rax = 0;
child_r->rdx = parent_r->rsp; child_r->rdx = parent_r->rsp;
*(u64 *)(ktop - 8) = (u64)fork_trampoline; *(u64 *)(ktop - 8) = (u64)fork_trampoline;