Page MenuHomeFreeBSD

Use vmspace->vm_stacktop in place of sv_usrstack in more places.
ClosedPublic

Authored by jhb on Feb 4 2022, 8:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 12, 9:15 AM
Unknown Object (File)
Sat, Oct 26, 6:21 PM
Unknown Object (File)
Sat, Oct 26, 6:21 PM
Unknown Object (File)
Sat, Oct 26, 6:20 PM
Unknown Object (File)
Sat, Oct 26, 6:20 PM
Unknown Object (File)
Sat, Oct 26, 6:00 PM
Unknown Object (File)
Sun, Oct 20, 8:05 PM
Unknown Object (File)
Sep 30 2024, 9:21 PM
Subscribers

Details

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb requested review of this revision.Feb 4 2022, 8:56 PM
sys/kern/kern_resource.c
779

I think this actually needs to be round_page(p->p_vmspace->vm_stacktop).

sys/compat/linux/linux_mmap.c
179

This one might also need the roundup? I guess the stack limit includes the sub-page offset?

sys/compat/linux/linux_mmap.c
179

Yes in principle, though we don't enable stack randomization for Linux processes. Indeed, the stack limit includes the sub-page offset. Though now I wonder if it'd be better to simply store the rounded stack address. I don't think the precise value is used except for setting the initial stack pointer.

sys/compat/linux/linux_mmap.c
179

This isn't easy to do without introducing a new field, since PROC_PS_STRINGS() needs the un-rounded stack top. So for now I think we should just add rounding to this diff.

sys/compat/linux/linux_mmap.c
179

In CheriBSD we have p_psstrings still even after merging the PROC_PS_STRINGS change, but I have removed a local p_usrstack field we used to have and am using vm_stacktop to replace p_usrstack (and these changes are inspired by changes in CheriBSD to remove p_usrstack in favor of vm_stacktop).

This revision is now accepted and ready to land.Feb 14 2022, 3:47 PM