• Jamie Liu's avatar
    criu: fix filemap open permissions · efe594f8
    Jamie Liu authored
    An mmaped file is opened O_RDONLY or O_RDWR depending on the permissions
    on the first vma dump_task_mm() encounters mapping that file. This
    causes two problems:
    
    1. If a file has multiple MAP_SHARED mappings, some of which are
       read-only and some of which are read-write, and the first encountered
       mapping happens to be read-only, the file will be opened O_RDONLY
       during restore, and mmap(PROT_WRITE) will fail with EACCES, causing
       the restore to fail.
    
    2. If a file is opened read-write and mapped read-only, it will be
       opened O_RDONLY during restore, so restore will succeed, but
       mprotect(PROT_WRITE) on the read-only mapping after restore will
       fail.
    
    To fix both of these, record open flags per-vma based on the presence of
    VM_MAYWRITE in smaps.
    Signed-off-by: 's avatarJamie Liu <jamieliu@google.com>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
    efe594f8
Name
Last commit
Last update
..
Makefile Loading commit data...
core-arm.proto Loading commit data...
core-x86.proto Loading commit data...
core.proto Loading commit data...
creds.proto Loading commit data...
eventfd.proto Loading commit data...
eventpoll.proto Loading commit data...
ext-file.proto Loading commit data...
fdinfo.proto Loading commit data...
fh.proto Loading commit data...
fifo.proto Loading commit data...
file-lock.proto Loading commit data...
fown.proto Loading commit data...
fs.proto Loading commit data...
fsnotify.proto Loading commit data...
ghost-file.proto Loading commit data...
inventory.proto Loading commit data...
ipc-desc.proto Loading commit data...
ipc-msg.proto Loading commit data...
ipc-sem.proto Loading commit data...
ipc-shm.proto Loading commit data...
ipc-var.proto Loading commit data...
mm.proto Loading commit data...
mnt.proto Loading commit data...
netdev.proto Loading commit data...
ns.proto Loading commit data...
packet-sock.proto Loading commit data...
pagemap.proto Loading commit data...
pipe-data.proto Loading commit data...
pipe.proto Loading commit data...
pstree.proto Loading commit data...
regfile.proto Loading commit data...
remap-file-path.proto Loading commit data...
rlimit.proto Loading commit data...
rpc.proto Loading commit data...
sa.proto Loading commit data...
siginfo.proto Loading commit data...
signalfd.proto Loading commit data...
sk-inet.proto Loading commit data...
sk-netlink.proto Loading commit data...
sk-opts.proto Loading commit data...
sk-packet.proto Loading commit data...
sk-unix.proto Loading commit data...
stats.proto Loading commit data...
tcp-stream.proto Loading commit data...
timer.proto Loading commit data...
tty.proto Loading commit data...
tun.proto Loading commit data...
utsns.proto Loading commit data...
vma.proto Loading commit data...