criu/compel/plugins/include/uapi/std/infect.h
Mike Rapoport (IBM) 63a45e1c8a compel: infect: prepare parasite_service() for addition of CET support
To support sigreturn with CET enabled parasite must rewind its stack
before calling sigreturn so that shadow stack will be compatible with
actual calling sequence.

In addition, calling sigreturn from top level routine
(__export_parasite_head_start) will significantly simplify the shadow
stack manipulations required to execute sigreturn.

For x86 make fini_sigreturn() return the stack pointer for the signal
frame that will be used by sigreturn and propagate that return value up
to __export_parasite_head_start.

In non-daemon mode parasite_trap_cmd() returns non-positive value
which allows to distinguish daemon and non-daemon mode and properly stop
at int3 in non-daemon mode.

Architectures other than x86 remain unchanged and will still call
sigreturn from fini_sigreturn().

Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>
2024-09-11 16:02:11 -07:00

25 lines
692 B
C

#ifndef COMPEL_PLUGIN_STD_INFECT_H__
#define COMPEL_PLUGIN_STD_INFECT_H__
#include "common/compiler.h"
extern int parasite_get_rpc_sock(void);
extern unsigned int __export_parasite_service_cmd;
extern void *__export_parasite_service_args_ptr;
extern unsigned long __must_check parasite_service(void);
/*
* Must be supplied by user plugins.
*/
extern int __must_check parasite_daemon_cmd(int cmd, void *args);
extern int __must_check parasite_trap_cmd(int cmd, void *args);
extern void parasite_cleanup(void);
/*
* FIXME: Should be supplied by log module.
*/
extern void log_set_fd(int fd);
extern void log_set_loglevel(unsigned int level);
#endif /* COMPEL_PLUGIN_STD_INFECT_H__ */