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
F173157883: D34174.id102387.diff
Thu, Sep 24, 12:22 AM
F173156306: D34174.id102505.diff
Thu, Sep 24, 12:07 AM
F173156288: D34174.id102752.diff
Thu, Sep 24, 12:07 AM
F173156197: D34174.diff
Thu, Sep 24, 12:06 AM
Unknown Object (File)
Thu, Sep 17, 9:28 AM
Unknown Object (File)
Mon, Sep 14, 2:24 PM
Unknown Object (File)
Fri, Sep 11, 3:51 AM
Unknown Object (File)
Tue, Sep 8, 7:03 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