[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrUtRJ_k0HqPSkrK9PTskTcO9GN=cR8wTJ7TowRFahhFCQ@mail.gmail.com>
Date: Tue, 30 Aug 2016 14:46:05 -0700
From: Andy Lutomirski <luto@...capital.net>
To: Chris Metcalf <cmetcalf@...lanox.com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Christoph Lameter <cl@...ux.com>,
Gilad Ben Yossef <giladb@...lanox.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Viresh Kumar <viresh.kumar@...aro.org>,
Ingo Molnar <mingo@...nel.org>,
Steven Rostedt <rostedt@...dmis.org>,
Tejun Heo <tj@...nel.org>, Will Deacon <will.deacon@....com>,
Rik van Riel <riel@...hat.com>,
Frederic Weisbecker <fweisbec@...il.com>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
X86 ML <x86@...nel.org>, "H. Peter Anvin" <hpa@...or.com>,
Catalin Marinas <catalin.marinas@....com>,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH v15 06/13] arch/x86: enable task isolation functionality
On Aug 16, 2016 11:20 PM, "Chris Metcalf" <cmetcalf@...lanox.com> wrote:
>
> In exit_to_usermode_loop(), call task_isolation_ready() for
> TIF_TASK_ISOLATION tasks when we are checking the thread-info flags,
> and after we've handled the other work, call task_isolation_enter()
> for such tasks.
>
> In syscall_trace_enter_phase1(), we add the necessary support for
> reporting syscalls for task-isolation processes.
>
> We add strict reporting for the kernel exception types that do
> not result in signals, namely non-signalling page faults and
> non-signalling MPX fixups.
>
> Tested-by: Christoph Lameter <cl@...ux.com>
> Signed-off-by: Chris Metcalf <cmetcalf@...lanox.com>
> ---
> arch/x86/Kconfig | 1 +
> arch/x86/entry/common.c | 21 ++++++++++++++++++++-
> arch/x86/include/asm/thread_info.h | 4 +++-
> arch/x86/kernel/smp.c | 2 ++
> arch/x86/kernel/traps.c | 3 +++
> arch/x86/mm/fault.c | 5 +++++
> 6 files changed, 34 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index c580d8c33562..7f6ec46d18d0 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -90,6 +90,7 @@ config X86
> select HAVE_ARCH_MMAP_RND_COMPAT_BITS if MMU && COMPAT
> select HAVE_ARCH_SECCOMP_FILTER
> select HAVE_ARCH_SOFT_DIRTY if X86_64
> + select HAVE_ARCH_TASK_ISOLATION
> select HAVE_ARCH_TRACEHOOK
> select HAVE_ARCH_TRANSPARENT_HUGEPAGE
> select HAVE_ARCH_WITHIN_STACK_FRAMES
> diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c
> index 1433f6b4607d..3b23b3542909 100644
> --- a/arch/x86/entry/common.c
> +++ b/arch/x86/entry/common.c
> @@ -21,6 +21,7 @@
> #include <linux/context_tracking.h>
> #include <linux/user-return-notifier.h>
> #include <linux/uprobes.h>
> +#include <linux/isolation.h>
>
> #include <asm/desc.h>
> #include <asm/traps.h>
> @@ -91,6 +92,16 @@ static long syscall_trace_enter(struct pt_regs *regs)
> if (emulated)
> return -1L;
>
> + /*
> + * In task isolation mode, we may prevent the syscall from
> + * running, and if so we also deliver a signal to the process.
> + */
> + if (work & _TIF_TASK_ISOLATION) {
> + if (task_isolation_syscall(regs->orig_ax) == -1)
> + return -1L;
> + work &= ~_TIF_TASK_ISOLATION;
> + }
> +
[apparently i failed to hit send earlier...]
Have you confirmed that this works correctly wrt PTRACE_SYSCALL? It
should result in an even number of events (like raise(2) or an async
signal) and that should have a test case.
--Andy
Powered by blists - more mailing lists