Page MenuHomeFreeBSD

vm_map.c: plug several more places which might modify entry->offset
ClosedPublic

Authored by kib on Aug 15 2023, 8:52 PM.
Tags
None
Referenced Files
F132499859: D41475.id.diff
Fri, Oct 17, 10:34 AM
F132499853: D41475.id126051.diff
Fri, Oct 17, 10:34 AM
F132499850: D41475.id126202.diff
Fri, Oct 17, 10:34 AM
Unknown Object (File)
Fri, Oct 17, 1:02 AM
Unknown Object (File)
Thu, Oct 16, 1:03 AM
Unknown Object (File)
Sun, Oct 5, 12:04 AM
Unknown Object (File)
Mon, Sep 22, 7:39 PM
Unknown Object (File)
Sep 1 2025, 2:30 AM
Subscribers

Diff Detail

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

Event Timeline

kib requested review of this revision.Aug 15 2023, 8:52 PM
sys/vm/vm_map.c
1418

Have you tested this change with INVARIANTS set?

It seems that if you don't change root->offset, then you'll have two elements overlap, and that will violate invariants.

sys/vm/vm_map.c
1418

Peter is doing the full test right now. offset is overloaded for stack gap entries, this is the main point of the change.

Are you saying that overloading entry->offset cannot work in principle?

sys/vm/vm_map.c
1418

No, I'm not saying that. I withdraw my question.

Where is the overloading of entry->offset documented?

sys/vm/vm_map.c
1418

The comment above the struct vm_map_entry definition in vm_map.h, and duplicated in vm_map_stack_locked() in the KERN_SUCCESS branch of the last if().

Does the second loop in vm_map_sync() also need a check for stack guards?

Does the second loop in vm_map_sync() also need a check for stack guards?

vm_object_reference()/dereference()/sync() all accept and do nothing if passed obj is NULL.

sys/vm/vm_map.c
1466

Do you need a check here?

sys/vm/vm_map.c
1466

I do not believe so because stack guards are not merge-able. I can add assert.

This revision is now accepted and ready to land.Aug 16 2023, 8:04 PM