* [PATCH v2 1/4] mm: fix exec activate_mm vs TLB shootdown and lazy tlb switching race
From: Nicholas Piggin @ 2020-09-14 4:52 UTC (permalink / raw)
To: linux-mm @ kvack . org
Cc: linux-arch, Jens Axboe, Peter Zijlstra, Aneesh Kumar K . V,
linux-kernel, Nicholas Piggin, sparclinux, Andrew Morton,
linuxppc-dev, David S . Miller
In-Reply-To: <20200914045219.3736466-1-npiggin@gmail.com>
Reading and modifying current->mm and current->active_mm and switching
mm should be done with irqs off, to prevent races seeing an intermediate
state.
This is similar to commit 38cf307c1f20 ("mm: fix kthread_use_mm() vs TLB
invalidate"). At exec-time when the new mm is activated, the old one
should usually be single-threaded and no longer used, unless something
else is holding an mm_users reference (which may be possible).
Absent other mm_users, there is also a race with preemption and lazy tlb
switching. Consider the kernel_execve case where the current thread is
using a lazy tlb active mm:
call_usermodehelper()
kernel_execve()
old_mm = current->mm;
active_mm = current->active_mm;
*** preempt *** --------------------> schedule()
prev->active_mm = NULL;
mmdrop(prev active_mm);
...
<-------------------- schedule()
current->mm = mm;
current->active_mm = mm;
if (!old_mm)
mmdrop(active_mm);
If we switch back to the kernel thread from a different mm, there is a
double free of the old active_mm, and a missing free of the new one.
Closing this race only requires interrupts to be disabled while ->mm
and ->active_mm are being switched, but the TLB problem requires also
holding interrupts off over activate_mm. Unfortunately not all archs
can do that yet, e.g., arm defers the switch if irqs are disabled and
expects finish_arch_post_lock_switch() to be called to complete the
flush; um takes a blocking lock in activate_mm().
So as a first step, disable interrupts across the mm/active_mm updates
to close the lazy tlb preempt race, and provide an arch option to
extend that to activate_mm which allows architectures doing IPI based
TLB shootdowns to close the second race.
This is a bit ugly, but in the interest of fixing the bug and backporting
before all architectures are converted this is a compromise.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/Kconfig | 7 +++++++
fs/exec.c | 17 +++++++++++++++--
2 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/arch/Kconfig b/arch/Kconfig
index af14a567b493..94821e3f94d1 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -414,6 +414,13 @@ config MMU_GATHER_NO_GATHER
bool
depends on MMU_GATHER_TABLE_FREE
+config ARCH_WANT_IRQS_OFF_ACTIVATE_MM
+ bool
+ help
+ Temporary select until all architectures can be converted to have
+ irqs disabled over activate_mm. Architectures that do IPI based TLB
+ shootdowns should enable this.
+
config ARCH_HAVE_NMI_SAFE_CMPXCHG
bool
diff --git a/fs/exec.c b/fs/exec.c
index a91003e28eaa..d4fb18baf1fb 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1130,11 +1130,24 @@ static int exec_mmap(struct mm_struct *mm)
}
task_lock(tsk);
- active_mm = tsk->active_mm;
membarrier_exec_mmap(mm);
- tsk->mm = mm;
+
+ local_irq_disable();
+ active_mm = tsk->active_mm;
tsk->active_mm = mm;
+ tsk->mm = mm;
+ /*
+ * This prevents preemption while active_mm is being loaded and
+ * it and mm are being updated, which could cause problems for
+ * lazy tlb mm refcounting when these are updated by context
+ * switches. Not all architectures can handle irqs off over
+ * activate_mm yet.
+ */
+ if (!IS_ENABLED(CONFIG_ARCH_WANT_IRQS_OFF_ACTIVATE_MM))
+ local_irq_enable();
activate_mm(active_mm, mm);
+ if (IS_ENABLED(CONFIG_ARCH_WANT_IRQS_OFF_ACTIVATE_MM))
+ local_irq_enable();
tsk->mm->vmacache_seqnum = 0;
vmacache_flush(tsk);
task_unlock(tsk);
--
2.23.0
^ permalink raw reply related
* [PATCH v2 2/4] powerpc: select ARCH_WANT_IRQS_OFF_ACTIVATE_MM
From: Nicholas Piggin @ 2020-09-14 4:52 UTC (permalink / raw)
To: linux-mm @ kvack . org
Cc: linux-arch, Jens Axboe, Peter Zijlstra, Aneesh Kumar K . V,
linux-kernel, Nicholas Piggin, sparclinux, Andrew Morton,
linuxppc-dev, David S . Miller
In-Reply-To: <20200914045219.3736466-1-npiggin@gmail.com>
powerpc uses IPIs in some situations to switch a kernel thread away
from a lazy tlb mm, which is subject to the TLB flushing race
described in the changelog introducing ARCH_WANT_IRQS_OFF_ACTIVATE_MM.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/powerpc/Kconfig | 1 +
arch/powerpc/include/asm/mmu_context.h | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 65bed1fdeaad..587ba8352d01 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -149,6 +149,7 @@ config PPC
select ARCH_USE_QUEUED_RWLOCKS if PPC_QUEUED_SPINLOCKS
select ARCH_USE_QUEUED_SPINLOCKS if PPC_QUEUED_SPINLOCKS
select ARCH_WANT_IPC_PARSE_VERSION
+ select ARCH_WANT_IRQS_OFF_ACTIVATE_MM
select ARCH_WEAK_RELEASE_ACQUIRE
select BINFMT_ELF
select BUILDTIME_TABLE_SORT
diff --git a/arch/powerpc/include/asm/mmu_context.h b/arch/powerpc/include/asm/mmu_context.h
index a3a12a8341b2..b42813359f49 100644
--- a/arch/powerpc/include/asm/mmu_context.h
+++ b/arch/powerpc/include/asm/mmu_context.h
@@ -244,7 +244,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
#define activate_mm activate_mm
static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next)
{
- switch_mm(prev, next, current);
+ switch_mm_irqs_off(prev, next, current);
}
/* We don't currently use enter_lazy_tlb() for anything */
--
2.23.0
^ permalink raw reply related
* [PATCH v2 3/4] sparc64: remove mm_cpumask clearing to fix kthread_use_mm race
From: Nicholas Piggin @ 2020-09-14 4:52 UTC (permalink / raw)
To: linux-mm @ kvack . org
Cc: linux-arch, Jens Axboe, Peter Zijlstra, Aneesh Kumar K . V,
linux-kernel, Nicholas Piggin, sparclinux, Andrew Morton,
linuxppc-dev, David S . Miller
In-Reply-To: <20200914045219.3736466-1-npiggin@gmail.com>
The de facto (and apparently uncommented) standard for using an mm had,
thanks to this code in sparc if nothing else, been that you must have a
reference on mm_users *and that reference must have been obtained with
mmget()*, i.e., from a thread with a reference to mm_users that had used
the mm.
The introduction of mmget_not_zero() in commit d2005e3f41d4
("userfaultfd: don't pin the user memory in userfaultfd_file_create()")
allowed mm_count holders to aoperate on user mappings asynchronously
from the actual threads using the mm, but they were not to load those
mappings into their TLB (i.e., walking vmas and page tables is okay,
kthread_use_mm() is not).
io_uring 2b188cc1bb857 ("Add io_uring IO interface") added code which
does a kthread_use_mm() from a mmget_not_zero() refcount.
The problem with this is code which previously assumed mm == current->mm
and mm->mm_users == 1 implies the mm will remain single-threaded at
least until this thread creates another mm_users reference, has now
broken.
arch/sparc/kernel/smp_64.c:
if (atomic_read(&mm->mm_users) == 1) {
cpumask_copy(mm_cpumask(mm), cpumask_of(cpu));
goto local_flush_and_out;
}
vs fs/io_uring.c
if (unlikely(!(ctx->flags & IORING_SETUP_SQPOLL) ||
!mmget_not_zero(ctx->sqo_mm)))
return -EFAULT;
kthread_use_mm(ctx->sqo_mm);
mmget_not_zero() could come in right after the mm_users == 1 test, then
kthread_use_mm() which sets its CPU in the mm_cpumask. That update could
be lost if cpumask_copy() occurs afterward.
I propose we fix this by allowing mmget_not_zero() to be a first-class
reference, and not have this obscure undocumented and unchecked
restriction.
The basic fix for sparc64 is to remove its mm_cpumask clearing code. The
optimisation could be effectively restored by sending IPIs to mm_cpumask
members and having them remove themselves from mm_cpumask. This is more
tricky so I leave it as an exercise for someone with a sparc64 SMP.
powerpc has a (currently similarly broken) example.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/sparc/kernel/smp_64.c | 65 ++++++++------------------------------
1 file changed, 14 insertions(+), 51 deletions(-)
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index e286e2badc8a..e38d8bf454e8 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -1039,38 +1039,9 @@ void smp_fetch_global_pmu(void)
* are flush_tlb_*() routines, and these run after flush_cache_*()
* which performs the flushw.
*
- * The SMP TLB coherency scheme we use works as follows:
- *
- * 1) mm->cpu_vm_mask is a bit mask of which cpus an address
- * space has (potentially) executed on, this is the heuristic
- * we use to avoid doing cross calls.
- *
- * Also, for flushing from kswapd and also for clones, we
- * use cpu_vm_mask as the list of cpus to make run the TLB.
- *
- * 2) TLB context numbers are shared globally across all processors
- * in the system, this allows us to play several games to avoid
- * cross calls.
- *
- * One invariant is that when a cpu switches to a process, and
- * that processes tsk->active_mm->cpu_vm_mask does not have the
- * current cpu's bit set, that tlb context is flushed locally.
- *
- * If the address space is non-shared (ie. mm->count == 1) we avoid
- * cross calls when we want to flush the currently running process's
- * tlb state. This is done by clearing all cpu bits except the current
- * processor's in current->mm->cpu_vm_mask and performing the
- * flush locally only. This will force any subsequent cpus which run
- * this task to flush the context from the local tlb if the process
- * migrates to another cpu (again).
- *
- * 3) For shared address spaces (threads) and swapping we bite the
- * bullet for most cases and perform the cross call (but only to
- * the cpus listed in cpu_vm_mask).
- *
- * The performance gain from "optimizing" away the cross call for threads is
- * questionable (in theory the big win for threads is the massive sharing of
- * address space state across processors).
+ * mm->cpu_vm_mask is a bit mask of which cpus an address
+ * space has (potentially) executed on, this is the heuristic
+ * we use to limit cross calls.
*/
/* This currently is only used by the hugetlb arch pre-fault
@@ -1080,18 +1051,13 @@ void smp_fetch_global_pmu(void)
void smp_flush_tlb_mm(struct mm_struct *mm)
{
u32 ctx = CTX_HWBITS(mm->context);
- int cpu = get_cpu();
- if (atomic_read(&mm->mm_users) == 1) {
- cpumask_copy(mm_cpumask(mm), cpumask_of(cpu));
- goto local_flush_and_out;
- }
+ get_cpu();
smp_cross_call_masked(&xcall_flush_tlb_mm,
ctx, 0, 0,
mm_cpumask(mm));
-local_flush_and_out:
__flush_tlb_mm(ctx, SECONDARY_CONTEXT);
put_cpu();
@@ -1114,17 +1080,15 @@ void smp_flush_tlb_pending(struct mm_struct *mm, unsigned long nr, unsigned long
{
u32 ctx = CTX_HWBITS(mm->context);
struct tlb_pending_info info;
- int cpu = get_cpu();
+
+ get_cpu();
info.ctx = ctx;
info.nr = nr;
info.vaddrs = vaddrs;
- if (mm == current->mm && atomic_read(&mm->mm_users) == 1)
- cpumask_copy(mm_cpumask(mm), cpumask_of(cpu));
- else
- smp_call_function_many(mm_cpumask(mm), tlb_pending_func,
- &info, 1);
+ smp_call_function_many(mm_cpumask(mm), tlb_pending_func,
+ &info, 1);
__flush_tlb_pending(ctx, nr, vaddrs);
@@ -1134,14 +1098,13 @@ void smp_flush_tlb_pending(struct mm_struct *mm, unsigned long nr, unsigned long
void smp_flush_tlb_page(struct mm_struct *mm, unsigned long vaddr)
{
unsigned long context = CTX_HWBITS(mm->context);
- int cpu = get_cpu();
- if (mm == current->mm && atomic_read(&mm->mm_users) == 1)
- cpumask_copy(mm_cpumask(mm), cpumask_of(cpu));
- else
- smp_cross_call_masked(&xcall_flush_tlb_page,
- context, vaddr, 0,
- mm_cpumask(mm));
+ get_cpu();
+
+ smp_cross_call_masked(&xcall_flush_tlb_page,
+ context, vaddr, 0,
+ mm_cpumask(mm));
+
__flush_tlb_page(context, vaddr);
put_cpu();
--
2.23.0
^ permalink raw reply related
* [PATCH v2 4/4] powerpc/64s/radix: Fix mm_cpumask trimming race vs kthread_use_mm
From: Nicholas Piggin @ 2020-09-14 4:52 UTC (permalink / raw)
To: linux-mm @ kvack . org
Cc: linux-arch, Jens Axboe, Peter Zijlstra, Aneesh Kumar K . V,
linux-kernel, Nicholas Piggin, sparclinux, Andrew Morton,
linuxppc-dev, David S . Miller
In-Reply-To: <20200914045219.3736466-1-npiggin@gmail.com>
Commit 0cef77c7798a7 ("powerpc/64s/radix: flush remote CPUs out of
single-threaded mm_cpumask") added a mechanism to trim the mm_cpumask of
a process under certain conditions. One of the assumptions is that
mm_users would not be incremented via a reference outside the process
context with mmget_not_zero() then go on to kthread_use_mm() via that
reference.
That invariant was broken by io_uring code (see previous sparc64 fix),
but I'll point Fixes: to the original powerpc commit because we are
changing that assumption going forward, so this will make backports
match up.
Fix this by no longer relying on that assumption, but by having each CPU
check the mm is not being used, and clearing their own bit from the mask
only if it hasn't been switched-to by the time the IPI is processed.
This relies on commit 38cf307c1f20 ("mm: fix kthread_use_mm() vs TLB
invalidate") and ARCH_WANT_IRQS_OFF_ACTIVATE_MM to disable irqs over mm
switch sequences.
Reviewed-by: Michael Ellerman <mpe@ellerman.id.au>
Depends-on: 38cf307c1f20 ("mm: fix kthread_use_mm() vs TLB invalidate")
Fixes: 0cef77c7798a7 ("powerpc/64s/radix: flush remote CPUs out of single-threaded mm_cpumask")
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/powerpc/include/asm/tlb.h | 13 -------------
arch/powerpc/mm/book3s64/radix_tlb.c | 23 ++++++++++++++++-------
2 files changed, 16 insertions(+), 20 deletions(-)
diff --git a/arch/powerpc/include/asm/tlb.h b/arch/powerpc/include/asm/tlb.h
index fbc6f3002f23..d97f061fecac 100644
--- a/arch/powerpc/include/asm/tlb.h
+++ b/arch/powerpc/include/asm/tlb.h
@@ -66,19 +66,6 @@ static inline int mm_is_thread_local(struct mm_struct *mm)
return false;
return cpumask_test_cpu(smp_processor_id(), mm_cpumask(mm));
}
-static inline void mm_reset_thread_local(struct mm_struct *mm)
-{
- WARN_ON(atomic_read(&mm->context.copros) > 0);
- /*
- * It's possible for mm_access to take a reference on mm_users to
- * access the remote mm from another thread, but it's not allowed
- * to set mm_cpumask, so mm_users may be > 1 here.
- */
- WARN_ON(current->mm != mm);
- atomic_set(&mm->context.active_cpus, 1);
- cpumask_clear(mm_cpumask(mm));
- cpumask_set_cpu(smp_processor_id(), mm_cpumask(mm));
-}
#else /* CONFIG_PPC_BOOK3S_64 */
static inline int mm_is_thread_local(struct mm_struct *mm)
{
diff --git a/arch/powerpc/mm/book3s64/radix_tlb.c b/arch/powerpc/mm/book3s64/radix_tlb.c
index 0d233763441f..143b4fd396f0 100644
--- a/arch/powerpc/mm/book3s64/radix_tlb.c
+++ b/arch/powerpc/mm/book3s64/radix_tlb.c
@@ -645,19 +645,29 @@ static void do_exit_flush_lazy_tlb(void *arg)
struct mm_struct *mm = arg;
unsigned long pid = mm->context.id;
+ /*
+ * A kthread could have done a mmget_not_zero() after the flushing CPU
+ * checked mm_is_singlethreaded, and be in the process of
+ * kthread_use_mm when interrupted here. In that case, current->mm will
+ * be set to mm, because kthread_use_mm() setting ->mm and switching to
+ * the mm is done with interrupts off.
+ */
if (current->mm == mm)
- return; /* Local CPU */
+ goto out_flush;
if (current->active_mm == mm) {
- /*
- * Must be a kernel thread because sender is single-threaded.
- */
- BUG_ON(current->mm);
+ WARN_ON_ONCE(current->mm != NULL);
+ /* Is a kernel thread and is using mm as the lazy tlb */
mmgrab(&init_mm);
- switch_mm(mm, &init_mm, current);
current->active_mm = &init_mm;
+ switch_mm_irqs_off(mm, &init_mm, current);
mmdrop(mm);
}
+
+ atomic_dec(&mm->context.active_cpus);
+ cpumask_clear_cpu(smp_processor_id(), mm_cpumask(mm));
+
+out_flush:
_tlbiel_pid(pid, RIC_FLUSH_ALL);
}
@@ -672,7 +682,6 @@ static void exit_flush_lazy_tlbs(struct mm_struct *mm)
*/
smp_call_function_many(mm_cpumask(mm), do_exit_flush_lazy_tlb,
(void *)mm, 1);
- mm_reset_thread_local(mm);
}
void radix__flush_tlb_mm(struct mm_struct *mm)
--
2.23.0
^ permalink raw reply related
* Re: [PATCH 13/15] selftests/seccomp: powerpc: Set syscall return during ptrace syscall exit
From: Michael Ellerman @ 2020-09-14 5:47 UTC (permalink / raw)
To: Kees Cook, linux-kernel
Cc: Thadeu Lima de Souza Cascardo, Will Drewry, Kees Cook,
linux-xtensa, linux-mips, Andy Lutomirski, Max Filippov,
linux-arm-kernel, linux-kselftest, linuxppc-dev,
Christian Brauner
In-Reply-To: <20200912110820.597135-14-keescook@chromium.org>
Kees Cook <keescook@chromium.org> writes:
> Some archs (like ppc) only support changing the return code during
> syscall exit when ptrace is used. As the syscall number might not
> be available anymore during syscall exit, it needs to be saved
> during syscall enter. Adjust the ptrace tests to do this.
I'm not that across all the fixture stuff, but if I'm reading it right
you're now calling change_syscall() on both entry and exit for all
arches.
That should work, but it no longer tests changing the return code on
entry on the arches that support it, which seems like a backward step?
cheers
> Reported-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
> Suggested-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
> Link: https://lore.kernel.org/linux-kselftest/20200911181012.171027-1-cascardo@canonical.com/
> Fixes: 58d0a862f573 ("seccomp: add tests for ptrace hole")
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
> tools/testing/selftests/seccomp/seccomp_bpf.c | 34 +++++++++++--------
> 1 file changed, 20 insertions(+), 14 deletions(-)
>
> diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c
> index bbab2420d708..26c712c6a575 100644
> --- a/tools/testing/selftests/seccomp/seccomp_bpf.c
> +++ b/tools/testing/selftests/seccomp/seccomp_bpf.c
> @@ -1949,12 +1949,19 @@ void tracer_seccomp(struct __test_metadata *_metadata, pid_t tracee,
>
> }
>
> +FIXTURE(TRACE_syscall) {
> + struct sock_fprog prog;
> + pid_t tracer, mytid, mypid, parent;
> + long syscall_nr;
> +};
> +
> void tracer_ptrace(struct __test_metadata *_metadata, pid_t tracee,
> int status, void *args)
> {
> - int ret, nr;
> + int ret;
> unsigned long msg;
> static bool entry;
> + FIXTURE_DATA(TRACE_syscall) *self = args;
>
> /*
> * The traditional way to tell PTRACE_SYSCALL entry/exit
> @@ -1968,24 +1975,23 @@ void tracer_ptrace(struct __test_metadata *_metadata, pid_t tracee,
> EXPECT_EQ(entry ? PTRACE_EVENTMSG_SYSCALL_ENTRY
> : PTRACE_EVENTMSG_SYSCALL_EXIT, msg);
>
> - if (!entry)
> - return;
> -
> - nr = get_syscall(_metadata, tracee);
> + /*
> + * Some architectures only support setting return values during
> + * syscall exit under ptrace, and on exit the syscall number may
> + * no longer be available. Therefore, save it here, and call
> + * "change syscall and set return values" on both entry and exit.
> + */
> + if (entry)
> + self->syscall_nr = get_syscall(_metadata, tracee);
>
> - if (nr == __NR_getpid)
> + if (self->syscall_nr == __NR_getpid)
> change_syscall(_metadata, tracee, __NR_getppid, 0);
> - if (nr == __NR_gettid)
> + if (self->syscall_nr == __NR_gettid)
> change_syscall(_metadata, tracee, -1, 45000);
> - if (nr == __NR_openat)
> + if (self->syscall_nr == __NR_openat)
> change_syscall(_metadata, tracee, -1, -ESRCH);
> }
>
> -FIXTURE(TRACE_syscall) {
> - struct sock_fprog prog;
> - pid_t tracer, mytid, mypid, parent;
> -};
> -
> FIXTURE_VARIANT(TRACE_syscall) {
> /*
> * All of the SECCOMP_RET_TRACE behaviors can be tested with either
> @@ -2044,7 +2050,7 @@ FIXTURE_SETUP(TRACE_syscall)
> self->tracer = setup_trace_fixture(_metadata,
> variant->use_ptrace ? tracer_ptrace
> : tracer_seccomp,
> - NULL, variant->use_ptrace);
> + self, variant->use_ptrace);
>
> ret = prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0);
> ASSERT_EQ(0, ret);
> --
> 2.25.1
^ permalink raw reply
* [PATCH -next] macintosh: windfarm: use for_each_child_of_node() macro
From: Qinglang Miao @ 2020-09-14 6:14 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, linux-kernel, Qinglang Miao
Use for_each_child_of_node() macro instead of open coding it.
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
---
drivers/macintosh/windfarm_smu_sat.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/macintosh/windfarm_smu_sat.c b/drivers/macintosh/windfarm_smu_sat.c
index cb75dc035..e46e1153a 100644
--- a/drivers/macintosh/windfarm_smu_sat.c
+++ b/drivers/macintosh/windfarm_smu_sat.c
@@ -216,8 +216,7 @@ static int wf_sat_probe(struct i2c_client *client,
vsens[0] = vsens[1] = -1;
isens[0] = isens[1] = -1;
- child = NULL;
- while ((child = of_get_next_child(dev, child)) != NULL) {
+ for_each_child_of_node(dev, child) {
reg = of_get_property(child, "reg", NULL);
loc = of_get_property(child, "location", NULL);
if (reg == NULL || loc == NULL)
--
2.23.0
^ permalink raw reply related
* Re: [PATCH] KVM: PPC: Book3S HV: Do not allocate HPT for a nested guest
From: David Gibson @ 2020-09-14 6:12 UTC (permalink / raw)
To: Fabiano Rosas; +Cc: linuxppc-dev, kvm, kvm-ppc
In-Reply-To: <20200911041607.198092-1-farosas@linux.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 4819 bytes --]
On Fri, Sep 11, 2020 at 01:16:07AM -0300, Fabiano Rosas wrote:
> The current nested KVM code does not support HPT guests. This is
> informed/enforced in some ways:
>
> - Hosts < P9 will not be able to enable the nested HV feature;
>
> - The nested hypervisor MMU capabilities will not contain
> KVM_CAP_PPC_MMU_HASH_V3;
>
> - QEMU reflects the MMU capabilities in the
> 'ibm,arch-vec-5-platform-support' device-tree property;
>
> - The nested guest, at 'prom_parse_mmu_model' ignores the
> 'disable_radix' kernel command line option if HPT is not supported;
>
> - The KVM_PPC_CONFIGURE_V3_MMU ioctl will fail if trying to use HPT.
>
> There is, however, still a way to start a HPT guest by using
> max-compat-cpu=power8 at the QEMU machine options. This leads to the
> guest being set to use hash after QEMU calls the KVM_PPC_ALLOCATE_HTAB
> ioctl.
>
> With the guest set to hash, the nested hypervisor goes through the
> entry path that has no knowledge of nesting (kvmppc_run_vcpu) and
> crashes when it tries to execute an hypervisor-privileged (mtspr
> HDEC) instruction at __kvmppc_vcore_entry:
>
> root@L1:~ $ qemu-system-ppc64 -machine pseries,max-cpu-compat=power8 ...
>
> <snip>
> [ 538.543303] CPU: 83 PID: 25185 Comm: CPU 0/KVM Not tainted 5.9.0-rc4 #1
> [ 538.543355] NIP: c00800000753f388 LR: c00800000753f368 CTR: c0000000001e5ec0
> [ 538.543417] REGS: c0000013e91e33b0 TRAP: 0700 Not tainted (5.9.0-rc4)
> [ 538.543470] MSR: 8000000002843033 <SF,VEC,VSX,FP,ME,IR,DR,RI,LE> CR: 22422882 XER: 20040000
> [ 538.543546] CFAR: c00800000753f4b0 IRQMASK: 3
> GPR00: c0080000075397a0 c0000013e91e3640 c00800000755e600 0000000080000000
> GPR04: 0000000000000000 c0000013eab19800 c000001394de0000 00000043a054db72
> GPR08: 00000000003b1652 0000000000000000 0000000000000000 c0080000075502e0
> GPR12: c0000000001e5ec0 c0000007ffa74200 c0000013eab19800 0000000000000008
> GPR16: 0000000000000000 c00000139676c6c0 c000000001d23948 c0000013e91e38b8
> GPR20: 0000000000000053 0000000000000000 0000000000000001 0000000000000000
> GPR24: 0000000000000001 0000000000000001 0000000000000000 0000000000000001
> GPR28: 0000000000000001 0000000000000053 c0000013eab19800 0000000000000001
> [ 538.544067] NIP [c00800000753f388] __kvmppc_vcore_entry+0x90/0x104 [kvm_hv]
> [ 538.544121] LR [c00800000753f368] __kvmppc_vcore_entry+0x70/0x104 [kvm_hv]
> [ 538.544173] Call Trace:
> [ 538.544196] [c0000013e91e3640] [c0000013e91e3680] 0xc0000013e91e3680 (unreliable)
> [ 538.544260] [c0000013e91e3820] [c0080000075397a0] kvmppc_run_core+0xbc8/0x19d0 [kvm_hv]
> [ 538.544325] [c0000013e91e39e0] [c00800000753d99c] kvmppc_vcpu_run_hv+0x404/0xc00 [kvm_hv]
> [ 538.544394] [c0000013e91e3ad0] [c0080000072da4fc] kvmppc_vcpu_run+0x34/0x48 [kvm]
> [ 538.544472] [c0000013e91e3af0] [c0080000072d61b8] kvm_arch_vcpu_ioctl_run+0x310/0x420 [kvm]
> [ 538.544539] [c0000013e91e3b80] [c0080000072c7450] kvm_vcpu_ioctl+0x298/0x778 [kvm]
> [ 538.544605] [c0000013e91e3ce0] [c0000000004b8c2c] sys_ioctl+0x1dc/0xc90
> [ 538.544662] [c0000013e91e3dc0] [c00000000002f9a4] system_call_exception+0xe4/0x1c0
> [ 538.544726] [c0000013e91e3e20] [c00000000000d140] system_call_common+0xf0/0x27c
> [ 538.544787] Instruction dump:
> [ 538.544821] f86d1098 60000000 60000000 48000099 e8ad0fe8 e8c500a0 e9264140 75290002
> [ 538.544886] 7d1602a6 7cec42a6 40820008 7d0807b4 <7d164ba6> 7d083a14 f90d10a0 480104fd
> [ 538.544953] ---[ end trace 74423e2b948c2e0c ]---
>
> This patch makes the KVM_PPC_ALLOCATE_HTAB ioctl fail when running in
> the nested hypervisor, causing QEMU to abort.
>
> Reported-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
> Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
> ---
> arch/powerpc/kvm/book3s_hv.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
> index 4ba06a2a306c..764b6239ef72 100644
> --- a/arch/powerpc/kvm/book3s_hv.c
> +++ b/arch/powerpc/kvm/book3s_hv.c
> @@ -5250,6 +5250,12 @@ static long kvm_arch_vm_ioctl_hv(struct file *filp,
> case KVM_PPC_ALLOCATE_HTAB: {
> u32 htab_order;
>
> + /* If we're a nested hypervisor, we currently only support radix */
> + if (kvmhv_on_pseries()) {
> + r = -EOPNOTSUPP;
> + break;
> + }
> +
> r = -EFAULT;
> if (get_user(htab_order, (u32 __user *)argp))
> break;
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply
* Re: [PATCH v2 3/4] sparc64: remove mm_cpumask clearing to fix kthread_use_mm race
From: Nicholas Piggin @ 2020-09-14 7:00 UTC (permalink / raw)
To: linux-mm
Cc: Jens Axboe, linux-arch, Peter Zijlstra, Aneesh Kumar K . V,
linux-kernel, sparclinux, Andrew Morton, linuxppc-dev,
David S . Miller
In-Reply-To: <20200914045219.3736466-4-npiggin@gmail.com>
Excerpts from Nicholas Piggin's message of September 14, 2020 2:52 pm:
[...]
> The basic fix for sparc64 is to remove its mm_cpumask clearing code. The
> optimisation could be effectively restored by sending IPIs to mm_cpumask
> members and having them remove themselves from mm_cpumask. This is more
> tricky so I leave it as an exercise for someone with a sparc64 SMP.
> powerpc has a (currently similarly broken) example.
So this compiles and boots on qemu, but qemu does not support any
sparc64 machines with SMP. Attempting some simple hacks doesn't get
me far because openbios isn't populating an SMP device tree, which
blows up everywhere.
The patch is _relatively_ simple, hopefully it shouldn't explode, so
it's probably ready for testing on real SMP hardware, if someone has
a few cycles.
Thanks,
Nick
>
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---
> arch/sparc/kernel/smp_64.c | 65 ++++++++------------------------------
> 1 file changed, 14 insertions(+), 51 deletions(-)
>
> diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
> index e286e2badc8a..e38d8bf454e8 100644
> --- a/arch/sparc/kernel/smp_64.c
> +++ b/arch/sparc/kernel/smp_64.c
> @@ -1039,38 +1039,9 @@ void smp_fetch_global_pmu(void)
> * are flush_tlb_*() routines, and these run after flush_cache_*()
> * which performs the flushw.
> *
> - * The SMP TLB coherency scheme we use works as follows:
> - *
> - * 1) mm->cpu_vm_mask is a bit mask of which cpus an address
> - * space has (potentially) executed on, this is the heuristic
> - * we use to avoid doing cross calls.
> - *
> - * Also, for flushing from kswapd and also for clones, we
> - * use cpu_vm_mask as the list of cpus to make run the TLB.
> - *
> - * 2) TLB context numbers are shared globally across all processors
> - * in the system, this allows us to play several games to avoid
> - * cross calls.
> - *
> - * One invariant is that when a cpu switches to a process, and
> - * that processes tsk->active_mm->cpu_vm_mask does not have the
> - * current cpu's bit set, that tlb context is flushed locally.
> - *
> - * If the address space is non-shared (ie. mm->count == 1) we avoid
> - * cross calls when we want to flush the currently running process's
> - * tlb state. This is done by clearing all cpu bits except the current
> - * processor's in current->mm->cpu_vm_mask and performing the
> - * flush locally only. This will force any subsequent cpus which run
> - * this task to flush the context from the local tlb if the process
> - * migrates to another cpu (again).
> - *
> - * 3) For shared address spaces (threads) and swapping we bite the
> - * bullet for most cases and perform the cross call (but only to
> - * the cpus listed in cpu_vm_mask).
> - *
> - * The performance gain from "optimizing" away the cross call for threads is
> - * questionable (in theory the big win for threads is the massive sharing of
> - * address space state across processors).
> + * mm->cpu_vm_mask is a bit mask of which cpus an address
> + * space has (potentially) executed on, this is the heuristic
> + * we use to limit cross calls.
> */
>
> /* This currently is only used by the hugetlb arch pre-fault
> @@ -1080,18 +1051,13 @@ void smp_fetch_global_pmu(void)
> void smp_flush_tlb_mm(struct mm_struct *mm)
> {
> u32 ctx = CTX_HWBITS(mm->context);
> - int cpu = get_cpu();
>
> - if (atomic_read(&mm->mm_users) == 1) {
> - cpumask_copy(mm_cpumask(mm), cpumask_of(cpu));
> - goto local_flush_and_out;
> - }
> + get_cpu();
>
> smp_cross_call_masked(&xcall_flush_tlb_mm,
> ctx, 0, 0,
> mm_cpumask(mm));
>
> -local_flush_and_out:
> __flush_tlb_mm(ctx, SECONDARY_CONTEXT);
>
> put_cpu();
> @@ -1114,17 +1080,15 @@ void smp_flush_tlb_pending(struct mm_struct *mm, unsigned long nr, unsigned long
> {
> u32 ctx = CTX_HWBITS(mm->context);
> struct tlb_pending_info info;
> - int cpu = get_cpu();
> +
> + get_cpu();
>
> info.ctx = ctx;
> info.nr = nr;
> info.vaddrs = vaddrs;
>
> - if (mm == current->mm && atomic_read(&mm->mm_users) == 1)
> - cpumask_copy(mm_cpumask(mm), cpumask_of(cpu));
> - else
> - smp_call_function_many(mm_cpumask(mm), tlb_pending_func,
> - &info, 1);
> + smp_call_function_many(mm_cpumask(mm), tlb_pending_func,
> + &info, 1);
>
> __flush_tlb_pending(ctx, nr, vaddrs);
>
> @@ -1134,14 +1098,13 @@ void smp_flush_tlb_pending(struct mm_struct *mm, unsigned long nr, unsigned long
> void smp_flush_tlb_page(struct mm_struct *mm, unsigned long vaddr)
> {
> unsigned long context = CTX_HWBITS(mm->context);
> - int cpu = get_cpu();
>
> - if (mm == current->mm && atomic_read(&mm->mm_users) == 1)
> - cpumask_copy(mm_cpumask(mm), cpumask_of(cpu));
> - else
> - smp_cross_call_masked(&xcall_flush_tlb_page,
> - context, vaddr, 0,
> - mm_cpumask(mm));
> + get_cpu();
> +
> + smp_cross_call_masked(&xcall_flush_tlb_page,
> + context, vaddr, 0,
> + mm_cpumask(mm));
> +
> __flush_tlb_page(context, vaddr);
>
> put_cpu();
> --
> 2.23.0
>
>
^ permalink raw reply
* Re: [PATCH] serial: ucc_uart: make qe_uart_set_mctrl() static
From: Jiri Slaby @ 2020-09-14 5:29 UTC (permalink / raw)
To: Jason Yan, timur, gregkh, linux, leoyang.li, linuxppc-dev,
linux-serial
Cc: Hulk Robot
In-Reply-To: <20200912033834.143166-1-yanaijie@huawei.com>
On 12. 09. 20, 5:38, Jason Yan wrote:
> This eliminates the following sparse warning:
>
> drivers/tty/serial/ucc_uart.c:286:6: warning: symbol 'qe_uart_set_mctrl'
> was not declared. Should it be static?
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Jason Yan <yanaijie@huawei.com>
Sure:
Acked-by: Jiri Slaby <jirislaby@kernel.org>
> ---
> drivers/tty/serial/ucc_uart.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c
> index 3c8c662c69e2..d6a8604157ab 100644
> --- a/drivers/tty/serial/ucc_uart.c
> +++ b/drivers/tty/serial/ucc_uart.c
> @@ -283,7 +283,7 @@ static unsigned int qe_uart_tx_empty(struct uart_port *port)
> * don't need that support. This function must exist, however, otherwise
> * the kernel will panic.
> */
> -void qe_uart_set_mctrl(struct uart_port *port, unsigned int mctrl)
> +static void qe_uart_set_mctrl(struct uart_port *port, unsigned int mctrl)
> {
> }
>
>
--
js
^ permalink raw reply
* Re: [PATCH] tty: hvcs: Don't NULL tty->driver_data until hvcs_cleanup()
From: Jiri Slaby @ 2020-09-14 5:35 UTC (permalink / raw)
To: Tyrel Datwyler, gregkh
Cc: Joe Perches, open list:HYPERVISOR VIRTUAL CONSOLE DRIVER,
open list, Jason Yan
In-Reply-To: <20200820234643.70412-1-tyreld@linux.ibm.com>
On 21. 08. 20, 1:46, Tyrel Datwyler wrote:
> The code currently NULLs tty->driver_data in hvcs_close() with the
> intent of informing the next call to hvcs_open() that device needs to be
> reconfigured. However, when hvcs_cleanup() is called we copy hvcsd from
> tty->driver_data which was previoulsy NULLed by hvcs_close() and our
> call to tty_port_put(&hvcsd->port) doesn't actually do anything since
> &hvcsd->port ends up translating to NULL by chance. This has the side
> effect that when hvcs_remove() is called we have one too many port
> references preventing hvcs_destuct_port() from ever being called. This
> also prevents us from reusing the /dev/hvcsX node in a future
> hvcs_probe() and we can eventually run out of /dev/hvcsX devices.
>
> Fix this by waiting to NULL tty->driver_data in hvcs_cleanup().
Without actually looking into the code, it looks like we need a fix
similar to:
commit 24eb2377f977fe06d84fca558f891f95bc28a449
Author: Jiri Slaby <jirislaby@kernel.org>
Date: Tue May 26 16:56:32 2020 +0200
tty: hvc_console, fix crashes on parallel open/close
here too?
> Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
> ---
> drivers/tty/hvc/hvcs.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c
> index 55105ac38f89..509d1042825a 100644
> --- a/drivers/tty/hvc/hvcs.c
> +++ b/drivers/tty/hvc/hvcs.c
> @@ -1216,13 +1216,6 @@ static void hvcs_close(struct tty_struct *tty, struct file *filp)
>
> tty_wait_until_sent(tty, HVCS_CLOSE_WAIT);
>
> - /*
> - * This line is important because it tells hvcs_open that this
> - * device needs to be re-configured the next time hvcs_open is
> - * called.
> - */
> - tty->driver_data = NULL;
> -
> free_irq(irq, hvcsd);
> return;
> } else if (hvcsd->port.count < 0) {
> @@ -1237,6 +1230,13 @@ static void hvcs_cleanup(struct tty_struct * tty)
> {
> struct hvcs_struct *hvcsd = tty->driver_data;
>
> + /*
> + * This line is important because it tells hvcs_open that this
> + * device needs to be re-configured the next time hvcs_open is
> + * called.
> + */
> + tty->driver_data = NULL;
> +
> tty_port_put(&hvcsd->port);
> }
>
>
thanks,
--
js
^ permalink raw reply
* Re: [PATCH] spi: fsl-espi: Only process interrupts for expected events
From: Joakim Tjernlund @ 2020-09-14 9:06 UTC (permalink / raw)
To: broonie@kernel.org, npiggin@gmail.com
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org, linux-spi@vger.kernel.org
In-Reply-To: <1600050281.5iiy8pkb7z.astroid@bobo.none>
On Mon, 2020-09-14 at 12:28 +1000, Nicholas Piggin wrote:
> CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
>
>
> Excerpts from Chris Packham's message of September 14, 2020 8:03 am:
> > Hi All,
> >
> > On 4/09/20 12:28 pm, Chris Packham wrote:
> > > The SPIE register contains counts for the TX FIFO so any time the irq
> > > handler was invoked we would attempt to process the RX/TX fifos. Use the
> > > SPIM value to mask the events so that we only process interrupts that
> > > were expected.
> > >
> > > This was a latent issue exposed by commit 3282a3da25bd ("powerpc/64:
> > > Implement soft interrupt replay in C").
> > >
> > > Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> > > Cc: stable@vger.kernel.org
> > > ---
> > ping?
>
> I don't know the code/hardware but thanks for tracking this down.
>
> Was there anything more to be done with Jocke's observations, or would
> that be a follow-up patch if anything?
Patch is good IMHO, there may be more to fix w.r.t clearing the IRQs
>
> If this patch fixes your problem it should probably go in, unless there
> are any objections.
It should go in I think.
Jocke
>
> Thanks,
> Nick
>
> > >
> > > Notes:
> > > I've tested this on a T2080RDB and a custom board using the T2081 SoC. With
> > > this change I don't see any spurious instances of the "Transfer done but
> > > SPIE_DON isn't set!" or "Transfer done but rx/tx fifo's aren't empty!" messages
> > > and the updates to spi flash are successful.
> > >
> > > I think this should go into the stable trees that contain 3282a3da25bd but I
> > > haven't added a Fixes: tag because I think 3282a3da25bd exposed the issue as
> > > opposed to causing it.
> > >
> > > drivers/spi/spi-fsl-espi.c | 5 +++--
> > > 1 file changed, 3 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c
> > > index 7e7c92cafdbb..cb120b68c0e2 100644
> > > --- a/drivers/spi/spi-fsl-espi.c
> > > +++ b/drivers/spi/spi-fsl-espi.c
> > > @@ -574,13 +574,14 @@ static void fsl_espi_cpu_irq(struct fsl_espi *espi, u32 events)
> > > static irqreturn_t fsl_espi_irq(s32 irq, void *context_data)
> > > {
> > > struct fsl_espi *espi = context_data;
> > > - u32 events;
> > > + u32 events, mask;
> > >
> > > spin_lock(&espi->lock);
> > >
> > > /* Get interrupt events(tx/rx) */
> > > events = fsl_espi_read_reg(espi, ESPI_SPIE);
> > > - if (!events) {
> > > + mask = fsl_espi_read_reg(espi, ESPI_SPIM);
> > > + if (!(events & mask)) {
> > > spin_unlock(&espi->lock);
> > > return IRQ_NONE;
> > > }
^ permalink raw reply
* Re: [PATCH v2 1/4] mm: fix exec activate_mm vs TLB shootdown and lazy tlb switching race
From: peterz @ 2020-09-14 10:56 UTC (permalink / raw)
To: Nicholas Piggin
Cc: linux-arch, Jens Axboe, Dave Hansen, Aneesh Kumar K . V,
linux-kernel, Andy Lutomirski, linux-mm @ kvack . org, sparclinux,
Andrew Morton, linuxppc-dev, David S . Miller
In-Reply-To: <20200914045219.3736466-2-npiggin@gmail.com>
On Mon, Sep 14, 2020 at 02:52:16PM +1000, Nicholas Piggin wrote:
> Reading and modifying current->mm and current->active_mm and switching
> mm should be done with irqs off, to prevent races seeing an intermediate
> state.
>
> This is similar to commit 38cf307c1f20 ("mm: fix kthread_use_mm() vs TLB
> invalidate"). At exec-time when the new mm is activated, the old one
> should usually be single-threaded and no longer used, unless something
> else is holding an mm_users reference (which may be possible).
>
> Absent other mm_users, there is also a race with preemption and lazy tlb
> switching. Consider the kernel_execve case where the current thread is
> using a lazy tlb active mm:
>
> call_usermodehelper()
> kernel_execve()
> old_mm = current->mm;
> active_mm = current->active_mm;
> *** preempt *** --------------------> schedule()
> prev->active_mm = NULL;
> mmdrop(prev active_mm);
> ...
> <-------------------- schedule()
> current->mm = mm;
> current->active_mm = mm;
> if (!old_mm)
> mmdrop(active_mm);
>
> If we switch back to the kernel thread from a different mm, there is a
> double free of the old active_mm, and a missing free of the new one.
>
> Closing this race only requires interrupts to be disabled while ->mm
> and ->active_mm are being switched, but the TLB problem requires also
> holding interrupts off over activate_mm. Unfortunately not all archs
> can do that yet, e.g., arm defers the switch if irqs are disabled and
> expects finish_arch_post_lock_switch() to be called to complete the
> flush; um takes a blocking lock in activate_mm().
>
> So as a first step, disable interrupts across the mm/active_mm updates
> to close the lazy tlb preempt race, and provide an arch option to
> extend that to activate_mm which allows architectures doing IPI based
> TLB shootdowns to close the second race.
>
> This is a bit ugly, but in the interest of fixing the bug and backporting
> before all architectures are converted this is a compromise.
>
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
I'm thinking we want this selected on x86 as well. Andy?
> ---
> arch/Kconfig | 7 +++++++
> fs/exec.c | 17 +++++++++++++++--
> 2 files changed, 22 insertions(+), 2 deletions(-)
>
> diff --git a/arch/Kconfig b/arch/Kconfig
> index af14a567b493..94821e3f94d1 100644
> --- a/arch/Kconfig
> +++ b/arch/Kconfig
> @@ -414,6 +414,13 @@ config MMU_GATHER_NO_GATHER
> bool
> depends on MMU_GATHER_TABLE_FREE
>
> +config ARCH_WANT_IRQS_OFF_ACTIVATE_MM
> + bool
> + help
> + Temporary select until all architectures can be converted to have
> + irqs disabled over activate_mm. Architectures that do IPI based TLB
> + shootdowns should enable this.
> +
> config ARCH_HAVE_NMI_SAFE_CMPXCHG
> bool
>
> diff --git a/fs/exec.c b/fs/exec.c
> index a91003e28eaa..d4fb18baf1fb 100644
> --- a/fs/exec.c
> +++ b/fs/exec.c
> @@ -1130,11 +1130,24 @@ static int exec_mmap(struct mm_struct *mm)
> }
>
> task_lock(tsk);
> - active_mm = tsk->active_mm;
> membarrier_exec_mmap(mm);
> - tsk->mm = mm;
> +
> + local_irq_disable();
> + active_mm = tsk->active_mm;
> tsk->active_mm = mm;
> + tsk->mm = mm;
> + /*
> + * This prevents preemption while active_mm is being loaded and
> + * it and mm are being updated, which could cause problems for
> + * lazy tlb mm refcounting when these are updated by context
> + * switches. Not all architectures can handle irqs off over
> + * activate_mm yet.
> + */
> + if (!IS_ENABLED(CONFIG_ARCH_WANT_IRQS_OFF_ACTIVATE_MM))
> + local_irq_enable();
> activate_mm(active_mm, mm);
> + if (IS_ENABLED(CONFIG_ARCH_WANT_IRQS_OFF_ACTIVATE_MM))
> + local_irq_enable();
> tsk->mm->vmacache_seqnum = 0;
> vmacache_flush(tsk);
> task_unlock(tsk);
> --
> 2.23.0
>
^ permalink raw reply
* Re: [PATCH 00/15] selftests/seccomp: Refactor change_syscall()
From: Michael Ellerman @ 2020-09-14 12:15 UTC (permalink / raw)
To: Kees Cook, linux-kernel
Cc: Thadeu Lima de Souza Cascardo, Will Drewry, Kees Cook,
linux-xtensa, linux-mips, Andy Lutomirski, Max Filippov,
linux-arm-kernel, linux-kselftest, linuxppc-dev,
Christian Brauner
In-Reply-To: <20200912110820.597135-1-keescook@chromium.org>
Kees Cook <keescook@chromium.org> writes:
> Hi,
>
> This refactors the seccomp selftest macros used in change_syscall(),
> in an effort to remove special cases for mips, arm, arm64, and xtensa,
> which paves the way for powerpc fixes.
>
> I'm not entirely done testing, but all-arch build tests and x86_64
> selftests pass. I'll be doing arm, arm64, and i386 selftests shortly,
> but I currently don't have an easy way to check xtensa, mips, nor
> powerpc. Any help there would be appreciated!
The series builds fine for me, and all the tests pass (see below).
Thanks for picking up those changes to deal with powerpc being oddball.
Tested-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
cheers
./seccomp_bpf
TAP version 13
1..86
# Starting 86 tests from 7 test cases.
# RUN global.kcmp ...
# OK global.kcmp
ok 1 global.kcmp
# RUN global.mode_strict_support ...
# OK global.mode_strict_support
ok 2 global.mode_strict_support
# RUN global.mode_strict_cannot_call_prctl ...
# OK global.mode_strict_cannot_call_prctl
ok 3 global.mode_strict_cannot_call_prctl
# RUN global.no_new_privs_support ...
# OK global.no_new_privs_support
ok 4 global.no_new_privs_support
# RUN global.mode_filter_support ...
# OK global.mode_filter_support
ok 5 global.mode_filter_support
# RUN global.mode_filter_without_nnp ...
# OK global.mode_filter_without_nnp
ok 6 global.mode_filter_without_nnp
# RUN global.filter_size_limits ...
# OK global.filter_size_limits
ok 7 global.filter_size_limits
# RUN global.filter_chain_limits ...
# OK global.filter_chain_limits
ok 8 global.filter_chain_limits
# RUN global.mode_filter_cannot_move_to_strict ...
# OK global.mode_filter_cannot_move_to_strict
ok 9 global.mode_filter_cannot_move_to_strict
# RUN global.mode_filter_get_seccomp ...
# OK global.mode_filter_get_seccomp
ok 10 global.mode_filter_get_seccomp
# RUN global.ALLOW_all ...
# OK global.ALLOW_all
ok 11 global.ALLOW_all
# RUN global.empty_prog ...
# OK global.empty_prog
ok 12 global.empty_prog
# RUN global.log_all ...
# OK global.log_all
ok 13 global.log_all
# RUN global.unknown_ret_is_kill_inside ...
# OK global.unknown_ret_is_kill_inside
ok 14 global.unknown_ret_is_kill_inside
# RUN global.unknown_ret_is_kill_above_allow ...
# OK global.unknown_ret_is_kill_above_allow
ok 15 global.unknown_ret_is_kill_above_allow
# RUN global.KILL_all ...
# OK global.KILL_all
ok 16 global.KILL_all
# RUN global.KILL_one ...
# OK global.KILL_one
ok 17 global.KILL_one
# RUN global.KILL_one_arg_one ...
# OK global.KILL_one_arg_one
ok 18 global.KILL_one_arg_one
# RUN global.KILL_one_arg_six ...
# OK global.KILL_one_arg_six
ok 19 global.KILL_one_arg_six
# RUN global.KILL_thread ...
TAP version 13
1..86
# Starting 86 tests from 7 test cases.
# RUN global.kcmp ...
# OK global.kcmp
ok 1 global.kcmp
# RUN global.mode_strict_support ...
# OK global.mode_strict_support
ok 2 global.mode_strict_support
# RUN global.mode_strict_cannot_call_prctl ...
# OK global.mode_strict_cannot_call_prctl
ok 3 global.mode_strict_cannot_call_prctl
# RUN global.no_new_privs_support ...
# OK global.no_new_privs_support
ok 4 global.no_new_privs_support
# RUN global.mode_filter_support ...
# OK global.mode_filter_support
ok 5 global.mode_filter_support
# RUN global.mode_filter_without_nnp ...
# OK global.mode_filter_without_nnp
ok 6 global.mode_filter_without_nnp
# RUN global.filter_size_limits ...
# OK global.filter_size_limits
ok 7 global.filter_size_limits
# RUN global.filter_chain_limits ...
# OK global.filter_chain_limits
ok 8 global.filter_chain_limits
# RUN global.mode_filter_cannot_move_to_strict ...
# OK global.mode_filter_cannot_move_to_strict
ok 9 global.mode_filter_cannot_move_to_strict
# RUN global.mode_filter_get_seccomp ...
# OK global.mode_filter_get_seccomp
ok 10 global.mode_filter_get_seccomp
# RUN global.ALLOW_all ...
# OK global.ALLOW_all
ok 11 global.ALLOW_all
# RUN global.empty_prog ...
# OK global.empty_prog
ok 12 global.empty_prog
# RUN global.log_all ...
# OK global.log_all
ok 13 global.log_all
# RUN global.unknown_ret_is_kill_inside ...
# OK global.unknown_ret_is_kill_inside
ok 14 global.unknown_ret_is_kill_inside
# RUN global.unknown_ret_is_kill_above_allow ...
# OK global.unknown_ret_is_kill_above_allow
ok 15 global.unknown_ret_is_kill_above_allow
# RUN global.KILL_all ...
# OK global.KILL_all
ok 16 global.KILL_all
# RUN global.KILL_one ...
# OK global.KILL_one
ok 17 global.KILL_one
# RUN global.KILL_one_arg_one ...
# OK global.KILL_one_arg_one
ok 18 global.KILL_one_arg_one
# RUN global.KILL_one_arg_six ...
# OK global.KILL_one_arg_six
ok 19 global.KILL_one_arg_six
# RUN global.KILL_thread ...
# OK global.KILL_thread
ok 20 global.KILL_thread
# RUN global.KILL_process ...
# OK global.KILL_process
ok 21 global.KILL_process
# RUN global.arg_out_of_range ...
# OK global.arg_out_of_range
ok 22 global.arg_out_of_range
# RUN global.ERRNO_valid ...
# OK global.ERRNO_valid
ok 23 global.ERRNO_valid
# RUN global.ERRNO_zero ...
# OK global.ERRNO_zero
ok 24 global.ERRNO_zero
# RUN global.ERRNO_capped ...
# OK global.ERRNO_capped
ok 25 global.ERRNO_capped
# RUN global.ERRNO_order ...
# OK global.ERRNO_order
ok 26 global.ERRNO_order
# RUN global.negative_ENOSYS ...
# OK global.negative_ENOSYS
ok 27 global.negative_ENOSYS
# RUN global.seccomp_syscall ...
# OK global.seccomp_syscall
ok 28 global.seccomp_syscall
# RUN global.seccomp_syscall_mode_lock ...
# OK global.seccomp_syscall_mode_lock
ok 29 global.seccomp_syscall_mode_lock
# RUN global.detect_seccomp_filter_flags ...
# OK global.detect_seccomp_filter_flags
ok 30 global.detect_seccomp_filter_flags
# RUN global.TSYNC_first ...
# OK global.TSYNC_first
ok 31 global.TSYNC_first
# RUN global.syscall_restart ...
# OK global.syscall_restart
ok 32 global.syscall_restart
# RUN global.filter_flag_log ...
# OK global.filter_flag_log
ok 33 global.filter_flag_log
# RUN global.get_action_avail ...
# OK global.get_action_avail
ok 34 global.get_action_avail
# RUN global.get_metadata ...
# OK global.get_metadata
ok 35 global.get_metadata
# RUN global.user_notification_basic ...
TAP version 13
1..86
# Starting 86 tests from 7 test cases.
# RUN global.kcmp ...
# OK global.kcmp
ok 1 global.kcmp
# RUN global.mode_strict_support ...
# OK global.mode_strict_support
ok 2 global.mode_strict_support
# RUN global.mode_strict_cannot_call_prctl ...
# OK global.mode_strict_cannot_call_prctl
ok 3 global.mode_strict_cannot_call_prctl
# RUN global.no_new_privs_support ...
# OK global.no_new_privs_support
ok 4 global.no_new_privs_support
# RUN global.mode_filter_support ...
# OK global.mode_filter_support
ok 5 global.mode_filter_support
# RUN global.mode_filter_without_nnp ...
# OK global.mode_filter_without_nnp
ok 6 global.mode_filter_without_nnp
# RUN global.filter_size_limits ...
# OK global.filter_size_limits
ok 7 global.filter_size_limits
# RUN global.filter_chain_limits ...
# OK global.filter_chain_limits
ok 8 global.filter_chain_limits
# RUN global.mode_filter_cannot_move_to_strict ...
# OK global.mode_filter_cannot_move_to_strict
ok 9 global.mode_filter_cannot_move_to_strict
# RUN global.mode_filter_get_seccomp ...
# OK global.mode_filter_get_seccomp
ok 10 global.mode_filter_get_seccomp
# RUN global.ALLOW_all ...
# OK global.ALLOW_all
ok 11 global.ALLOW_all
# RUN global.empty_prog ...
# OK global.empty_prog
ok 12 global.empty_prog
# RUN global.log_all ...
# OK global.log_all
ok 13 global.log_all
# RUN global.unknown_ret_is_kill_inside ...
# OK global.unknown_ret_is_kill_inside
ok 14 global.unknown_ret_is_kill_inside
# RUN global.unknown_ret_is_kill_above_allow ...
# OK global.unknown_ret_is_kill_above_allow
ok 15 global.unknown_ret_is_kill_above_allow
# RUN global.KILL_all ...
# OK global.KILL_all
ok 16 global.KILL_all
# RUN global.KILL_one ...
# OK global.KILL_one
ok 17 global.KILL_one
# RUN global.KILL_one_arg_one ...
# OK global.KILL_one_arg_one
ok 18 global.KILL_one_arg_one
# RUN global.KILL_one_arg_six ...
# OK global.KILL_one_arg_six
ok 19 global.KILL_one_arg_six
# RUN global.KILL_thread ...
# OK global.KILL_thread
ok 20 global.KILL_thread
# RUN global.KILL_process ...
# OK global.KILL_process
ok 21 global.KILL_process
# RUN global.arg_out_of_range ...
# OK global.arg_out_of_range
ok 22 global.arg_out_of_range
# RUN global.ERRNO_valid ...
# OK global.ERRNO_valid
ok 23 global.ERRNO_valid
# RUN global.ERRNO_zero ...
# OK global.ERRNO_zero
ok 24 global.ERRNO_zero
# RUN global.ERRNO_capped ...
# OK global.ERRNO_capped
ok 25 global.ERRNO_capped
# RUN global.ERRNO_order ...
# OK global.ERRNO_order
ok 26 global.ERRNO_order
# RUN global.negative_ENOSYS ...
# OK global.negative_ENOSYS
ok 27 global.negative_ENOSYS
# RUN global.seccomp_syscall ...
# OK global.seccomp_syscall
ok 28 global.seccomp_syscall
# RUN global.seccomp_syscall_mode_lock ...
# OK global.seccomp_syscall_mode_lock
ok 29 global.seccomp_syscall_mode_lock
# RUN global.detect_seccomp_filter_flags ...
# OK global.detect_seccomp_filter_flags
ok 30 global.detect_seccomp_filter_flags
# RUN global.TSYNC_first ...
# OK global.TSYNC_first
ok 31 global.TSYNC_first
# RUN global.syscall_restart ...
# OK global.syscall_restart
ok 32 global.syscall_restart
# RUN global.filter_flag_log ...
# OK global.filter_flag_log
ok 33 global.filter_flag_log
# RUN global.get_action_avail ...
# OK global.get_action_avail
ok 34 global.get_action_avail
# RUN global.get_metadata ...
# OK global.get_metadata
ok 35 global.get_metadata
# RUN global.user_notification_basic ...
TAP version 13
1..86
# Starting 86 tests from 7 test cases.
# RUN global.kcmp ...
# OK global.kcmp
ok 1 global.kcmp
# RUN global.mode_strict_support ...
# OK global.mode_strict_support
ok 2 global.mode_strict_support
# RUN global.mode_strict_cannot_call_prctl ...
# OK global.mode_strict_cannot_call_prctl
ok 3 global.mode_strict_cannot_call_prctl
# RUN global.no_new_privs_support ...
# OK global.no_new_privs_support
ok 4 global.no_new_privs_support
# RUN global.mode_filter_support ...
# OK global.mode_filter_support
ok 5 global.mode_filter_support
# RUN global.mode_filter_without_nnp ...
# OK global.mode_filter_without_nnp
ok 6 global.mode_filter_without_nnp
# RUN global.filter_size_limits ...
# OK global.filter_size_limits
ok 7 global.filter_size_limits
# RUN global.filter_chain_limits ...
# OK global.filter_chain_limits
ok 8 global.filter_chain_limits
# RUN global.mode_filter_cannot_move_to_strict ...
# OK global.mode_filter_cannot_move_to_strict
ok 9 global.mode_filter_cannot_move_to_strict
# RUN global.mode_filter_get_seccomp ...
# OK global.mode_filter_get_seccomp
ok 10 global.mode_filter_get_seccomp
# RUN global.ALLOW_all ...
# OK global.ALLOW_all
ok 11 global.ALLOW_all
# RUN global.empty_prog ...
# OK global.empty_prog
ok 12 global.empty_prog
# RUN global.log_all ...
# OK global.log_all
ok 13 global.log_all
# RUN global.unknown_ret_is_kill_inside ...
# OK global.unknown_ret_is_kill_inside
ok 14 global.unknown_ret_is_kill_inside
# RUN global.unknown_ret_is_kill_above_allow ...
# OK global.unknown_ret_is_kill_above_allow
ok 15 global.unknown_ret_is_kill_above_allow
# RUN global.KILL_all ...
# OK global.KILL_all
ok 16 global.KILL_all
# RUN global.KILL_one ...
# OK global.KILL_one
ok 17 global.KILL_one
# RUN global.KILL_one_arg_one ...
# OK global.KILL_one_arg_one
ok 18 global.KILL_one_arg_one
# RUN global.KILL_one_arg_six ...
# OK global.KILL_one_arg_six
ok 19 global.KILL_one_arg_six
# RUN global.KILL_thread ...
# OK global.KILL_thread
ok 20 global.KILL_thread
# RUN global.KILL_process ...
# OK global.KILL_process
ok 21 global.KILL_process
# RUN global.arg_out_of_range ...
# OK global.arg_out_of_range
ok 22 global.arg_out_of_range
# RUN global.ERRNO_valid ...
# OK global.ERRNO_valid
ok 23 global.ERRNO_valid
# RUN global.ERRNO_zero ...
# OK global.ERRNO_zero
ok 24 global.ERRNO_zero
# RUN global.ERRNO_capped ...
# OK global.ERRNO_capped
ok 25 global.ERRNO_capped
# RUN global.ERRNO_order ...
# OK global.ERRNO_order
ok 26 global.ERRNO_order
# RUN global.negative_ENOSYS ...
# OK global.negative_ENOSYS
ok 27 global.negative_ENOSYS
# RUN global.seccomp_syscall ...
# OK global.seccomp_syscall
ok 28 global.seccomp_syscall
# RUN global.seccomp_syscall_mode_lock ...
# OK global.seccomp_syscall_mode_lock
ok 29 global.seccomp_syscall_mode_lock
# RUN global.detect_seccomp_filter_flags ...
# OK global.detect_seccomp_filter_flags
ok 30 global.detect_seccomp_filter_flags
# RUN global.TSYNC_first ...
# OK global.TSYNC_first
ok 31 global.TSYNC_first
# RUN global.syscall_restart ...
# OK global.syscall_restart
ok 32 global.syscall_restart
# RUN global.filter_flag_log ...
# OK global.filter_flag_log
ok 33 global.filter_flag_log
# RUN global.get_action_avail ...
# OK global.get_action_avail
ok 34 global.get_action_avail
# RUN global.get_metadata ...
# OK global.get_metadata
ok 35 global.get_metadata
# RUN global.user_notification_basic ...
# OK global.user_notification_basic
ok 36 global.user_notification_basic
# RUN global.user_notification_with_tsync ...
# OK global.user_notification_with_tsync
ok 37 global.user_notification_with_tsync
# RUN global.user_notification_kill_in_middle ...
# OK global.user_notification_kill_in_middle
ok 38 global.user_notification_kill_in_middle
# RUN global.user_notification_signal ...
TAP version 13
1..86
# Starting 86 tests from 7 test cases.
# RUN global.kcmp ...
# OK global.kcmp
ok 1 global.kcmp
# RUN global.mode_strict_support ...
# OK global.mode_strict_support
ok 2 global.mode_strict_support
# RUN global.mode_strict_cannot_call_prctl ...
# OK global.mode_strict_cannot_call_prctl
ok 3 global.mode_strict_cannot_call_prctl
# RUN global.no_new_privs_support ...
# OK global.no_new_privs_support
ok 4 global.no_new_privs_support
# RUN global.mode_filter_support ...
# OK global.mode_filter_support
ok 5 global.mode_filter_support
# RUN global.mode_filter_without_nnp ...
# OK global.mode_filter_without_nnp
ok 6 global.mode_filter_without_nnp
# RUN global.filter_size_limits ...
# OK global.filter_size_limits
ok 7 global.filter_size_limits
# RUN global.filter_chain_limits ...
# OK global.filter_chain_limits
ok 8 global.filter_chain_limits
# RUN global.mode_filter_cannot_move_to_strict ...
# OK global.mode_filter_cannot_move_to_strict
ok 9 global.mode_filter_cannot_move_to_strict
# RUN global.mode_filter_get_seccomp ...
# OK global.mode_filter_get_seccomp
ok 10 global.mode_filter_get_seccomp
# RUN global.ALLOW_all ...
# OK global.ALLOW_all
ok 11 global.ALLOW_all
# RUN global.empty_prog ...
# OK global.empty_prog
ok 12 global.empty_prog
# RUN global.log_all ...
# OK global.log_all
ok 13 global.log_all
# RUN global.unknown_ret_is_kill_inside ...
# OK global.unknown_ret_is_kill_inside
ok 14 global.unknown_ret_is_kill_inside
# RUN global.unknown_ret_is_kill_above_allow ...
# OK global.unknown_ret_is_kill_above_allow
ok 15 global.unknown_ret_is_kill_above_allow
# RUN global.KILL_all ...
# OK global.KILL_all
ok 16 global.KILL_all
# RUN global.KILL_one ...
# OK global.KILL_one
ok 17 global.KILL_one
# RUN global.KILL_one_arg_one ...
# OK global.KILL_one_arg_one
ok 18 global.KILL_one_arg_one
# RUN global.KILL_one_arg_six ...
# OK global.KILL_one_arg_six
ok 19 global.KILL_one_arg_six
# RUN global.KILL_thread ...
# OK global.KILL_thread
ok 20 global.KILL_thread
# RUN global.KILL_process ...
# OK global.KILL_process
ok 21 global.KILL_process
# RUN global.arg_out_of_range ...
# OK global.arg_out_of_range
ok 22 global.arg_out_of_range
# RUN global.ERRNO_valid ...
# OK global.ERRNO_valid
ok 23 global.ERRNO_valid
# RUN global.ERRNO_zero ...
# OK global.ERRNO_zero
ok 24 global.ERRNO_zero
# RUN global.ERRNO_capped ...
# OK global.ERRNO_capped
ok 25 global.ERRNO_capped
# RUN global.ERRNO_order ...
# OK global.ERRNO_order
ok 26 global.ERRNO_order
# RUN global.negative_ENOSYS ...
# OK global.negative_ENOSYS
ok 27 global.negative_ENOSYS
# RUN global.seccomp_syscall ...
# OK global.seccomp_syscall
ok 28 global.seccomp_syscall
# RUN global.seccomp_syscall_mode_lock ...
# OK global.seccomp_syscall_mode_lock
ok 29 global.seccomp_syscall_mode_lock
# RUN global.detect_seccomp_filter_flags ...
# OK global.detect_seccomp_filter_flags
ok 30 global.detect_seccomp_filter_flags
# RUN global.TSYNC_first ...
# OK global.TSYNC_first
ok 31 global.TSYNC_first
# RUN global.syscall_restart ...
# OK global.syscall_restart
ok 32 global.syscall_restart
# RUN global.filter_flag_log ...
# OK global.filter_flag_log
ok 33 global.filter_flag_log
# RUN global.get_action_avail ...
# OK global.get_action_avail
ok 34 global.get_action_avail
# RUN global.get_metadata ...
# OK global.get_metadata
ok 35 global.get_metadata
# RUN global.user_notification_basic ...
# OK global.user_notification_basic
ok 36 global.user_notification_basic
# RUN global.user_notification_with_tsync ...
# OK global.user_notification_with_tsync
ok 37 global.user_notification_with_tsync
# RUN global.user_notification_kill_in_middle ...
# OK global.user_notification_kill_in_middle
ok 38 global.user_notification_kill_in_middle
# RUN global.user_notification_signal ...
# OK global.user_notification_signal
ok 39 global.user_notification_signal
# RUN global.user_notification_closed_listener ...
TAP version 13
1..86
# Starting 86 tests from 7 test cases.
# RUN global.kcmp ...
# OK global.kcmp
ok 1 global.kcmp
# RUN global.mode_strict_support ...
# OK global.mode_strict_support
ok 2 global.mode_strict_support
# RUN global.mode_strict_cannot_call_prctl ...
# OK global.mode_strict_cannot_call_prctl
ok 3 global.mode_strict_cannot_call_prctl
# RUN global.no_new_privs_support ...
# OK global.no_new_privs_support
ok 4 global.no_new_privs_support
# RUN global.mode_filter_support ...
# OK global.mode_filter_support
ok 5 global.mode_filter_support
# RUN global.mode_filter_without_nnp ...
# OK global.mode_filter_without_nnp
ok 6 global.mode_filter_without_nnp
# RUN global.filter_size_limits ...
# OK global.filter_size_limits
ok 7 global.filter_size_limits
# RUN global.filter_chain_limits ...
# OK global.filter_chain_limits
ok 8 global.filter_chain_limits
# RUN global.mode_filter_cannot_move_to_strict ...
# OK global.mode_filter_cannot_move_to_strict
ok 9 global.mode_filter_cannot_move_to_strict
# RUN global.mode_filter_get_seccomp ...
# OK global.mode_filter_get_seccomp
ok 10 global.mode_filter_get_seccomp
# RUN global.ALLOW_all ...
# OK global.ALLOW_all
ok 11 global.ALLOW_all
# RUN global.empty_prog ...
# OK global.empty_prog
ok 12 global.empty_prog
# RUN global.log_all ...
# OK global.log_all
ok 13 global.log_all
# RUN global.unknown_ret_is_kill_inside ...
# OK global.unknown_ret_is_kill_inside
ok 14 global.unknown_ret_is_kill_inside
# RUN global.unknown_ret_is_kill_above_allow ...
# OK global.unknown_ret_is_kill_above_allow
ok 15 global.unknown_ret_is_kill_above_allow
# RUN global.KILL_all ...
# OK global.KILL_all
ok 16 global.KILL_all
# RUN global.KILL_one ...
# OK global.KILL_one
ok 17 global.KILL_one
# RUN global.KILL_one_arg_one ...
# OK global.KILL_one_arg_one
ok 18 global.KILL_one_arg_one
# RUN global.KILL_one_arg_six ...
# OK global.KILL_one_arg_six
ok 19 global.KILL_one_arg_six
# RUN global.KILL_thread ...
# OK global.KILL_thread
ok 20 global.KILL_thread
# RUN global.KILL_process ...
# OK global.KILL_process
ok 21 global.KILL_process
# RUN global.arg_out_of_range ...
# OK global.arg_out_of_range
ok 22 global.arg_out_of_range
# RUN global.ERRNO_valid ...
# OK global.ERRNO_valid
ok 23 global.ERRNO_valid
# RUN global.ERRNO_zero ...
# OK global.ERRNO_zero
ok 24 global.ERRNO_zero
# RUN global.ERRNO_capped ...
# OK global.ERRNO_capped
ok 25 global.ERRNO_capped
# RUN global.ERRNO_order ...
# OK global.ERRNO_order
ok 26 global.ERRNO_order
# RUN global.negative_ENOSYS ...
# OK global.negative_ENOSYS
ok 27 global.negative_ENOSYS
# RUN global.seccomp_syscall ...
# OK global.seccomp_syscall
ok 28 global.seccomp_syscall
# RUN global.seccomp_syscall_mode_lock ...
# OK global.seccomp_syscall_mode_lock
ok 29 global.seccomp_syscall_mode_lock
# RUN global.detect_seccomp_filter_flags ...
# OK global.detect_seccomp_filter_flags
ok 30 global.detect_seccomp_filter_flags
# RUN global.TSYNC_first ...
# OK global.TSYNC_first
ok 31 global.TSYNC_first
# RUN global.syscall_restart ...
# OK global.syscall_restart
ok 32 global.syscall_restart
# RUN global.filter_flag_log ...
# OK global.filter_flag_log
ok 33 global.filter_flag_log
# RUN global.get_action_avail ...
# OK global.get_action_avail
ok 34 global.get_action_avail
# RUN global.get_metadata ...
# OK global.get_metadata
ok 35 global.get_metadata
# RUN global.user_notification_basic ...
# OK global.user_notification_basic
ok 36 global.user_notification_basic
# RUN global.user_notification_with_tsync ...
# OK global.user_notification_with_tsync
ok 37 global.user_notification_with_tsync
# RUN global.user_notification_kill_in_middle ...
# OK global.user_notification_kill_in_middle
ok 38 global.user_notification_kill_in_middle
# RUN global.user_notification_signal ...
# OK global.user_notification_signal
ok 39 global.user_notification_signal
# RUN global.user_notification_closed_listener ...
# OK global.user_notification_closed_listener
ok 40 global.user_notification_closed_listener
# RUN global.user_notification_child_pid_ns ...
TAP version 13
1..86
# Starting 86 tests from 7 test cases.
# RUN global.kcmp ...
# OK global.kcmp
ok 1 global.kcmp
# RUN global.mode_strict_support ...
# OK global.mode_strict_support
ok 2 global.mode_strict_support
# RUN global.mode_strict_cannot_call_prctl ...
# OK global.mode_strict_cannot_call_prctl
ok 3 global.mode_strict_cannot_call_prctl
# RUN global.no_new_privs_support ...
# OK global.no_new_privs_support
ok 4 global.no_new_privs_support
# RUN global.mode_filter_support ...
# OK global.mode_filter_support
ok 5 global.mode_filter_support
# RUN global.mode_filter_without_nnp ...
# OK global.mode_filter_without_nnp
ok 6 global.mode_filter_without_nnp
# RUN global.filter_size_limits ...
# OK global.filter_size_limits
ok 7 global.filter_size_limits
# RUN global.filter_chain_limits ...
# OK global.filter_chain_limits
ok 8 global.filter_chain_limits
# RUN global.mode_filter_cannot_move_to_strict ...
# OK global.mode_filter_cannot_move_to_strict
ok 9 global.mode_filter_cannot_move_to_strict
# RUN global.mode_filter_get_seccomp ...
# OK global.mode_filter_get_seccomp
ok 10 global.mode_filter_get_seccomp
# RUN global.ALLOW_all ...
# OK global.ALLOW_all
ok 11 global.ALLOW_all
# RUN global.empty_prog ...
# OK global.empty_prog
ok 12 global.empty_prog
# RUN global.log_all ...
# OK global.log_all
ok 13 global.log_all
# RUN global.unknown_ret_is_kill_inside ...
# OK global.unknown_ret_is_kill_inside
ok 14 global.unknown_ret_is_kill_inside
# RUN global.unknown_ret_is_kill_above_allow ...
# OK global.unknown_ret_is_kill_above_allow
ok 15 global.unknown_ret_is_kill_above_allow
# RUN global.KILL_all ...
# OK global.KILL_all
ok 16 global.KILL_all
# RUN global.KILL_one ...
# OK global.KILL_one
ok 17 global.KILL_one
# RUN global.KILL_one_arg_one ...
# OK global.KILL_one_arg_one
ok 18 global.KILL_one_arg_one
# RUN global.KILL_one_arg_six ...
# OK global.KILL_one_arg_six
ok 19 global.KILL_one_arg_six
# RUN global.KILL_thread ...
# OK global.KILL_thread
ok 20 global.KILL_thread
# RUN global.KILL_process ...
# OK global.KILL_process
ok 21 global.KILL_process
# RUN global.arg_out_of_range ...
# OK global.arg_out_of_range
ok 22 global.arg_out_of_range
# RUN global.ERRNO_valid ...
# OK global.ERRNO_valid
ok 23 global.ERRNO_valid
# RUN global.ERRNO_zero ...
# OK global.ERRNO_zero
ok 24 global.ERRNO_zero
# RUN global.ERRNO_capped ...
# OK global.ERRNO_capped
ok 25 global.ERRNO_capped
# RUN global.ERRNO_order ...
# OK global.ERRNO_order
ok 26 global.ERRNO_order
# RUN global.negative_ENOSYS ...
# OK global.negative_ENOSYS
ok 27 global.negative_ENOSYS
# RUN global.seccomp_syscall ...
# OK global.seccomp_syscall
ok 28 global.seccomp_syscall
# RUN global.seccomp_syscall_mode_lock ...
# OK global.seccomp_syscall_mode_lock
ok 29 global.seccomp_syscall_mode_lock
# RUN global.detect_seccomp_filter_flags ...
# OK global.detect_seccomp_filter_flags
ok 30 global.detect_seccomp_filter_flags
# RUN global.TSYNC_first ...
# OK global.TSYNC_first
ok 31 global.TSYNC_first
# RUN global.syscall_restart ...
# OK global.syscall_restart
ok 32 global.syscall_restart
# RUN global.filter_flag_log ...
# OK global.filter_flag_log
ok 33 global.filter_flag_log
# RUN global.get_action_avail ...
# OK global.get_action_avail
ok 34 global.get_action_avail
# RUN global.get_metadata ...
# OK global.get_metadata
ok 35 global.get_metadata
# RUN global.user_notification_basic ...
# OK global.user_notification_basic
ok 36 global.user_notification_basic
# RUN global.user_notification_with_tsync ...
# OK global.user_notification_with_tsync
ok 37 global.user_notification_with_tsync
# RUN global.user_notification_kill_in_middle ...
# OK global.user_notification_kill_in_middle
ok 38 global.user_notification_kill_in_middle
# RUN global.user_notification_signal ...
# OK global.user_notification_signal
ok 39 global.user_notification_signal
# RUN global.user_notification_closed_listener ...
# OK global.user_notification_closed_listener
ok 40 global.user_notification_closed_listener
# RUN global.user_notification_child_pid_ns ...
# OK global.user_notification_child_pid_ns
ok 41 global.user_notification_child_pid_ns
# RUN global.user_notification_sibling_pid_ns ...
TAP version 13
1..86
# Starting 86 tests from 7 test cases.
# RUN global.kcmp ...
# OK global.kcmp
ok 1 global.kcmp
# RUN global.mode_strict_support ...
# OK global.mode_strict_support
ok 2 global.mode_strict_support
# RUN global.mode_strict_cannot_call_prctl ...
# OK global.mode_strict_cannot_call_prctl
ok 3 global.mode_strict_cannot_call_prctl
# RUN global.no_new_privs_support ...
# OK global.no_new_privs_support
ok 4 global.no_new_privs_support
# RUN global.mode_filter_support ...
# OK global.mode_filter_support
ok 5 global.mode_filter_support
# RUN global.mode_filter_without_nnp ...
# OK global.mode_filter_without_nnp
ok 6 global.mode_filter_without_nnp
# RUN global.filter_size_limits ...
# OK global.filter_size_limits
ok 7 global.filter_size_limits
# RUN global.filter_chain_limits ...
# OK global.filter_chain_limits
ok 8 global.filter_chain_limits
# RUN global.mode_filter_cannot_move_to_strict ...
# OK global.mode_filter_cannot_move_to_strict
ok 9 global.mode_filter_cannot_move_to_strict
# RUN global.mode_filter_get_seccomp ...
# OK global.mode_filter_get_seccomp
ok 10 global.mode_filter_get_seccomp
# RUN global.ALLOW_all ...
# OK global.ALLOW_all
ok 11 global.ALLOW_all
# RUN global.empty_prog ...
# OK global.empty_prog
ok 12 global.empty_prog
# RUN global.log_all ...
# OK global.log_all
ok 13 global.log_all
# RUN global.unknown_ret_is_kill_inside ...
# OK global.unknown_ret_is_kill_inside
ok 14 global.unknown_ret_is_kill_inside
# RUN global.unknown_ret_is_kill_above_allow ...
# OK global.unknown_ret_is_kill_above_allow
ok 15 global.unknown_ret_is_kill_above_allow
# RUN global.KILL_all ...
# OK global.KILL_all
ok 16 global.KILL_all
# RUN global.KILL_one ...
# OK global.KILL_one
ok 17 global.KILL_one
# RUN global.KILL_one_arg_one ...
# OK global.KILL_one_arg_one
ok 18 global.KILL_one_arg_one
# RUN global.KILL_one_arg_six ...
# OK global.KILL_one_arg_six
ok 19 global.KILL_one_arg_six
# RUN global.KILL_thread ...
# OK global.KILL_thread
ok 20 global.KILL_thread
# RUN global.KILL_process ...
# OK global.KILL_process
ok 21 global.KILL_process
# RUN global.arg_out_of_range ...
# OK global.arg_out_of_range
ok 22 global.arg_out_of_range
# RUN global.ERRNO_valid ...
# OK global.ERRNO_valid
ok 23 global.ERRNO_valid
# RUN global.ERRNO_zero ...
# OK global.ERRNO_zero
ok 24 global.ERRNO_zero
# RUN global.ERRNO_capped ...
# OK global.ERRNO_capped
ok 25 global.ERRNO_capped
# RUN global.ERRNO_order ...
# OK global.ERRNO_order
ok 26 global.ERRNO_order
# RUN global.negative_ENOSYS ...
# OK global.negative_ENOSYS
ok 27 global.negative_ENOSYS
# RUN global.seccomp_syscall ...
# OK global.seccomp_syscall
ok 28 global.seccomp_syscall
# RUN global.seccomp_syscall_mode_lock ...
# OK global.seccomp_syscall_mode_lock
ok 29 global.seccomp_syscall_mode_lock
# RUN global.detect_seccomp_filter_flags ...
# OK global.detect_seccomp_filter_flags
ok 30 global.detect_seccomp_filter_flags
# RUN global.TSYNC_first ...
# OK global.TSYNC_first
ok 31 global.TSYNC_first
# RUN global.syscall_restart ...
# OK global.syscall_restart
ok 32 global.syscall_restart
# RUN global.filter_flag_log ...
# OK global.filter_flag_log
ok 33 global.filter_flag_log
# RUN global.get_action_avail ...
# OK global.get_action_avail
ok 34 global.get_action_avail
# RUN global.get_metadata ...
# OK global.get_metadata
ok 35 global.get_metadata
# RUN global.user_notification_basic ...
# OK global.user_notification_basic
ok 36 global.user_notification_basic
# RUN global.user_notification_with_tsync ...
# OK global.user_notification_with_tsync
ok 37 global.user_notification_with_tsync
# RUN global.user_notification_kill_in_middle ...
# OK global.user_notification_kill_in_middle
ok 38 global.user_notification_kill_in_middle
# RUN global.user_notification_signal ...
# OK global.user_notification_signal
ok 39 global.user_notification_signal
# RUN global.user_notification_closed_listener ...
# OK global.user_notification_closed_listener
ok 40 global.user_notification_closed_listener
# RUN global.user_notification_child_pid_ns ...
# OK global.user_notification_child_pid_ns
ok 41 global.user_notification_child_pid_ns
# RUN global.user_notification_sibling_pid_ns ...
TAP version 13
1..86
# Starting 86 tests from 7 test cases.
# RUN global.kcmp ...
# OK global.kcmp
ok 1 global.kcmp
# RUN global.mode_strict_support ...
# OK global.mode_strict_support
ok 2 global.mode_strict_support
# RUN global.mode_strict_cannot_call_prctl ...
# OK global.mode_strict_cannot_call_prctl
ok 3 global.mode_strict_cannot_call_prctl
# RUN global.no_new_privs_support ...
# OK global.no_new_privs_support
ok 4 global.no_new_privs_support
# RUN global.mode_filter_support ...
# OK global.mode_filter_support
ok 5 global.mode_filter_support
# RUN global.mode_filter_without_nnp ...
# OK global.mode_filter_without_nnp
ok 6 global.mode_filter_without_nnp
# RUN global.filter_size_limits ...
# OK global.filter_size_limits
ok 7 global.filter_size_limits
# RUN global.filter_chain_limits ...
# OK global.filter_chain_limits
ok 8 global.filter_chain_limits
# RUN global.mode_filter_cannot_move_to_strict ...
# OK global.mode_filter_cannot_move_to_strict
ok 9 global.mode_filter_cannot_move_to_strict
# RUN global.mode_filter_get_seccomp ...
# OK global.mode_filter_get_seccomp
ok 10 global.mode_filter_get_seccomp
# RUN global.ALLOW_all ...
# OK global.ALLOW_all
ok 11 global.ALLOW_all
# RUN global.empty_prog ...
# OK global.empty_prog
ok 12 global.empty_prog
# RUN global.log_all ...
# OK global.log_all
ok 13 global.log_all
# RUN global.unknown_ret_is_kill_inside ...
# OK global.unknown_ret_is_kill_inside
ok 14 global.unknown_ret_is_kill_inside
# RUN global.unknown_ret_is_kill_above_allow ...
# OK global.unknown_ret_is_kill_above_allow
ok 15 global.unknown_ret_is_kill_above_allow
# RUN global.KILL_all ...
# OK global.KILL_all
ok 16 global.KILL_all
# RUN global.KILL_one ...
# OK global.KILL_one
ok 17 global.KILL_one
# RUN global.KILL_one_arg_one ...
# OK global.KILL_one_arg_one
ok 18 global.KILL_one_arg_one
# RUN global.KILL_one_arg_six ...
# OK global.KILL_one_arg_six
ok 19 global.KILL_one_arg_six
# RUN global.KILL_thread ...
# OK global.KILL_thread
ok 20 global.KILL_thread
# RUN global.KILL_process ...
# OK global.KILL_process
ok 21 global.KILL_process
# RUN global.arg_out_of_range ...
# OK global.arg_out_of_range
ok 22 global.arg_out_of_range
# RUN global.ERRNO_valid ...
# OK global.ERRNO_valid
ok 23 global.ERRNO_valid
# RUN global.ERRNO_zero ...
# OK global.ERRNO_zero
ok 24 global.ERRNO_zero
# RUN global.ERRNO_capped ...
# OK global.ERRNO_capped
ok 25 global.ERRNO_capped
# RUN global.ERRNO_order ...
# OK global.ERRNO_order
ok 26 global.ERRNO_order
# RUN global.negative_ENOSYS ...
# OK global.negative_ENOSYS
ok 27 global.negative_ENOSYS
# RUN global.seccomp_syscall ...
# OK global.seccomp_syscall
ok 28 global.seccomp_syscall
# RUN global.seccomp_syscall_mode_lock ...
# OK global.seccomp_syscall_mode_lock
ok 29 global.seccomp_syscall_mode_lock
# RUN global.detect_seccomp_filter_flags ...
# OK global.detect_seccomp_filter_flags
ok 30 global.detect_seccomp_filter_flags
# RUN global.TSYNC_first ...
# OK global.TSYNC_first
ok 31 global.TSYNC_first
# RUN global.syscall_restart ...
# OK global.syscall_restart
ok 32 global.syscall_restart
# RUN global.filter_flag_log ...
# OK global.filter_flag_log
ok 33 global.filter_flag_log
# RUN global.get_action_avail ...
# OK global.get_action_avail
ok 34 global.get_action_avail
# RUN global.get_metadata ...
# OK global.get_metadata
ok 35 global.get_metadata
# RUN global.user_notification_basic ...
# OK global.user_notification_basic
ok 36 global.user_notification_basic
# RUN global.user_notification_with_tsync ...
# OK global.user_notification_with_tsync
ok 37 global.user_notification_with_tsync
# RUN global.user_notification_kill_in_middle ...
# OK global.user_notification_kill_in_middle
ok 38 global.user_notification_kill_in_middle
# RUN global.user_notification_signal ...
# OK global.user_notification_signal
ok 39 global.user_notification_signal
# RUN global.user_notification_closed_listener ...
# OK global.user_notification_closed_listener
ok 40 global.user_notification_closed_listener
# RUN global.user_notification_child_pid_ns ...
# OK global.user_notification_child_pid_ns
ok 41 global.user_notification_child_pid_ns
# RUN global.user_notification_sibling_pid_ns ...
TAP version 13
1..86
# Starting 86 tests from 7 test cases.
# RUN global.kcmp ...
# OK global.kcmp
ok 1 global.kcmp
# RUN global.mode_strict_support ...
# OK global.mode_strict_support
ok 2 global.mode_strict_support
# RUN global.mode_strict_cannot_call_prctl ...
# OK global.mode_strict_cannot_call_prctl
ok 3 global.mode_strict_cannot_call_prctl
# RUN global.no_new_privs_support ...
# OK global.no_new_privs_support
ok 4 global.no_new_privs_support
# RUN global.mode_filter_support ...
# OK global.mode_filter_support
ok 5 global.mode_filter_support
# RUN global.mode_filter_without_nnp ...
# OK global.mode_filter_without_nnp
ok 6 global.mode_filter_without_nnp
# RUN global.filter_size_limits ...
# OK global.filter_size_limits
ok 7 global.filter_size_limits
# RUN global.filter_chain_limits ...
# OK global.filter_chain_limits
ok 8 global.filter_chain_limits
# RUN global.mode_filter_cannot_move_to_strict ...
# OK global.mode_filter_cannot_move_to_strict
ok 9 global.mode_filter_cannot_move_to_strict
# RUN global.mode_filter_get_seccomp ...
# OK global.mode_filter_get_seccomp
ok 10 global.mode_filter_get_seccomp
# RUN global.ALLOW_all ...
# OK global.ALLOW_all
ok 11 global.ALLOW_all
# RUN global.empty_prog ...
# OK global.empty_prog
ok 12 global.empty_prog
# RUN global.log_all ...
# OK global.log_all
ok 13 global.log_all
# RUN global.unknown_ret_is_kill_inside ...
# OK global.unknown_ret_is_kill_inside
ok 14 global.unknown_ret_is_kill_inside
# RUN global.unknown_ret_is_kill_above_allow ...
# OK global.unknown_ret_is_kill_above_allow
ok 15 global.unknown_ret_is_kill_above_allow
# RUN global.KILL_all ...
# OK global.KILL_all
ok 16 global.KILL_all
# RUN global.KILL_one ...
# OK global.KILL_one
ok 17 global.KILL_one
# RUN global.KILL_one_arg_one ...
# OK global.KILL_one_arg_one
ok 18 global.KILL_one_arg_one
# RUN global.KILL_one_arg_six ...
# OK global.KILL_one_arg_six
ok 19 global.KILL_one_arg_six
# RUN global.KILL_thread ...
# OK global.KILL_thread
ok 20 global.KILL_thread
# RUN global.KILL_process ...
# OK global.KILL_process
ok 21 global.KILL_process
# RUN global.arg_out_of_range ...
# OK global.arg_out_of_range
ok 22 global.arg_out_of_range
# RUN global.ERRNO_valid ...
# OK global.ERRNO_valid
ok 23 global.ERRNO_valid
# RUN global.ERRNO_zero ...
# OK global.ERRNO_zero
ok 24 global.ERRNO_zero
# RUN global.ERRNO_capped ...
# OK global.ERRNO_capped
ok 25 global.ERRNO_capped
# RUN global.ERRNO_order ...
# OK global.ERRNO_order
ok 26 global.ERRNO_order
# RUN global.negative_ENOSYS ...
# OK global.negative_ENOSYS
ok 27 global.negative_ENOSYS
# RUN global.seccomp_syscall ...
# OK global.seccomp_syscall
ok 28 global.seccomp_syscall
# RUN global.seccomp_syscall_mode_lock ...
# OK global.seccomp_syscall_mode_lock
ok 29 global.seccomp_syscall_mode_lock
# RUN global.detect_seccomp_filter_flags ...
# OK global.detect_seccomp_filter_flags
ok 30 global.detect_seccomp_filter_flags
# RUN global.TSYNC_first ...
# OK global.TSYNC_first
ok 31 global.TSYNC_first
# RUN global.syscall_restart ...
# OK global.syscall_restart
ok 32 global.syscall_restart
# RUN global.filter_flag_log ...
# OK global.filter_flag_log
ok 33 global.filter_flag_log
# RUN global.get_action_avail ...
# OK global.get_action_avail
ok 34 global.get_action_avail
# RUN global.get_metadata ...
# OK global.get_metadata
ok 35 global.get_metadata
# RUN global.user_notification_basic ...
# OK global.user_notification_basic
ok 36 global.user_notification_basic
# RUN global.user_notification_with_tsync ...
# OK global.user_notification_with_tsync
ok 37 global.user_notification_with_tsync
# RUN global.user_notification_kill_in_middle ...
# OK global.user_notification_kill_in_middle
ok 38 global.user_notification_kill_in_middle
# RUN global.user_notification_signal ...
# OK global.user_notification_signal
ok 39 global.user_notification_signal
# RUN global.user_notification_closed_listener ...
# OK global.user_notification_closed_listener
ok 40 global.user_notification_closed_listener
# RUN global.user_notification_child_pid_ns ...
# OK global.user_notification_child_pid_ns
ok 41 global.user_notification_child_pid_ns
# RUN global.user_notification_sibling_pid_ns ...
# OK global.user_notification_sibling_pid_ns
ok 42 global.user_notification_sibling_pid_ns
# RUN global.user_notification_fault_recv ...
TAP version 13
1..86
# Starting 86 tests from 7 test cases.
# RUN global.kcmp ...
# OK global.kcmp
ok 1 global.kcmp
# RUN global.mode_strict_support ...
# OK global.mode_strict_support
ok 2 global.mode_strict_support
# RUN global.mode_strict_cannot_call_prctl ...
# OK global.mode_strict_cannot_call_prctl
ok 3 global.mode_strict_cannot_call_prctl
# RUN global.no_new_privs_support ...
# OK global.no_new_privs_support
ok 4 global.no_new_privs_support
# RUN global.mode_filter_support ...
# OK global.mode_filter_support
ok 5 global.mode_filter_support
# RUN global.mode_filter_without_nnp ...
# OK global.mode_filter_without_nnp
ok 6 global.mode_filter_without_nnp
# RUN global.filter_size_limits ...
# OK global.filter_size_limits
ok 7 global.filter_size_limits
# RUN global.filter_chain_limits ...
# OK global.filter_chain_limits
ok 8 global.filter_chain_limits
# RUN global.mode_filter_cannot_move_to_strict ...
# OK global.mode_filter_cannot_move_to_strict
ok 9 global.mode_filter_cannot_move_to_strict
# RUN global.mode_filter_get_seccomp ...
# OK global.mode_filter_get_seccomp
ok 10 global.mode_filter_get_seccomp
# RUN global.ALLOW_all ...
# OK global.ALLOW_all
ok 11 global.ALLOW_all
# RUN global.empty_prog ...
# OK global.empty_prog
ok 12 global.empty_prog
# RUN global.log_all ...
# OK global.log_all
ok 13 global.log_all
# RUN global.unknown_ret_is_kill_inside ...
# OK global.unknown_ret_is_kill_inside
ok 14 global.unknown_ret_is_kill_inside
# RUN global.unknown_ret_is_kill_above_allow ...
# OK global.unknown_ret_is_kill_above_allow
ok 15 global.unknown_ret_is_kill_above_allow
# RUN global.KILL_all ...
# OK global.KILL_all
ok 16 global.KILL_all
# RUN global.KILL_one ...
# OK global.KILL_one
ok 17 global.KILL_one
# RUN global.KILL_one_arg_one ...
# OK global.KILL_one_arg_one
ok 18 global.KILL_one_arg_one
# RUN global.KILL_one_arg_six ...
# OK global.KILL_one_arg_six
ok 19 global.KILL_one_arg_six
# RUN global.KILL_thread ...
# OK global.KILL_thread
ok 20 global.KILL_thread
# RUN global.KILL_process ...
# OK global.KILL_process
ok 21 global.KILL_process
# RUN global.arg_out_of_range ...
# OK global.arg_out_of_range
ok 22 global.arg_out_of_range
# RUN global.ERRNO_valid ...
# OK global.ERRNO_valid
ok 23 global.ERRNO_valid
# RUN global.ERRNO_zero ...
# OK global.ERRNO_zero
ok 24 global.ERRNO_zero
# RUN global.ERRNO_capped ...
# OK global.ERRNO_capped
ok 25 global.ERRNO_capped
# RUN global.ERRNO_order ...
# OK global.ERRNO_order
ok 26 global.ERRNO_order
# RUN global.negative_ENOSYS ...
# OK global.negative_ENOSYS
ok 27 global.negative_ENOSYS
# RUN global.seccomp_syscall ...
# OK global.seccomp_syscall
ok 28 global.seccomp_syscall
# RUN global.seccomp_syscall_mode_lock ...
# OK global.seccomp_syscall_mode_lock
ok 29 global.seccomp_syscall_mode_lock
# RUN global.detect_seccomp_filter_flags ...
# OK global.detect_seccomp_filter_flags
ok 30 global.detect_seccomp_filter_flags
# RUN global.TSYNC_first ...
# OK global.TSYNC_first
ok 31 global.TSYNC_first
# RUN global.syscall_restart ...
# OK global.syscall_restart
ok 32 global.syscall_restart
# RUN global.filter_flag_log ...
# OK global.filter_flag_log
ok 33 global.filter_flag_log
# RUN global.get_action_avail ...
# OK global.get_action_avail
ok 34 global.get_action_avail
# RUN global.get_metadata ...
# OK global.get_metadata
ok 35 global.get_metadata
# RUN global.user_notification_basic ...
# OK global.user_notification_basic
ok 36 global.user_notification_basic
# RUN global.user_notification_with_tsync ...
# OK global.user_notification_with_tsync
ok 37 global.user_notification_with_tsync
# RUN global.user_notification_kill_in_middle ...
# OK global.user_notification_kill_in_middle
ok 38 global.user_notification_kill_in_middle
# RUN global.user_notification_signal ...
# OK global.user_notification_signal
ok 39 global.user_notification_signal
# RUN global.user_notification_closed_listener ...
# OK global.user_notification_closed_listener
ok 40 global.user_notification_closed_listener
# RUN global.user_notification_child_pid_ns ...
# OK global.user_notification_child_pid_ns
ok 41 global.user_notification_child_pid_ns
# RUN global.user_notification_sibling_pid_ns ...
# OK global.user_notification_sibling_pid_ns
ok 42 global.user_notification_sibling_pid_ns
# RUN global.user_notification_fault_recv ...
# OK global.user_notification_fault_recv
ok 43 global.user_notification_fault_recv
# RUN global.seccomp_get_notif_sizes ...
# OK global.seccomp_get_notif_sizes
ok 44 global.seccomp_get_notif_sizes
# RUN global.user_notification_continue ...
TAP version 13
1..86
# Starting 86 tests from 7 test cases.
# RUN global.kcmp ...
# OK global.kcmp
ok 1 global.kcmp
# RUN global.mode_strict_support ...
# OK global.mode_strict_support
ok 2 global.mode_strict_support
# RUN global.mode_strict_cannot_call_prctl ...
# OK global.mode_strict_cannot_call_prctl
ok 3 global.mode_strict_cannot_call_prctl
# RUN global.no_new_privs_support ...
# OK global.no_new_privs_support
ok 4 global.no_new_privs_support
# RUN global.mode_filter_support ...
# OK global.mode_filter_support
ok 5 global.mode_filter_support
# RUN global.mode_filter_without_nnp ...
# OK global.mode_filter_without_nnp
ok 6 global.mode_filter_without_nnp
# RUN global.filter_size_limits ...
# OK global.filter_size_limits
ok 7 global.filter_size_limits
# RUN global.filter_chain_limits ...
# OK global.filter_chain_limits
ok 8 global.filter_chain_limits
# RUN global.mode_filter_cannot_move_to_strict ...
# OK global.mode_filter_cannot_move_to_strict
ok 9 global.mode_filter_cannot_move_to_strict
# RUN global.mode_filter_get_seccomp ...
# OK global.mode_filter_get_seccomp
ok 10 global.mode_filter_get_seccomp
# RUN global.ALLOW_all ...
# OK global.ALLOW_all
ok 11 global.ALLOW_all
# RUN global.empty_prog ...
# OK global.empty_prog
ok 12 global.empty_prog
# RUN global.log_all ...
# OK global.log_all
ok 13 global.log_all
# RUN global.unknown_ret_is_kill_inside ...
# OK global.unknown_ret_is_kill_inside
ok 14 global.unknown_ret_is_kill_inside
# RUN global.unknown_ret_is_kill_above_allow ...
# OK global.unknown_ret_is_kill_above_allow
ok 15 global.unknown_ret_is_kill_above_allow
# RUN global.KILL_all ...
# OK global.KILL_all
ok 16 global.KILL_all
# RUN global.KILL_one ...
# OK global.KILL_one
ok 17 global.KILL_one
# RUN global.KILL_one_arg_one ...
# OK global.KILL_one_arg_one
ok 18 global.KILL_one_arg_one
# RUN global.KILL_one_arg_six ...
# OK global.KILL_one_arg_six
ok 19 global.KILL_one_arg_six
# RUN global.KILL_thread ...
# OK global.KILL_thread
ok 20 global.KILL_thread
# RUN global.KILL_process ...
# OK global.KILL_process
ok 21 global.KILL_process
# RUN global.arg_out_of_range ...
# OK global.arg_out_of_range
ok 22 global.arg_out_of_range
# RUN global.ERRNO_valid ...
# OK global.ERRNO_valid
ok 23 global.ERRNO_valid
# RUN global.ERRNO_zero ...
# OK global.ERRNO_zero
ok 24 global.ERRNO_zero
# RUN global.ERRNO_capped ...
# OK global.ERRNO_capped
ok 25 global.ERRNO_capped
# RUN global.ERRNO_order ...
# OK global.ERRNO_order
ok 26 global.ERRNO_order
# RUN global.negative_ENOSYS ...
# OK global.negative_ENOSYS
ok 27 global.negative_ENOSYS
# RUN global.seccomp_syscall ...
# OK global.seccomp_syscall
ok 28 global.seccomp_syscall
# RUN global.seccomp_syscall_mode_lock ...
# OK global.seccomp_syscall_mode_lock
ok 29 global.seccomp_syscall_mode_lock
# RUN global.detect_seccomp_filter_flags ...
# OK global.detect_seccomp_filter_flags
ok 30 global.detect_seccomp_filter_flags
# RUN global.TSYNC_first ...
# OK global.TSYNC_first
ok 31 global.TSYNC_first
# RUN global.syscall_restart ...
# OK global.syscall_restart
ok 32 global.syscall_restart
# RUN global.filter_flag_log ...
# OK global.filter_flag_log
ok 33 global.filter_flag_log
# RUN global.get_action_avail ...
# OK global.get_action_avail
ok 34 global.get_action_avail
# RUN global.get_metadata ...
# OK global.get_metadata
ok 35 global.get_metadata
# RUN global.user_notification_basic ...
# OK global.user_notification_basic
ok 36 global.user_notification_basic
# RUN global.user_notification_with_tsync ...
# OK global.user_notification_with_tsync
ok 37 global.user_notification_with_tsync
# RUN global.user_notification_kill_in_middle ...
# OK global.user_notification_kill_in_middle
ok 38 global.user_notification_kill_in_middle
# RUN global.user_notification_signal ...
# OK global.user_notification_signal
ok 39 global.user_notification_signal
# RUN global.user_notification_closed_listener ...
# OK global.user_notification_closed_listener
ok 40 global.user_notification_closed_listener
# RUN global.user_notification_child_pid_ns ...
# OK global.user_notification_child_pid_ns
ok 41 global.user_notification_child_pid_ns
# RUN global.user_notification_sibling_pid_ns ...
# OK global.user_notification_sibling_pid_ns
ok 42 global.user_notification_sibling_pid_ns
# RUN global.user_notification_fault_recv ...
# OK global.user_notification_fault_recv
ok 43 global.user_notification_fault_recv
# RUN global.seccomp_get_notif_sizes ...
# OK global.seccomp_get_notif_sizes
ok 44 global.seccomp_get_notif_sizes
# RUN global.user_notification_continue ...
# OK global.user_notification_continue
ok 45 global.user_notification_continue
# RUN global.user_notification_filter_empty ...
TAP version 13
1..86
# Starting 86 tests from 7 test cases.
# RUN global.kcmp ...
# OK global.kcmp
ok 1 global.kcmp
# RUN global.mode_strict_support ...
# OK global.mode_strict_support
ok 2 global.mode_strict_support
# RUN global.mode_strict_cannot_call_prctl ...
# OK global.mode_strict_cannot_call_prctl
ok 3 global.mode_strict_cannot_call_prctl
# RUN global.no_new_privs_support ...
# OK global.no_new_privs_support
ok 4 global.no_new_privs_support
# RUN global.mode_filter_support ...
# OK global.mode_filter_support
ok 5 global.mode_filter_support
# RUN global.mode_filter_without_nnp ...
# OK global.mode_filter_without_nnp
ok 6 global.mode_filter_without_nnp
# RUN global.filter_size_limits ...
# OK global.filter_size_limits
ok 7 global.filter_size_limits
# RUN global.filter_chain_limits ...
# OK global.filter_chain_limits
ok 8 global.filter_chain_limits
# RUN global.mode_filter_cannot_move_to_strict ...
# OK global.mode_filter_cannot_move_to_strict
ok 9 global.mode_filter_cannot_move_to_strict
# RUN global.mode_filter_get_seccomp ...
# OK global.mode_filter_get_seccomp
ok 10 global.mode_filter_get_seccomp
# RUN global.ALLOW_all ...
# OK global.ALLOW_all
ok 11 global.ALLOW_all
# RUN global.empty_prog ...
# OK global.empty_prog
ok 12 global.empty_prog
# RUN global.log_all ...
# OK global.log_all
ok 13 global.log_all
# RUN global.unknown_ret_is_kill_inside ...
# OK global.unknown_ret_is_kill_inside
ok 14 global.unknown_ret_is_kill_inside
# RUN global.unknown_ret_is_kill_above_allow ...
# OK global.unknown_ret_is_kill_above_allow
ok 15 global.unknown_ret_is_kill_above_allow
# RUN global.KILL_all ...
# OK global.KILL_all
ok 16 global.KILL_all
# RUN global.KILL_one ...
# OK global.KILL_one
ok 17 global.KILL_one
# RUN global.KILL_one_arg_one ...
# OK global.KILL_one_arg_one
ok 18 global.KILL_one_arg_one
# RUN global.KILL_one_arg_six ...
# OK global.KILL_one_arg_six
ok 19 global.KILL_one_arg_six
# RUN global.KILL_thread ...
# OK global.KILL_thread
ok 20 global.KILL_thread
# RUN global.KILL_process ...
# OK global.KILL_process
ok 21 global.KILL_process
# RUN global.arg_out_of_range ...
# OK global.arg_out_of_range
ok 22 global.arg_out_of_range
# RUN global.ERRNO_valid ...
# OK global.ERRNO_valid
ok 23 global.ERRNO_valid
# RUN global.ERRNO_zero ...
# OK global.ERRNO_zero
ok 24 global.ERRNO_zero
# RUN global.ERRNO_capped ...
# OK global.ERRNO_capped
ok 25 global.ERRNO_capped
# RUN global.ERRNO_order ...
# OK global.ERRNO_order
ok 26 global.ERRNO_order
# RUN global.negative_ENOSYS ...
# OK global.negative_ENOSYS
ok 27 global.negative_ENOSYS
# RUN global.seccomp_syscall ...
# OK global.seccomp_syscall
ok 28 global.seccomp_syscall
# RUN global.seccomp_syscall_mode_lock ...
# OK global.seccomp_syscall_mode_lock
ok 29 global.seccomp_syscall_mode_lock
# RUN global.detect_seccomp_filter_flags ...
# OK global.detect_seccomp_filter_flags
ok 30 global.detect_seccomp_filter_flags
# RUN global.TSYNC_first ...
# OK global.TSYNC_first
ok 31 global.TSYNC_first
# RUN global.syscall_restart ...
# OK global.syscall_restart
ok 32 global.syscall_restart
# RUN global.filter_flag_log ...
# OK global.filter_flag_log
ok 33 global.filter_flag_log
# RUN global.get_action_avail ...
# OK global.get_action_avail
ok 34 global.get_action_avail
# RUN global.get_metadata ...
# OK global.get_metadata
ok 35 global.get_metadata
# RUN global.user_notification_basic ...
# OK global.user_notification_basic
ok 36 global.user_notification_basic
# RUN global.user_notification_with_tsync ...
# OK global.user_notification_with_tsync
ok 37 global.user_notification_with_tsync
# RUN global.user_notification_kill_in_middle ...
# OK global.user_notification_kill_in_middle
ok 38 global.user_notification_kill_in_middle
# RUN global.user_notification_signal ...
# OK global.user_notification_signal
ok 39 global.user_notification_signal
# RUN global.user_notification_closed_listener ...
# OK global.user_notification_closed_listener
ok 40 global.user_notification_closed_listener
# RUN global.user_notification_child_pid_ns ...
# OK global.user_notification_child_pid_ns
ok 41 global.user_notification_child_pid_ns
# RUN global.user_notification_sibling_pid_ns ...
# OK global.user_notification_sibling_pid_ns
ok 42 global.user_notification_sibling_pid_ns
# RUN global.user_notification_fault_recv ...
# OK global.user_notification_fault_recv
ok 43 global.user_notification_fault_recv
# RUN global.seccomp_get_notif_sizes ...
# OK global.seccomp_get_notif_sizes
ok 44 global.seccomp_get_notif_sizes
# RUN global.user_notification_continue ...
# OK global.user_notification_continue
ok 45 global.user_notification_continue
# RUN global.user_notification_filter_empty ...
# OK global.user_notification_filter_empty
ok 46 global.user_notification_filter_empty
# RUN global.user_notification_filter_empty_threaded ...
TAP version 13
1..86
# Starting 86 tests from 7 test cases.
# RUN global.kcmp ...
# OK global.kcmp
ok 1 global.kcmp
# RUN global.mode_strict_support ...
# OK global.mode_strict_support
ok 2 global.mode_strict_support
# RUN global.mode_strict_cannot_call_prctl ...
# OK global.mode_strict_cannot_call_prctl
ok 3 global.mode_strict_cannot_call_prctl
# RUN global.no_new_privs_support ...
# OK global.no_new_privs_support
ok 4 global.no_new_privs_support
# RUN global.mode_filter_support ...
# OK global.mode_filter_support
ok 5 global.mode_filter_support
# RUN global.mode_filter_without_nnp ...
# OK global.mode_filter_without_nnp
ok 6 global.mode_filter_without_nnp
# RUN global.filter_size_limits ...
# OK global.filter_size_limits
ok 7 global.filter_size_limits
# RUN global.filter_chain_limits ...
# OK global.filter_chain_limits
ok 8 global.filter_chain_limits
# RUN global.mode_filter_cannot_move_to_strict ...
# OK global.mode_filter_cannot_move_to_strict
ok 9 global.mode_filter_cannot_move_to_strict
# RUN global.mode_filter_get_seccomp ...
# OK global.mode_filter_get_seccomp
ok 10 global.mode_filter_get_seccomp
# RUN global.ALLOW_all ...
# OK global.ALLOW_all
ok 11 global.ALLOW_all
# RUN global.empty_prog ...
# OK global.empty_prog
ok 12 global.empty_prog
# RUN global.log_all ...
# OK global.log_all
ok 13 global.log_all
# RUN global.unknown_ret_is_kill_inside ...
# OK global.unknown_ret_is_kill_inside
ok 14 global.unknown_ret_is_kill_inside
# RUN global.unknown_ret_is_kill_above_allow ...
# OK global.unknown_ret_is_kill_above_allow
ok 15 global.unknown_ret_is_kill_above_allow
# RUN global.KILL_all ...
# OK global.KILL_all
ok 16 global.KILL_all
# RUN global.KILL_one ...
# OK global.KILL_one
ok 17 global.KILL_one
# RUN global.KILL_one_arg_one ...
# OK global.KILL_one_arg_one
ok 18 global.KILL_one_arg_one
# RUN global.KILL_one_arg_six ...
# OK global.KILL_one_arg_six
ok 19 global.KILL_one_arg_six
# RUN global.KILL_thread ...
# OK global.KILL_thread
ok 20 global.KILL_thread
# RUN global.KILL_process ...
# OK global.KILL_process
ok 21 global.KILL_process
# RUN global.arg_out_of_range ...
# OK global.arg_out_of_range
ok 22 global.arg_out_of_range
# RUN global.ERRNO_valid ...
# OK global.ERRNO_valid
ok 23 global.ERRNO_valid
# RUN global.ERRNO_zero ...
# OK global.ERRNO_zero
ok 24 global.ERRNO_zero
# RUN global.ERRNO_capped ...
# OK global.ERRNO_capped
ok 25 global.ERRNO_capped
# RUN global.ERRNO_order ...
# OK global.ERRNO_order
ok 26 global.ERRNO_order
# RUN global.negative_ENOSYS ...
# OK global.negative_ENOSYS
ok 27 global.negative_ENOSYS
# RUN global.seccomp_syscall ...
# OK global.seccomp_syscall
ok 28 global.seccomp_syscall
# RUN global.seccomp_syscall_mode_lock ...
# OK global.seccomp_syscall_mode_lock
ok 29 global.seccomp_syscall_mode_lock
# RUN global.detect_seccomp_filter_flags ...
# OK global.detect_seccomp_filter_flags
ok 30 global.detect_seccomp_filter_flags
# RUN global.TSYNC_first ...
# OK global.TSYNC_first
ok 31 global.TSYNC_first
# RUN global.syscall_restart ...
# OK global.syscall_restart
ok 32 global.syscall_restart
# RUN global.filter_flag_log ...
# OK global.filter_flag_log
ok 33 global.filter_flag_log
# RUN global.get_action_avail ...
# OK global.get_action_avail
ok 34 global.get_action_avail
# RUN global.get_metadata ...
# OK global.get_metadata
ok 35 global.get_metadata
# RUN global.user_notification_basic ...
# OK global.user_notification_basic
ok 36 global.user_notification_basic
# RUN global.user_notification_with_tsync ...
# OK global.user_notification_with_tsync
ok 37 global.user_notification_with_tsync
# RUN global.user_notification_kill_in_middle ...
# OK global.user_notification_kill_in_middle
ok 38 global.user_notification_kill_in_middle
# RUN global.user_notification_signal ...
# OK global.user_notification_signal
ok 39 global.user_notification_signal
# RUN global.user_notification_closed_listener ...
# OK global.user_notification_closed_listener
ok 40 global.user_notification_closed_listener
# RUN global.user_notification_child_pid_ns ...
# OK global.user_notification_child_pid_ns
ok 41 global.user_notification_child_pid_ns
# RUN global.user_notification_sibling_pid_ns ...
# OK global.user_notification_sibling_pid_ns
ok 42 global.user_notification_sibling_pid_ns
# RUN global.user_notification_fault_recv ...
# OK global.user_notification_fault_recv
ok 43 global.user_notification_fault_recv
# RUN global.seccomp_get_notif_sizes ...
# OK global.seccomp_get_notif_sizes
ok 44 global.seccomp_get_notif_sizes
# RUN global.user_notification_continue ...
# OK global.user_notification_continue
ok 45 global.user_notification_continue
# RUN global.user_notification_filter_empty ...
# OK global.user_notification_filter_empty
ok 46 global.user_notification_filter_empty
# RUN global.user_notification_filter_empty_threaded ...
# OK global.user_notification_filter_empty_threaded
ok 47 global.user_notification_filter_empty_threaded
# RUN global.user_notification_addfd ...
TAP version 13
1..86
# Starting 86 tests from 7 test cases.
# RUN global.kcmp ...
# OK global.kcmp
ok 1 global.kcmp
# RUN global.mode_strict_support ...
# OK global.mode_strict_support
ok 2 global.mode_strict_support
# RUN global.mode_strict_cannot_call_prctl ...
# OK global.mode_strict_cannot_call_prctl
ok 3 global.mode_strict_cannot_call_prctl
# RUN global.no_new_privs_support ...
# OK global.no_new_privs_support
ok 4 global.no_new_privs_support
# RUN global.mode_filter_support ...
# OK global.mode_filter_support
ok 5 global.mode_filter_support
# RUN global.mode_filter_without_nnp ...
# OK global.mode_filter_without_nnp
ok 6 global.mode_filter_without_nnp
# RUN global.filter_size_limits ...
# OK global.filter_size_limits
ok 7 global.filter_size_limits
# RUN global.filter_chain_limits ...
# OK global.filter_chain_limits
ok 8 global.filter_chain_limits
# RUN global.mode_filter_cannot_move_to_strict ...
# OK global.mode_filter_cannot_move_to_strict
ok 9 global.mode_filter_cannot_move_to_strict
# RUN global.mode_filter_get_seccomp ...
# OK global.mode_filter_get_seccomp
ok 10 global.mode_filter_get_seccomp
# RUN global.ALLOW_all ...
# OK global.ALLOW_all
ok 11 global.ALLOW_all
# RUN global.empty_prog ...
# OK global.empty_prog
ok 12 global.empty_prog
# RUN global.log_all ...
# OK global.log_all
ok 13 global.log_all
# RUN global.unknown_ret_is_kill_inside ...
# OK global.unknown_ret_is_kill_inside
ok 14 global.unknown_ret_is_kill_inside
# RUN global.unknown_ret_is_kill_above_allow ...
# OK global.unknown_ret_is_kill_above_allow
ok 15 global.unknown_ret_is_kill_above_allow
# RUN global.KILL_all ...
# OK global.KILL_all
ok 16 global.KILL_all
# RUN global.KILL_one ...
# OK global.KILL_one
ok 17 global.KILL_one
# RUN global.KILL_one_arg_one ...
# OK global.KILL_one_arg_one
ok 18 global.KILL_one_arg_one
# RUN global.KILL_one_arg_six ...
# OK global.KILL_one_arg_six
ok 19 global.KILL_one_arg_six
# RUN global.KILL_thread ...
# OK global.KILL_thread
ok 20 global.KILL_thread
# RUN global.KILL_process ...
# OK global.KILL_process
ok 21 global.KILL_process
# RUN global.arg_out_of_range ...
# OK global.arg_out_of_range
ok 22 global.arg_out_of_range
# RUN global.ERRNO_valid ...
# OK global.ERRNO_valid
ok 23 global.ERRNO_valid
# RUN global.ERRNO_zero ...
# OK global.ERRNO_zero
ok 24 global.ERRNO_zero
# RUN global.ERRNO_capped ...
# OK global.ERRNO_capped
ok 25 global.ERRNO_capped
# RUN global.ERRNO_order ...
# OK global.ERRNO_order
ok 26 global.ERRNO_order
# RUN global.negative_ENOSYS ...
# OK global.negative_ENOSYS
ok 27 global.negative_ENOSYS
# RUN global.seccomp_syscall ...
# OK global.seccomp_syscall
ok 28 global.seccomp_syscall
# RUN global.seccomp_syscall_mode_lock ...
# OK global.seccomp_syscall_mode_lock
ok 29 global.seccomp_syscall_mode_lock
# RUN global.detect_seccomp_filter_flags ...
# OK global.detect_seccomp_filter_flags
ok 30 global.detect_seccomp_filter_flags
# RUN global.TSYNC_first ...
# OK global.TSYNC_first
ok 31 global.TSYNC_first
# RUN global.syscall_restart ...
# OK global.syscall_restart
ok 32 global.syscall_restart
# RUN global.filter_flag_log ...
# OK global.filter_flag_log
ok 33 global.filter_flag_log
# RUN global.get_action_avail ...
# OK global.get_action_avail
ok 34 global.get_action_avail
# RUN global.get_metadata ...
# OK global.get_metadata
ok 35 global.get_metadata
# RUN global.user_notification_basic ...
# OK global.user_notification_basic
ok 36 global.user_notification_basic
# RUN global.user_notification_with_tsync ...
# OK global.user_notification_with_tsync
ok 37 global.user_notification_with_tsync
# RUN global.user_notification_kill_in_middle ...
# OK global.user_notification_kill_in_middle
ok 38 global.user_notification_kill_in_middle
# RUN global.user_notification_signal ...
# OK global.user_notification_signal
ok 39 global.user_notification_signal
# RUN global.user_notification_closed_listener ...
# OK global.user_notification_closed_listener
ok 40 global.user_notification_closed_listener
# RUN global.user_notification_child_pid_ns ...
# OK global.user_notification_child_pid_ns
ok 41 global.user_notification_child_pid_ns
# RUN global.user_notification_sibling_pid_ns ...
# OK global.user_notification_sibling_pid_ns
ok 42 global.user_notification_sibling_pid_ns
# RUN global.user_notification_fault_recv ...
# OK global.user_notification_fault_recv
ok 43 global.user_notification_fault_recv
# RUN global.seccomp_get_notif_sizes ...
# OK global.seccomp_get_notif_sizes
ok 44 global.seccomp_get_notif_sizes
# RUN global.user_notification_continue ...
# OK global.user_notification_continue
ok 45 global.user_notification_continue
# RUN global.user_notification_filter_empty ...
# OK global.user_notification_filter_empty
ok 46 global.user_notification_filter_empty
# RUN global.user_notification_filter_empty_threaded ...
# OK global.user_notification_filter_empty_threaded
ok 47 global.user_notification_filter_empty_threaded
# RUN global.user_notification_addfd ...
# OK global.user_notification_addfd
ok 48 global.user_notification_addfd
# RUN global.user_notification_addfd_rlimit ...
TAP version 13
1..86
# Starting 86 tests from 7 test cases.
# RUN global.kcmp ...
# OK global.kcmp
ok 1 global.kcmp
# RUN global.mode_strict_support ...
# OK global.mode_strict_support
ok 2 global.mode_strict_support
# RUN global.mode_strict_cannot_call_prctl ...
# OK global.mode_strict_cannot_call_prctl
ok 3 global.mode_strict_cannot_call_prctl
# RUN global.no_new_privs_support ...
# OK global.no_new_privs_support
ok 4 global.no_new_privs_support
# RUN global.mode_filter_support ...
# OK global.mode_filter_support
ok 5 global.mode_filter_support
# RUN global.mode_filter_without_nnp ...
# OK global.mode_filter_without_nnp
ok 6 global.mode_filter_without_nnp
# RUN global.filter_size_limits ...
# OK global.filter_size_limits
ok 7 global.filter_size_limits
# RUN global.filter_chain_limits ...
# OK global.filter_chain_limits
ok 8 global.filter_chain_limits
# RUN global.mode_filter_cannot_move_to_strict ...
# OK global.mode_filter_cannot_move_to_strict
ok 9 global.mode_filter_cannot_move_to_strict
# RUN global.mode_filter_get_seccomp ...
# OK global.mode_filter_get_seccomp
ok 10 global.mode_filter_get_seccomp
# RUN global.ALLOW_all ...
# OK global.ALLOW_all
ok 11 global.ALLOW_all
# RUN global.empty_prog ...
# OK global.empty_prog
ok 12 global.empty_prog
# RUN global.log_all ...
# OK global.log_all
ok 13 global.log_all
# RUN global.unknown_ret_is_kill_inside ...
# OK global.unknown_ret_is_kill_inside
ok 14 global.unknown_ret_is_kill_inside
# RUN global.unknown_ret_is_kill_above_allow ...
# OK global.unknown_ret_is_kill_above_allow
ok 15 global.unknown_ret_is_kill_above_allow
# RUN global.KILL_all ...
# OK global.KILL_all
ok 16 global.KILL_all
# RUN global.KILL_one ...
# OK global.KILL_one
ok 17 global.KILL_one
# RUN global.KILL_one_arg_one ...
# OK global.KILL_one_arg_one
ok 18 global.KILL_one_arg_one
# RUN global.KILL_one_arg_six ...
# OK global.KILL_one_arg_six
ok 19 global.KILL_one_arg_six
# RUN global.KILL_thread ...
# OK global.KILL_thread
ok 20 global.KILL_thread
# RUN global.KILL_process ...
# OK global.KILL_process
ok 21 global.KILL_process
# RUN global.arg_out_of_range ...
# OK global.arg_out_of_range
ok 22 global.arg_out_of_range
# RUN global.ERRNO_valid ...
# OK global.ERRNO_valid
ok 23 global.ERRNO_valid
# RUN global.ERRNO_zero ...
# OK global.ERRNO_zero
ok 24 global.ERRNO_zero
# RUN global.ERRNO_capped ...
# OK global.ERRNO_capped
ok 25 global.ERRNO_capped
# RUN global.ERRNO_order ...
# OK global.ERRNO_order
ok 26 global.ERRNO_order
# RUN global.negative_ENOSYS ...
# OK global.negative_ENOSYS
ok 27 global.negative_ENOSYS
# RUN global.seccomp_syscall ...
# OK global.seccomp_syscall
ok 28 global.seccomp_syscall
# RUN global.seccomp_syscall_mode_lock ...
# OK global.seccomp_syscall_mode_lock
ok 29 global.seccomp_syscall_mode_lock
# RUN global.detect_seccomp_filter_flags ...
# OK global.detect_seccomp_filter_flags
ok 30 global.detect_seccomp_filter_flags
# RUN global.TSYNC_first ...
# OK global.TSYNC_first
ok 31 global.TSYNC_first
# RUN global.syscall_restart ...
# OK global.syscall_restart
ok 32 global.syscall_restart
# RUN global.filter_flag_log ...
# OK global.filter_flag_log
ok 33 global.filter_flag_log
# RUN global.get_action_avail ...
# OK global.get_action_avail
ok 34 global.get_action_avail
# RUN global.get_metadata ...
# OK global.get_metadata
ok 35 global.get_metadata
# RUN global.user_notification_basic ...
# OK global.user_notification_basic
ok 36 global.user_notification_basic
# RUN global.user_notification_with_tsync ...
# OK global.user_notification_with_tsync
ok 37 global.user_notification_with_tsync
# RUN global.user_notification_kill_in_middle ...
# OK global.user_notification_kill_in_middle
ok 38 global.user_notification_kill_in_middle
# RUN global.user_notification_signal ...
# OK global.user_notification_signal
ok 39 global.user_notification_signal
# RUN global.user_notification_closed_listener ...
# OK global.user_notification_closed_listener
ok 40 global.user_notification_closed_listener
# RUN global.user_notification_child_pid_ns ...
# OK global.user_notification_child_pid_ns
ok 41 global.user_notification_child_pid_ns
# RUN global.user_notification_sibling_pid_ns ...
# OK global.user_notification_sibling_pid_ns
ok 42 global.user_notification_sibling_pid_ns
# RUN global.user_notification_fault_recv ...
# OK global.user_notification_fault_recv
ok 43 global.user_notification_fault_recv
# RUN global.seccomp_get_notif_sizes ...
# OK global.seccomp_get_notif_sizes
ok 44 global.seccomp_get_notif_sizes
# RUN global.user_notification_continue ...
# OK global.user_notification_continue
ok 45 global.user_notification_continue
# RUN global.user_notification_filter_empty ...
# OK global.user_notification_filter_empty
ok 46 global.user_notification_filter_empty
# RUN global.user_notification_filter_empty_threaded ...
# OK global.user_notification_filter_empty_threaded
ok 47 global.user_notification_filter_empty_threaded
# RUN global.user_notification_addfd ...
# OK global.user_notification_addfd
ok 48 global.user_notification_addfd
# RUN global.user_notification_addfd_rlimit ...
# OK global.user_notification_addfd_rlimit
ok 49 global.user_notification_addfd_rlimit
# RUN TRAP.dfl ...
# OK TRAP.dfl
ok 50 TRAP.dfl
# RUN TRAP.ign ...
# OK TRAP.ign
ok 51 TRAP.ign
# RUN TRAP.handler ...
# OK TRAP.handler
ok 52 TRAP.handler
# RUN precedence.allow_ok ...
# OK precedence.allow_ok
ok 53 precedence.allow_ok
# RUN precedence.kill_is_highest ...
# OK precedence.kill_is_highest
ok 54 precedence.kill_is_highest
# RUN precedence.kill_is_highest_in_any_order ...
# OK precedence.kill_is_highest_in_any_order
ok 55 precedence.kill_is_highest_in_any_order
# RUN precedence.trap_is_second ...
# OK precedence.trap_is_second
ok 56 precedence.trap_is_second
# RUN precedence.trap_is_second_in_any_order ...
# OK precedence.trap_is_second_in_any_order
ok 57 precedence.trap_is_second_in_any_order
# RUN precedence.errno_is_third ...
# OK precedence.errno_is_third
ok 58 precedence.errno_is_third
# RUN precedence.errno_is_third_in_any_order ...
# OK precedence.errno_is_third_in_any_order
ok 59 precedence.errno_is_third_in_any_order
# RUN precedence.trace_is_fourth ...
# OK precedence.trace_is_fourth
ok 60 precedence.trace_is_fourth
# RUN precedence.trace_is_fourth_in_any_order ...
# OK precedence.trace_is_fourth_in_any_order
ok 61 precedence.trace_is_fourth_in_any_order
# RUN precedence.log_is_fifth ...
# OK precedence.log_is_fifth
ok 62 precedence.log_is_fifth
# RUN precedence.log_is_fifth_in_any_order ...
# OK precedence.log_is_fifth_in_any_order
ok 63 precedence.log_is_fifth_in_any_order
# RUN TRACE_poke.read_has_side_effects ...
# OK TRACE_poke.read_has_side_effects
ok 64 TRACE_poke.read_has_side_effects
# RUN TRACE_poke.getpid_runs_normally ...
# OK TRACE_poke.getpid_runs_normally
ok 65 TRACE_poke.getpid_runs_normally
# RUN TRACE_syscall.ptrace.negative_ENOSYS ...
# OK TRACE_syscall.ptrace.negative_ENOSYS
ok 66 TRACE_syscall.ptrace.negative_ENOSYS
# RUN TRACE_syscall.ptrace.syscall_allowed ...
# OK TRACE_syscall.ptrace.syscall_allowed
ok 67 TRACE_syscall.ptrace.syscall_allowed
# RUN TRACE_syscall.ptrace.syscall_redirected ...
# OK TRACE_syscall.ptrace.syscall_redirected
ok 68 TRACE_syscall.ptrace.syscall_redirected
# RUN TRACE_syscall.ptrace.syscall_errno ...
# OK TRACE_syscall.ptrace.syscall_errno
ok 69 TRACE_syscall.ptrace.syscall_errno
# RUN TRACE_syscall.ptrace.syscall_faked ...
# OK TRACE_syscall.ptrace.syscall_faked
ok 70 TRACE_syscall.ptrace.syscall_faked
# RUN TRACE_syscall.ptrace.skip_after ...
# OK TRACE_syscall.ptrace.skip_after
ok 71 TRACE_syscall.ptrace.skip_after
# RUN TRACE_syscall.ptrace.kill_after ...
# OK TRACE_syscall.ptrace.kill_after
ok 72 TRACE_syscall.ptrace.kill_after
# RUN TRACE_syscall.seccomp.negative_ENOSYS ...
# OK TRACE_syscall.seccomp.negative_ENOSYS
ok 73 TRACE_syscall.seccomp.negative_ENOSYS
# RUN TRACE_syscall.seccomp.syscall_allowed ...
# OK TRACE_syscall.seccomp.syscall_allowed
ok 74 TRACE_syscall.seccomp.syscall_allowed
# RUN TRACE_syscall.seccomp.syscall_redirected ...
# OK TRACE_syscall.seccomp.syscall_redirected
ok 75 TRACE_syscall.seccomp.syscall_redirected
# RUN TRACE_syscall.seccomp.syscall_errno ...
# OK TRACE_syscall.seccomp.syscall_errno
ok 76 TRACE_syscall.seccomp.syscall_errno
# RUN TRACE_syscall.seccomp.syscall_faked ...
# OK TRACE_syscall.seccomp.syscall_faked
ok 77 TRACE_syscall.seccomp.syscall_faked
# RUN TRACE_syscall.seccomp.skip_after ...
# OK TRACE_syscall.seccomp.skip_after
ok 78 TRACE_syscall.seccomp.skip_after
# RUN TRACE_syscall.seccomp.kill_after ...
# OK TRACE_syscall.seccomp.kill_after
ok 79 TRACE_syscall.seccomp.kill_after
# RUN TSYNC.siblings_fail_prctl ...
# OK TSYNC.siblings_fail_prctl
ok 80 TSYNC.siblings_fail_prctl
# RUN TSYNC.two_siblings_with_ancestor ...
# OK TSYNC.two_siblings_with_ancestor
ok 81 TSYNC.two_siblings_with_ancestor
# RUN TSYNC.two_sibling_want_nnp ...
# OK TSYNC.two_sibling_want_nnp
ok 82 TSYNC.two_sibling_want_nnp
# RUN TSYNC.two_siblings_with_no_filter ...
# OK TSYNC.two_siblings_with_no_filter
ok 83 TSYNC.two_siblings_with_no_filter
# RUN TSYNC.two_siblings_with_one_divergence ...
# OK TSYNC.two_siblings_with_one_divergence
ok 84 TSYNC.two_siblings_with_one_divergence
# RUN TSYNC.two_siblings_with_one_divergence_no_tid_in_err ...
# OK TSYNC.two_siblings_with_one_divergence_no_tid_in_err
ok 85 TSYNC.two_siblings_with_one_divergence_no_tid_in_err
# RUN TSYNC.two_siblings_not_under_filter ...
# OK TSYNC.two_siblings_not_under_filter
ok 86 TSYNC.two_siblings_not_under_filter
# PASSED: 86 / 86 tests passed.
# Totals: pass:86 fail:0 xfail:0 xpass:0 skip:0 error:0
^ permalink raw reply
* Re: [PATCH] powerpc/traps: fix recoverability of machine check handling on book3s/32
From: Michal Suchánek @ 2020-09-14 12:46 UTC (permalink / raw)
To: Michael Ellerman
Cc: Christophe Leroy, linux-kernel, Nicholas Piggin, Paul Mackerras,
linuxppc-dev
In-Reply-To: <87pn6sqweq.fsf@mpe.ellerman.id.au>
On Fri, Sep 11, 2020 at 11:23:57PM +1000, Michael Ellerman wrote:
> Michal Suchánek <msuchanek@suse.de> writes:
> > Hello,
> >
> > does this logic apply to "Unrecoverable System Reset" as well?
>
> Which logic do you mean?
>
> We do call die() before checking MSR_RI in system_reset_exception():
>
> /*
> * No debugger or crash dump registered, print logs then
> * panic.
> */
> die("System Reset", regs, SIGABRT);
>
> mdelay(2*MSEC_PER_SEC); /* Wait a little while for others to print */
> add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
> nmi_panic(regs, "System Reset");
>
> out:
> #ifdef CONFIG_PPC_BOOK3S_64
> BUG_ON(get_paca()->in_nmi == 0);
> if (get_paca()->in_nmi > 1)
> die("Unrecoverable nested System Reset", regs, SIGABRT);
> #endif
> /* Must die if the interrupt is not recoverable */
> if (!(regs->msr & MSR_RI))
> die("Unrecoverable System Reset", regs, SIGABRT);
>
>
> So you should see the output from die("System Reset", ...) even if
> MSR[RI] was clear when you took the system reset.
Indeed, replied to the wrong patch. I was looking at daf00ae71dad
("powerpc/traps: restore recoverability of machine_check interrupts")
which has very similar commit message.
Sorry about the confusion.
Thanks
Michal
>
> cheers
>
> > On Tue, Jan 22, 2019 at 02:11:24PM +0000, Christophe Leroy wrote:
> >> Looks like book3s/32 doesn't set RI on machine check, so
> >> checking RI before calling die() will always be fatal
> >> allthought this is not an issue in most cases.
> >>
> >> Fixes: b96672dd840f ("powerpc: Machine check interrupt is a non-maskable interrupt")
> >> Fixes: daf00ae71dad ("powerpc/traps: restore recoverability of machine_check interrupts")
> >> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> >> Cc: stable@vger.kernel.org
> >> ---
> >> arch/powerpc/kernel/traps.c | 8 ++++----
> >> 1 file changed, 4 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
> >> index 64936b60d521..c740f8bfccc9 100644
> >> --- a/arch/powerpc/kernel/traps.c
> >> +++ b/arch/powerpc/kernel/traps.c
> >> @@ -763,15 +763,15 @@ void machine_check_exception(struct pt_regs *regs)
> >> if (check_io_access(regs))
> >> goto bail;
> >>
> >> - /* Must die if the interrupt is not recoverable */
> >> - if (!(regs->msr & MSR_RI))
> >> - nmi_panic(regs, "Unrecoverable Machine check");
> >> -
> >> if (!nested)
> >> nmi_exit();
> >>
> >> die("Machine check", regs, SIGBUS);
> >>
> >> + /* Must die if the interrupt is not recoverable */
> >> + if (!(regs->msr & MSR_RI))
> >> + nmi_panic(regs, "Unrecoverable Machine check");
> >> +
> >> return;
> >>
> >> bail:
> >> --
> >> 2.13.3
> >>
^ permalink raw reply
* Re: [PATCH v2 3/4] sparc64: remove mm_cpumask clearing to fix kthread_use_mm race
From: Anatoly Pugachev @ 2020-09-14 10:23 UTC (permalink / raw)
To: Nicholas Piggin
Cc: Jens Axboe, linux-arch, Peter Zijlstra, Aneesh Kumar K . V,
Linux Kernel list, linux-mm, Sparc kernel list, Andrew Morton,
linuxppc-dev, David S . Miller
In-Reply-To: <1600066040.vnmz9nxhwt.astroid@bobo.none>
On Mon, Sep 14, 2020 at 10:00 AM Nicholas Piggin <npiggin@gmail.com> wrote:
>
> Excerpts from Nicholas Piggin's message of September 14, 2020 2:52 pm:
>
> [...]
>
> > The basic fix for sparc64 is to remove its mm_cpumask clearing code. The
> > optimisation could be effectively restored by sending IPIs to mm_cpumask
> > members and having them remove themselves from mm_cpumask. This is more
> > tricky so I leave it as an exercise for someone with a sparc64 SMP.
> > powerpc has a (currently similarly broken) example.
>
> So this compiles and boots on qemu, but qemu does not support any
> sparc64 machines with SMP. Attempting some simple hacks doesn't get
> me far because openbios isn't populating an SMP device tree, which
> blows up everywhere.
>
> The patch is _relatively_ simple, hopefully it shouldn't explode, so
> it's probably ready for testing on real SMP hardware, if someone has
> a few cycles.
Nick,
applied this patch to over 'v5.9-rc5' tag , used my test VM (ldom)
with 32 vcpus.
Machine boot, stress-ng test ( run as
"stress-ng --cpu 8 --io 8 --vm 8 --vm-bytes 2G --fork 8 --timeout 15m" )
finishes without errors.
^ permalink raw reply
* [PATCH -next] drivers/macintosh/smu.c: Fix undeclared symbol warning
From: Wang Wensheng @ 2020-09-14 12:26 UTC (permalink / raw)
To: benh, gustavoars, linuxppc-dev, linux-kernel
Make kernel with `C=2`:
drivers/macintosh/smu.c:1018:30: warning: symbol
'__smu_get_sdb_partition' was not declared. Should it be static?
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wang Wensheng <wangwensheng4@huawei.com>
---
drivers/macintosh/smu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c
index 96684581a25d..bae94caaad5c 100644
--- a/drivers/macintosh/smu.c
+++ b/drivers/macintosh/smu.c
@@ -1015,7 +1015,7 @@ static struct smu_sdbp_header *smu_create_sdb_partition(int id)
/* Note: Only allowed to return error code in pointers (using ERR_PTR)
* when interruptible is 1
*/
-const struct smu_sdbp_header *__smu_get_sdb_partition(int id,
+static const struct smu_sdbp_header *__smu_get_sdb_partition(int id,
unsigned int *size, int interruptible)
{
char pname[32];
--
2.25.0
^ permalink raw reply related
* Re: [PATCH v2] powerpc/papr_scm: Fix warning triggered by perf_stats_show()
From: Ira Weiny @ 2020-09-14 16:56 UTC (permalink / raw)
To: Vaibhav Jain
Cc: Santosh Sivaraj, linux-nvdimm, Aneesh Kumar K . V,
Oliver O'Halloran, Dan Williams, linuxppc-dev
In-Reply-To: <20200912081451.66225-1-vaibhav@linux.ibm.com>
On Sat, Sep 12, 2020 at 01:44:51PM +0530, Vaibhav Jain wrote:
> A warning is reported by the kernel in case perf_stats_show() returns
> an error code. The warning is of the form below:
>
> papr_scm ibm,persistent-memory:ibm,pmemory@44100001:
> Failed to query performance stats, Err:-10
> dev_attr_show: perf_stats_show+0x0/0x1c0 [papr_scm] returned bad count
> fill_read_buffer: dev_attr_show+0x0/0xb0 returned bad count
>
> On investigation it looks like that the compiler is silently truncating the
> return value of drc_pmem_query_stats() from 'long' to 'int', since the
> variable used to store the return code 'rc' is an 'int'. This
> truncated value is then returned back as a 'ssize_t' back from
> perf_stats_show() to 'dev_attr_show()' which thinks of it as a large
> unsigned number and triggers this warning..
>
> To fix this we update the type of variable 'rc' from 'int' to
> 'ssize_t' that prevents the compiler from truncating the return value
> of drc_pmem_query_stats() and returning correct signed value back from
> perf_stats_show().
>
> Fixes: 2d02bf835e573 ('powerpc/papr_scm: Fetch nvdimm performance
> stats from PHYP')
> Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
> ---
> Changelog:
>
> v2: Added an explicit cast to the expression calling 'seq_buf_used()'
> and triggering this issue. [ Ira ]
> ---
> arch/powerpc/platforms/pseries/papr_scm.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/platforms/pseries/papr_scm.c b/arch/powerpc/platforms/pseries/papr_scm.c
> index a88a707a608aa..5493bc847bd08 100644
> --- a/arch/powerpc/platforms/pseries/papr_scm.c
> +++ b/arch/powerpc/platforms/pseries/papr_scm.c
> @@ -785,7 +785,8 @@ static int papr_scm_ndctl(struct nvdimm_bus_descriptor *nd_desc,
> static ssize_t perf_stats_show(struct device *dev,
> struct device_attribute *attr, char *buf)
> {
> - int index, rc;
> + int index;
> + ssize_t rc;
> struct seq_buf s;
> struct papr_scm_perf_stat *stat;
> struct papr_scm_perf_stats *stats;
> @@ -820,7 +821,7 @@ static ssize_t perf_stats_show(struct device *dev,
>
> free_stats:
> kfree(stats);
> - return rc ? rc : seq_buf_used(&s);
> + return rc ? rc : (ssize_t)seq_buf_used(&s);
> }
> DEVICE_ATTR_ADMIN_RO(perf_stats);
>
> --
> 2.26.2
>
^ permalink raw reply
* Re: [PATCH v2 3/4] sparc64: remove mm_cpumask clearing to fix kthread_use_mm race
From: David Miller @ 2020-09-14 19:59 UTC (permalink / raw)
To: npiggin
Cc: linux-arch, axboe, peterz, aneesh.kumar, linux-kernel, linux-mm,
sparclinux, akpm, linuxppc-dev
In-Reply-To: <20200914045219.3736466-4-npiggin@gmail.com>
From: Nicholas Piggin <npiggin@gmail.com>
Date: Mon, 14 Sep 2020 14:52:18 +1000
...
> The basic fix for sparc64 is to remove its mm_cpumask clearing code. The
> optimisation could be effectively restored by sending IPIs to mm_cpumask
> members and having them remove themselves from mm_cpumask. This is more
> tricky so I leave it as an exercise for someone with a sparc64 SMP.
> powerpc has a (currently similarly broken) example.
>
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Sad to see this optimization go away, but what can I do:
Acked-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply
* Re: [PATCH 13/15] selftests/seccomp: powerpc: Set syscall return during ptrace syscall exit
From: Kees Cook @ 2020-09-14 20:20 UTC (permalink / raw)
To: Michael Ellerman
Cc: Thadeu Lima de Souza Cascardo, Will Drewry, linux-xtensa,
linux-kernel, Andy Lutomirski, Max Filippov, linux-arm-kernel,
linux-kselftest, linux-mips, linuxppc-dev, Christian Brauner
In-Reply-To: <87zh5sq59a.fsf@mpe.ellerman.id.au>
On Mon, Sep 14, 2020 at 03:47:13PM +1000, Michael Ellerman wrote:
> Kees Cook <keescook@chromium.org> writes:
> > Some archs (like ppc) only support changing the return code during
> > syscall exit when ptrace is used. As the syscall number might not
> > be available anymore during syscall exit, it needs to be saved
> > during syscall enter. Adjust the ptrace tests to do this.
>
> I'm not that across all the fixture stuff, but if I'm reading it right
> you're now calling change_syscall() on both entry and exit for all
> arches.
Correct.
> That should work, but it no longer tests changing the return code on
> entry on the arches that support it, which seems like a backward step?
That's a good point. I wouldn't be in a position to notice a regression
for the other architectures. I will refactor this one...
--
Kees Cook
^ permalink raw reply
* Re: [PATCH 00/15] selftests/seccomp: Refactor change_syscall()
From: Kees Cook @ 2020-09-14 20:32 UTC (permalink / raw)
To: Michael Ellerman
Cc: Thadeu Lima de Souza Cascardo, Will Drewry, linux-xtensa,
linux-kernel, Andy Lutomirski, Max Filippov, linux-arm-kernel,
linux-kselftest, linux-mips, linuxppc-dev, Christian Brauner
In-Reply-To: <87wo0wpnah.fsf@mpe.ellerman.id.au>
On Mon, Sep 14, 2020 at 10:15:18PM +1000, Michael Ellerman wrote:
> Kees Cook <keescook@chromium.org> writes:
> > Hi,
> >
> > This refactors the seccomp selftest macros used in change_syscall(),
> > in an effort to remove special cases for mips, arm, arm64, and xtensa,
> > which paves the way for powerpc fixes.
> >
> > I'm not entirely done testing, but all-arch build tests and x86_64
> > selftests pass. I'll be doing arm, arm64, and i386 selftests shortly,
> > but I currently don't have an easy way to check xtensa, mips, nor
> > powerpc. Any help there would be appreciated!
>
> The series builds fine for me, and all the tests pass (see below).
>
> Thanks for picking up those changes to deal with powerpc being oddball.
>
> Tested-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
Awesome; thanks!
However...
>
> cheers
>
>
> ./seccomp_bpf
> TAP version 13
> 1..86
> # Starting 86 tests from 7 test cases.
> # RUN global.kcmp ...
> # OK global.kcmp
> ok 1 global.kcmp
> [...]
> # RUN global.KILL_thread ...
> TAP version 13
> 1..86
> # Starting 86 tests from 7 test cases.
Was this a mis-paste, or has something very very bad happened here in
global.KILL_one_arg_six finishes?
> # RUN global.kcmp ...
> # OK global.kcmp
> ok 1 global.kcmp
> [...]
> # RUN global.user_notification_basic ...
> TAP version 13
> 1..86
> # Starting 86 tests from 7 test cases.
> [...]
> # RUN global.user_notification_basic ...
> TAP version 13
> 1..86
> # Starting 86 tests from 7 test cases.
> [...]
> # RUN global.user_notification_signal ...
> TAP version 13
> 1..86
> # Starting 86 tests from 7 test cases.
> [...]
> # RUN global.user_notification_closed_listener ...
> TAP version 13
> 1..86
> # Starting 86 tests from 7 test cases.
> [...]
> # RUN global.user_notification_child_pid_ns ...
> TAP version 13
> 1..86
> # Starting 86 tests from 7 test cases.
> [...]
> # RUN global.user_notification_sibling_pid_ns ...
> TAP version 13
> 1..86
> # Starting 86 tests from 7 test cases.
> [...]
> # RUN global.user_notification_sibling_pid_ns ...
> TAP version 13
> 1..86
> # Starting 86 tests from 7 test cases.
> [...]
> # RUN global.user_notification_sibling_pid_ns ...
> TAP version 13
> 1..86
> # Starting 86 tests from 7 test cases.
> [...]
> # RUN global.user_notification_fault_recv ...
> TAP version 13
> 1..86
> # Starting 86 tests from 7 test cases.
> [...]
> # RUN global.user_notification_continue ...
> TAP version 13
> 1..86
> # Starting 86 tests from 7 test cases.
> [...]
> # RUN global.user_notification_filter_empty ...
> TAP version 13
> 1..86
> # Starting 86 tests from 7 test cases.
> [...]
> # RUN global.user_notification_filter_empty_threaded ...
> TAP version 13
> 1..86
> # Starting 86 tests from 7 test cases.
> [...]
> # RUN global.user_notification_addfd ...
> TAP version 13
> 1..86
> # Starting 86 tests from 7 test cases.
> [...]
> # RUN global.user_notification_addfd_rlimit ...
> TAP version 13
> 1..86
> # Starting 86 tests from 7 test cases.
> [...]
> # PASSED: 86 / 86 tests passed.
> # Totals: pass:86 fail:0 xfail:0 xpass:0 skip:0 error:0
And after every user_notification test? O_O
--
Kees Cook
^ permalink raw reply
* [PATCH v2 4/7] powerpc/xive: Make debug routines static
From: Cédric Le Goater @ 2020-09-14 21:10 UTC (permalink / raw)
To: Michael Ellerman; +Cc: Christophe Leroy, linuxppc-dev, Cédric Le Goater
In-Reply-To: <20200914211007.2285999-1-clg@kaod.org>
This fixes a compile error with W=1.
CC arch/powerpc/sysdev/xive/common.o
../arch/powerpc/sysdev/xive/common.c:1568:6: error: no previous prototype for ‘xive_debug_show_cpu’ [-Werror=missing-prototypes]
void xive_debug_show_cpu(struct seq_file *m, int cpu)
^~~~~~~~~~~~~~~~~~~
../arch/powerpc/sysdev/xive/common.c:1602:6: error: no previous prototype for ‘xive_debug_show_irq’ [-Werror=missing-prototypes]
void xive_debug_show_irq(struct seq_file *m, u32 hw_irq, struct irq_data *d)
^~~~~~~~~~~~~~~~~~~
Fixes: 930914b7d528 ("powerpc/xive: Add a debugfs file to dump internal XIVE state")
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
arch/powerpc/sysdev/xive/common.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/common.c
index f591be9f01f4..a80440af491a 100644
--- a/arch/powerpc/sysdev/xive/common.c
+++ b/arch/powerpc/sysdev/xive/common.c
@@ -1565,7 +1565,7 @@ static int __init xive_off(char *arg)
}
__setup("xive=off", xive_off);
-void xive_debug_show_cpu(struct seq_file *m, int cpu)
+static void xive_debug_show_cpu(struct seq_file *m, int cpu)
{
struct xive_cpu *xc = per_cpu(xive_cpu, cpu);
@@ -1599,7 +1599,7 @@ void xive_debug_show_cpu(struct seq_file *m, int cpu)
seq_puts(m, "\n");
}
-void xive_debug_show_irq(struct seq_file *m, u32 hw_irq, struct irq_data *d)
+static void xive_debug_show_irq(struct seq_file *m, u32 hw_irq, struct irq_data *d)
{
struct irq_chip *chip = irq_data_get_irq_chip(d);
int rc;
--
2.25.4
^ permalink raw reply related
* [PATCH v2 0/7] powerpc: Fix a few W=1 compile warnings
From: Cédric Le Goater @ 2020-09-14 21:10 UTC (permalink / raw)
To: Michael Ellerman; +Cc: Christophe Leroy, linuxppc-dev, Cédric Le Goater
Hello,
Here is a small contribution improving compile with W=1.
Thanks,
C.
Changes in v2:
- Better commit logs
- Reworked early_reserve_mem() in prom
- Remove if statement in sstep
Cédric Le Goater (7):
powerpc/sysfs: Remove unused 'err' variable in
sysfs_create_dscr_default()
powerpc/prom: Introduce early_reserve_mem_old()
powerpc/sstep: Remove empty if statement checking for invalid form
powerpc/xive: Make debug routines static
powerpc/powernv/pci: Remove unused variable 'parent' in
pnv_ioda_configure_pe()
powerpc/perf: Remove unused variable 'target' in
trace_imc_event_init()
powerpc/32: Declare stack_overflow_exception() prototype
arch/powerpc/include/asm/asm-prototypes.h | 1 +
arch/powerpc/kernel/prom.c | 37 ++++++++++++-----------
arch/powerpc/kernel/sysfs.c | 3 +-
arch/powerpc/lib/sstep.c | 9 ++++--
arch/powerpc/perf/imc-pmu.c | 3 --
arch/powerpc/platforms/powernv/pci-ioda.c | 8 -----
arch/powerpc/sysdev/xive/common.c | 4 +--
7 files changed, 30 insertions(+), 35 deletions(-)
--
2.25.4
^ permalink raw reply
* [PATCH v2 2/7] powerpc/prom: Introduce early_reserve_mem_old()
From: Cédric Le Goater @ 2020-09-14 21:10 UTC (permalink / raw)
To: Michael Ellerman; +Cc: Christophe Leroy, linuxppc-dev, Cédric Le Goater
In-Reply-To: <20200914211007.2285999-1-clg@kaod.org>
and condition its call with IS_ENABLED(CONFIG_PPC32). This fixes a
compile error with W=1.
arch/powerpc/kernel/prom.c: In function ‘early_reserve_mem’:
arch/powerpc/kernel/prom.c:625:10: error: variable ‘reserve_map’ set but not used [-Werror=unused-but-set-variable]
__be64 *reserve_map;
^~~~~~~~~~~
cc1: all warnings being treated as errors
Cc: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
arch/powerpc/kernel/prom.c | 37 ++++++++++++++++++++-----------------
1 file changed, 20 insertions(+), 17 deletions(-)
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index d8a2fb87ba0c..c958b67cf1a5 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -620,27 +620,14 @@ static void __init early_reserve_mem_dt(void)
}
}
-static void __init early_reserve_mem(void)
+static void __init early_reserve_mem_old(void)
{
__be64 *reserve_map;
reserve_map = (__be64 *)(((unsigned long)initial_boot_params) +
fdt_off_mem_rsvmap(initial_boot_params));
- /* Look for the new "reserved-regions" property in the DT */
- early_reserve_mem_dt();
-
-#ifdef CONFIG_BLK_DEV_INITRD
- /* Then reserve the initrd, if any */
- if (initrd_start && (initrd_end > initrd_start)) {
- memblock_reserve(ALIGN_DOWN(__pa(initrd_start), PAGE_SIZE),
- ALIGN(initrd_end, PAGE_SIZE) -
- ALIGN_DOWN(initrd_start, PAGE_SIZE));
- }
-#endif /* CONFIG_BLK_DEV_INITRD */
-
-#ifdef CONFIG_PPC32
- /*
+ /*
* Handle the case where we might be booting from an old kexec
* image that setup the mem_rsvmap as pairs of 32-bit values
*/
@@ -658,9 +645,25 @@ static void __init early_reserve_mem(void)
DBG("reserving: %x -> %x\n", base_32, size_32);
memblock_reserve(base_32, size_32);
}
- return;
}
-#endif
+}
+
+static void __init early_reserve_mem(void)
+{
+ /* Look for the new "reserved-regions" property in the DT */
+ early_reserve_mem_dt();
+
+#ifdef CONFIG_BLK_DEV_INITRD
+ /* Then reserve the initrd, if any */
+ if (initrd_start && (initrd_end > initrd_start)) {
+ memblock_reserve(ALIGN_DOWN(__pa(initrd_start), PAGE_SIZE),
+ ALIGN(initrd_end, PAGE_SIZE) -
+ ALIGN_DOWN(initrd_start, PAGE_SIZE));
+ }
+#endif /* CONFIG_BLK_DEV_INITRD */
+
+ if (IS_ENABLED(CONFIG_PPC32))
+ early_reserve_mem_old();
}
#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
--
2.25.4
^ permalink raw reply related
* [PATCH v2 3/7] powerpc/sstep: Remove empty if statement checking for invalid form
From: Cédric Le Goater @ 2020-09-14 21:10 UTC (permalink / raw)
To: Michael Ellerman
Cc: Christophe Leroy, Jordan Niethe, linuxppc-dev,
Cédric Le Goater
In-Reply-To: <20200914211007.2285999-1-clg@kaod.org>
The check should be performed by the caller. This fixes a compile
error with W=1.
../arch/powerpc/lib/sstep.c: In function ‘mlsd_8lsd_ea’:
../arch/powerpc/lib/sstep.c:225:3: error: suggest braces around empty body in an ‘if’ statement [-Werror=empty-body]
; /* Invalid form. Should already be checked for by caller! */
^
Cc: Jordan Niethe <jniethe5@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
arch/powerpc/lib/sstep.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
index caee8cc77e19..e9dcaba9a4f8 100644
--- a/arch/powerpc/lib/sstep.c
+++ b/arch/powerpc/lib/sstep.c
@@ -219,10 +219,13 @@ static nokprobe_inline unsigned long mlsd_8lsd_ea(unsigned int instr,
ea += regs->gpr[ra];
else if (!prefix_r && !ra)
; /* Leave ea as is */
- else if (prefix_r && !ra)
+ else if (prefix_r)
ea += regs->nip;
- else if (prefix_r && ra)
- ; /* Invalid form. Should already be checked for by caller! */
+
+ /*
+ * (prefix_r && ra) is an invalid form. Should already be
+ * checked for by caller!
+ */
return ea;
}
--
2.25.4
^ permalink raw reply related
* [PATCH v2 5/7] powerpc/powernv/pci: Remove unused variable 'parent' in pnv_ioda_configure_pe()
From: Cédric Le Goater @ 2020-09-14 21:10 UTC (permalink / raw)
To: Michael Ellerman
Cc: Christophe Leroy, Oliver O'Halloran, linuxppc-dev,
Cédric Le Goater
In-Reply-To: <20200914211007.2285999-1-clg@kaod.org>
This fixes a compile error with W=1.
CC arch/powerpc/platforms/powernv/pci-ioda.o
../arch/powerpc/platforms/powernv/pci-ioda.c: In function ‘pnv_ioda_configure_pe’:
../arch/powerpc/platforms/powernv/pci-ioda.c:897:18: error: variable ‘parent’ set but not used [-Werror=unused-but-set-variable]
struct pci_dev *parent;
^~~~~~
Cc: Oliver O'Halloran <oohall@gmail.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Reviewed-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
arch/powerpc/platforms/powernv/pci-ioda.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index 023a4f987bb2..2b4ceb5e6ce4 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -894,7 +894,6 @@ int pnv_ioda_deconfigure_pe(struct pnv_phb *phb, struct pnv_ioda_pe *pe)
int pnv_ioda_configure_pe(struct pnv_phb *phb, struct pnv_ioda_pe *pe)
{
- struct pci_dev *parent;
uint8_t bcomp, dcomp, fcomp;
long rc, rid_end, rid;
@@ -904,7 +903,6 @@ int pnv_ioda_configure_pe(struct pnv_phb *phb, struct pnv_ioda_pe *pe)
dcomp = OPAL_IGNORE_RID_DEVICE_NUMBER;
fcomp = OPAL_IGNORE_RID_FUNCTION_NUMBER;
- parent = pe->pbus->self;
if (pe->flags & PNV_IODA_PE_BUS_ALL)
count = resource_size(&pe->pbus->busn_res);
else
@@ -925,12 +923,6 @@ int pnv_ioda_configure_pe(struct pnv_phb *phb, struct pnv_ioda_pe *pe)
}
rid_end = pe->rid + (count << 8);
} else {
-#ifdef CONFIG_PCI_IOV
- if (pe->flags & PNV_IODA_PE_VF)
- parent = pe->parent_dev;
- else
-#endif /* CONFIG_PCI_IOV */
- parent = pe->pdev->bus->self;
bcomp = OpalPciBusAll;
dcomp = OPAL_COMPARE_RID_DEVICE_NUMBER;
fcomp = OPAL_COMPARE_RID_FUNCTION_NUMBER;
--
2.25.4
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox