• Adrian Reber's avatar
    restore: support restoring threads with SELinux · 1bc3e588
    Adrian Reber authored
    Restoring a multi-threaded process with CRIU's SELinux support fails
    because SELinux does not always support changing the process context of
    a multi-threaded process.
    
    Reading the man-page for setcon(), to change the context of a running
    process, it states that changing the SELinux context of a multi-threaded
    process can only work 'if the new security context is bounded by the old
    security context'.
    
    To be able to restore a process without the need to have 'the new
    security context [] bounded by the old security context', this sets the
    SELinux process context before creating the threads. Thus all threads
    are created with the process context of the main process.
    Signed-off-by: 's avatarAdrian Reber <areber@redhat.com>
    1bc3e588
restorer.c 45.3 KB