Page MenuHomeFreeBSD

Fix interaction between largepages and seals/writes.
ClosedPublic

Authored by kib on Sep 10 2020, 4:48 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Feb 1, 7:26 PM
Unknown Object (File)
Mon, Jan 16, 4:21 AM
Unknown Object (File)
Jan 3 2023, 2:05 PM
Unknown Object (File)
Dec 28 2022, 1:01 AM
Unknown Object (File)
Dec 24 2022, 3:59 AM
Subscribers

Details

Summary

On write with SHM_GROW_ON_WRITE, use proper truncate.
Do not allow to grow largepage shm if F_SEAL_GROW is set. Note that shrinks are not supported at all due to unmanaged mappings.
Call to vm_pager_update_writecount() is only valid for swap objects, skip it for unmanaged largepages.
Largepages cannot support write sealing.
Do not writecnt largepage mappings.

Reported by: kevans

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 33494

Event Timeline

kib requested review of this revision.Sep 10 2020, 4:48 PM
sys/kern/uipc_shm.c
1610

Doesn't this need to move too?

kib marked an inline comment as done.Sep 10 2020, 5:29 PM
kib added inline comments.
sys/kern/uipc_shm.c
1610

I think a better fix is to reset writecount to false for largepage. And not pass writecnt to shm_mmap_large at all, there is no reason to set MAP_ENTRY_WRITECNT although it is safe as nop for now.

kib marked an inline comment as done.

Do not do writecnt for largepages mmap.

This revision is now accepted and ready to land.Sep 10 2020, 5:47 PM
This revision was automatically updated to reflect the committed changes.