HomeFreeBSD

shm: correct KPI mistake introduced around memfd_create

Description

shm: correct KPI mistake introduced around memfd_create

When file sealing and shm_open2 were introduced, we should have grown a new
kern_shm_open2 helper that did the brunt of the work with the new interface
while kern_shm_open remains the same. Instead, more complexity was
introduced to kern_shm_open to handle the additional features and consumers
had to keep changing in somewhat awkward ways, and a kern_shm_open2 was
added to wrap kern_shm_open.

Backpedal on this and correct the situation- kern_shm_open returns to the
interface it had prior to file sealing being introduced, and neither
function needs an initial_seals argument anymore as it's handled in
kern_shm_open2 based on the shmflags.

Details

Provenance
kevansAuthored on Jan 5 2020, 4:06 AM
Parents
rG58366f05c08c: shmfd/mmap: restrict maxprot with MAP_SHARED + F_SEAL_WRITE
Branches
Unknown
Tags
Unknown

Event Timeline