Wrapfs: port to new user_namespace and mmap APIs
authorErez Zadok <ezk@cs.sunysb.edu>
Fri, 13 May 2022 23:02:31 +0000 (19:02 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Fri, 13 May 2022 23:02:31 +0000 (19:02 -0400)
commit0f12a0241078960dcc7a3b195159cb8c669d2586
treef952525ab668d09ee19936e50de545d203aff31c
parenta71e7972f7d175cdbdd1ddc84f1910b5ed18b950
Wrapfs: port to new user_namespace and mmap APIs

New struct user_namespace arg is now passed to many VFS ops.  See details
here: https://lwn.net/Articles/842423.  Like eCryptfs, we can't currently
stack on top of idmapped file systems, so check for it at mount and
prohibit.  Instead, we use the default init_user_ns global

Also at mount, we prohibit mount on top of another wrapfs mount, due to
known incompatibilities.

mmap ops ->fault and ->page_mkwrite take a different vma struct with some
const args, so extract the right fields as needed.

Signed-off-by: Andrew Burford <aburford@cs.stonybrook.edu>
Signed-off-by: Erez Zadok <ezk@cs.stonybrook.edu>
fs/wrapfs/inode.c
fs/wrapfs/main.c
fs/wrapfs/mmap.c