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
F162594103: D41475.id126202.diff
Tue, Jul 14, 9:29 PM
Unknown Object (File)
Tue, Jul 14, 7:21 AM
Unknown Object (File)
Mon, Jul 13, 6:47 PM
Unknown Object (File)
Tue, Jul 7, 8:41 PM
Unknown Object (File)
Tue, Jun 30, 11:15 PM
Unknown Object (File)
Fri, Jun 26, 10:17 AM
Unknown Object (File)
Thu, Jun 25, 10:12 PM
Unknown Object (File)
Wed, Jun 24, 4:20 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