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)
Sun, Sep 22, 12:21 AM
Unknown Object (File)
Sun, Sep 22, 12:14 AM
Unknown Object (File)
Sat, Sep 21, 4:54 AM
Unknown Object (File)
Mon, Sep 16, 3:49 PM
Unknown Object (File)
Thu, Sep 5, 11:00 PM
Unknown Object (File)
Thu, Sep 5, 1:35 PM
Unknown Object (File)
Mon, Sep 2, 6:09 PM
Unknown Object (File)
Aug 21 2024, 4:24 PM
Subscribers

Details

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 44293
Build 41181: arc lint + arc unit

Event Timeline

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

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