Re: [PATCH v2 03/12] task_isolation: userspace hard isolation from kernel
From: Marta Rybczynska
Date: Fri Mar 27 2020 - 04:43:10 EST
On Sun, Mar 8, 2020 at 4:48 AM Alex Belits <abelits@xxxxxxxxxxx> wrote:
> +/* Enable task_isolation mode for TASK_ISOLATION kernels. */
> +#define PR_TASK_ISOLATION 48
> +# define PR_TASK_ISOLATION_ENABLE (1 << 0)
> +# define PR_TASK_ISOLATION_SET_SIG(sig) (((sig) & 0x7f) << 8)
> +# define PR_TASK_ISOLATION_GET_SIG(bits) (((bits) >> 8) & 0x7f)
> +
Thank you for resurrecting this code!
I have a question on the UAPI: the example code is using
PR_TASK_ISOLATION_USERSIG and it seems to be removed from this
version.
To enable isolation with SIGUSR1 the task should run:
prctl(PR_SET_TASK_ISOLATION, PR_TASK_ISOLATION_ENABLE
| PR_TASK_ISOLATION_SET_SIG(SIGUSR1), 0, 0, 0);
And to disable:
prctl(PR_SET_TASK_ISOLATION, 0, 0, 0, 0);
Is this correct?
Marta