lkml.org 
[lkml]   [2016]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v12 06/13] task_isolation: support PR_TASK_ISOLATION_STRICT mode
On Tue, Apr 05, 2016 at 01:38:35PM -0400, Chris Metcalf wrote:
> +void task_isolation_interrupt(struct task_struct *task, const char *buf)
> +{
> + siginfo_t info = {};
> + int sig;
> +
> + pr_warn("%s/%d: task_isolation strict mode violated by %s\n",
> + task->comm, task->pid, buf);
> +

So the function name suggests this is called for interrupts, except its
purpose is to deliver a signal.

Now, in case of exceptions the violation isn't necessarily _by_ the task
itself. You might want to change that to report the exception
type/number instead of the affected task.

> + /* Get the signal number to use. */
> + sig = PR_TASK_ISOLATION_GET_SIG(task->task_isolation_flags);
> + if (sig == 0)
> + sig = SIGKILL;
> + info.si_signo = sig;
> +
> + /*
> + * Turn off task isolation mode entirely to avoid spamming
> + * the process with signals. It can re-enable task isolation
> + * mode in the signal handler if it wants to.
> + */
> + task_isolation_set_flags(task, 0);
> +
> + send_sig_info(sig, &info, task);
> +}

\
 
 \ /
  Last update: 2016-05-18 16:01    [W:0.255 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site