mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-08-04 15:53:44 +00:00
seccomp/restorer: Disable gtod from vdso in strict mode
Signed-off-by: Dmitry Safonov <dima@arista.com> Signed-off-by: Andrei Vagin <avagin@gmail.com>
This commit is contained in:
parent
90ecb82202
commit
23960fe60e
1 changed files with 17 additions and 0 deletions
|
|
@ -476,6 +476,23 @@ static int restore_seccomp(struct thread_restore_args *args)
|
|||
return 0;
|
||||
break;
|
||||
case SECCOMP_MODE_STRICT:
|
||||
/*
|
||||
* Disable gettimeofday() from vdso: it may use TSC
|
||||
* which is restricted by kernel:
|
||||
*
|
||||
* static long seccomp_set_mode_strict(void)
|
||||
* {
|
||||
* [..]
|
||||
* #ifdef TIF_NOTSC
|
||||
* disable_TSC();
|
||||
* #endif
|
||||
* [..]
|
||||
*
|
||||
* XXX: It may need to be fixed in kernel under
|
||||
* PTRACE_O_SUSPEND_SECCOMP, but for now just get timings
|
||||
* with a raw syscall instead of vdso.
|
||||
*/
|
||||
std_log_set_gettimeofday(NULL);
|
||||
ret = sys_prctl(PR_SET_SECCOMP, SECCOMP_MODE_STRICT, 0, 0, 0);
|
||||
if (ret < 0) {
|
||||
pr_err("seccomp: SECCOMP_MODE_STRICT returned %d on tid %d\n",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue