checkpoint-restore / criu

Checkpoint/Restore tool
criu.org
Other
2.79k stars 565 forks source link

Restore is not working with following capabilities #2262

Closed PSoni8 closed 9 months ago

PSoni8 commented 10 months ago

Description I am running checkpoint and restore using CLI mode with following capabilities on fedora 34 based system, criu-3.16.1 version. $ uname -a Linux localhost.localdomain 5.12.3.valarch.master.1.2 #1 SMP Thu Oct 14 17:01:59 MDT 2021 x86_64 x86_64 x86_64 GNU/Linux setcap \ 'cap_dac_override=eip \ cap_chown=eip \ cap_setpcap=eip \ cap_setgid=eip \ cap_audit_control=eip \ cap_dac_read_search=eip \ cap_net_admin=eip \ cap_sys_admin=eip \ cap_sys_chroot=eip \ cap_sys_ptrace=eip \ cap_fowner=eip \ cap_kill=eip \ cap_fsetid=eip \ cap_sys_resource=eip \ cap_setuid=eip' \ /usr/sbin/criu

Describe the results you received: Dump is successful but restore is failing with below issues: [2023-09-08T11:53:53.719Z] (00.010083) 39524: timens: monotonic -6 965717522 [2023-09-08T11:53:53.719Z] (00.010099) 39524: Error (criu/timens.c:97): Unable to set a monotonic clock offset: Operation not permitted [2023-09-08T11:53:53.719Z] (00.010122) Error (criu/cr-restore.c:2447): Restoring FAILED. [2023-09-08T11:53:53.719Z] (00.010301) Error (criu/cr-restore.c:1480): 39524 killed by signal 9: Killed

But when executing it with superuser permissions (sudo) both checkpoint-restore is successful.

Want to konw which other cap permissions are required apart from this.

CRIU logs and information:

CRIU full dump/restore logs:

``` [dump_log.txt](https://github.com/checkpoint-restore/criu/files/12583167/dump_log.txt) [restore_log.txt](https://github.com/checkpoint-restore/criu/files/12583127/restore_log.txt) ```

Output of `criu --version`:

``` 3.16.1 ```

Additional environment details: $ uname -a Linux localhost.localdomain 5.12.3.valarch.master.1.2 #1 SMP Thu Oct 14 17:01:59 MDT 2021 x86_64 x86_64 x86_64 GNU/Linux sample_code_in_system.txt

rst0git commented 10 months ago
(00.010384)   2309: timens: monotonic -6 966515607
(00.010402)   2309: Error (criu/timens.c:97): Unable to set a monotonic clock offset: Operation not permitted

@PSoni8 This error appears because CRIU attempts to write to timens_offsets. This requires CAP_SYS_TIME capability.