Implements memfd sealing, similar to shmem:
- WRITE: deny fallocate(PUNCH_HOLE). mmap() write is denied in
memfd_add_seals(). write() doesn't exist for hugetlbfs.
- SHRINK: added similar check as shmem_setattr()
- GROW: added similar check as shmem_setattr() & shmem_fallocate()
Except write() operation that doesn't exist with hugetlbfs, that should
make sealing as close as it can be to shmem support.
Link: http://firstname.lastname@example.orgSigned-off-by: Marc-André Lureau <email@example.com>
Reviewed-by: Mike Kravetz <firstname.lastname@example.org>
Cc: Andrea Arcangeli <email@example.com>
Cc: Hugh Dickins <firstname.lastname@example.org>
Cc: Michal Hocko <email@example.com>
Cc: David Herrmann <firstname.lastname@example.org>
Signed-off-by: Andrew Morton <email@example.com>
Signed-off-by: Linus Torvalds <firstname.lastname@example.org>