linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 0/8] Improved seccomp-bpf support for MIPS
       [not found] <1390401604-11830-1-git-send-email-markos.chandras@imgtec.com>
@ 2014-02-12  0:58 ` Paul Gortmaker
  2014-02-12  9:39   ` Markos Chandras
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Gortmaker @ 2014-02-12  0:58 UTC (permalink / raw)
  To: Markos Chandras; +Cc: linux-mips, linux-next

On Wed, Jan 22, 2014 at 9:39 AM, Markos Chandras
<markos.chandras@imgtec.com> wrote:
> Hi,
>
> This patch improves the existing seccomp-bpf support for MIPS.
> It fixes a bug when copying system call arguments for the filter
> checks and it also moves away from strict filtering to actually
> use the filter supplied by the userspace process.

Hi all,

It seems this causes a build fail on linux-next allmodconfig.  I left
a mindless "git bisect run .." go against it and it came up with:
----------------------------
make[2]: *** [samples/seccomp/bpf-direct.o] Error 1
make[1]: *** [samples/seccomp] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [vmlinux] Error 2
5c5df77172430c6377ec3434ce62f2b14a6799fc is the first bad commit
commit 5c5df77172430c6377ec3434ce62f2b14a6799fc
Author: Markos Chandras <markos.chandras@imgtec.com>
Date:   Wed Jan 22 14:40:04 2014 +0000

    MIPS: Select HAVE_ARCH_SECCOMP_FILTER

    Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
    Reviewed-by: James Hogan <james.hogan@imgtec.com>
    Reviewed-by: Paul Burton <paul.burton@imgtec.com>
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/6401/
    Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
---------------------

The original linux-next fail is at:

http://kisskb.ellerman.id.au/kisskb/buildresult/10601740/

Paul.
--

>
> This patchset has been tested with libseccomp
> (MIPS support not upstream yet) on mips, mipsel and mips64
> and with Chromium test suite (MIPS support not upstream yet)
> on mipsel.
>
> This patchset is based on the upstream-sfr/mips-for-linux-next tree.
>
> Markos Chandras (8):
>   MIPS: asm: syscall: Fix copying system call arguments
>   MIPS: asm: syscall: Add the syscall_rollback function
>   MIPS: asm: syscall: Define syscall_get_arch
>   MIPS: asm: thread_info: Add _TIF_SECCOMP flag
>   MIPS: ptrace: Move away from secure_computing_strict
>   MIPS: kernel: scalls: Skip the syscall if denied by the seccomp filter
>   MIPS: seccomp: Handle indirect system calls (o32)
>   MIPS: Select HAVE_ARCH_SECCOMP_FILTER
>
>  arch/mips/Kconfig                   |  1 +
>  arch/mips/include/asm/ptrace.h      |  2 +-
>  arch/mips/include/asm/syscall.h     | 35 ++++++++++++++++++++++++++++++-----
>  arch/mips/include/asm/thread_info.h |  3 ++-
>  arch/mips/kernel/ptrace.c           | 11 ++++++-----
>  arch/mips/kernel/scall32-o32.S      | 15 +++++++++++++--
>  arch/mips/kernel/scall64-64.S       |  5 ++++-
>  arch/mips/kernel/scall64-n32.S      |  5 ++++-
>  arch/mips/kernel/scall64-o32.S      | 17 +++++++++++++++--
>  9 files changed, 76 insertions(+), 18 deletions(-)
>
> --
> 1.8.5.3
>
>
>--

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 0/8] Improved seccomp-bpf support for MIPS
  2014-02-12  0:58 ` [PATCH 0/8] Improved seccomp-bpf support for MIPS Paul Gortmaker
@ 2014-02-12  9:39   ` Markos Chandras
  2014-02-12 15:31     ` Paul Gortmaker
  0 siblings, 1 reply; 3+ messages in thread
From: Markos Chandras @ 2014-02-12  9:39 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-mips, linux-next

On 02/12/2014 12:58 AM, Paul Gortmaker wrote:
> On Wed, Jan 22, 2014 at 9:39 AM, Markos Chandras
> <markos.chandras@imgtec.com> wrote:
>> Hi,
>>
>> This patch improves the existing seccomp-bpf support for MIPS.
>> It fixes a bug when copying system call arguments for the filter
>> checks and it also moves away from strict filtering to actually
>> use the filter supplied by the userspace process.
>
> Hi all,
>
> It seems this causes a build fail on linux-next allmodconfig.  I left
> a mindless "git bisect run .." go against it and it came up with:
> ----------------------------
> make[2]: *** [samples/seccomp/bpf-direct.o] Error 1
> make[1]: *** [samples/seccomp] Error 2
> make[1]: *** Waiting for unfinished jobs....
> make: *** [vmlinux] Error 2
> 5c5df77172430c6377ec3434ce62f2b14a6799fc is the first bad commit
> commit 5c5df77172430c6377ec3434ce62f2b14a6799fc
> Author: Markos Chandras <markos.chandras@imgtec.com>
> Date:   Wed Jan 22 14:40:04 2014 +0000
>
>      MIPS: Select HAVE_ARCH_SECCOMP_FILTER
>
>      Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
>      Reviewed-by: James Hogan <james.hogan@imgtec.com>
>      Reviewed-by: Paul Burton <paul.burton@imgtec.com>
>      Cc: linux-mips@linux-mips.org
>      Patchwork: https://patchwork.linux-mips.org/patch/6401/
>      Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
> ---------------------
>
> The original linux-next fail is at:
>
> http://kisskb.ellerman.id.au/kisskb/buildresult/10601740/
>
> Paul.

Hi Paul,

I don't think this is caused by my patch. My patch just exposed it. To 
my understanding, the samples/seccomp are not meant to be 
cross-compiled. The tests use the host toolchain. However, when 
cross-compiling for MIPS, for example, __NR_write is only defined if

1) _MIPS_SIM == _MIPS_SIM_ABI64
2) _MIPS_SIM == _MIPS_SIM_ABI32
3) _MIPS_SIM == _MIPS_SIM_NABI32

which clearly makes no sense for the x86_64 toolchain. I would propose a 
fix like this in order to prevent test from being cross-compiled.

diff --git a/samples/seccomp/Makefile b/samples/seccomp/Makefile
index 7203e66..f3a018e 100644
--- a/samples/seccomp/Makefile
+++ b/samples/seccomp/Makefile
@@ -17,9 +17,9 @@ HOSTCFLAGS_bpf-direct.o += -I$(objtree)/usr/include
  HOSTCFLAGS_bpf-direct.o += -idirafter $(objtree)/include
  bpf-direct-objs := bpf-direct.o

+ifndef CROSS_COMPILE
  # Try to match the kernel target.
  ifndef CONFIG_64BIT
-ifndef CROSS_COMPILE

  # s390 has -m31 flag to build 31 bit binaries
  ifndef CONFIG_S390
@@ -36,7 +36,7 @@ HOSTLOADLIBES_bpf-direct += $(MFLAG)
  HOSTLOADLIBES_bpf-fancy += $(MFLAG)
  HOSTLOADLIBES_dropper += $(MFLAG)
  endif
-endif

  # Tell kbuild to always build the programs
  always := $(hostprogs-y)
+endif


-- 
markos

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 0/8] Improved seccomp-bpf support for MIPS
  2014-02-12  9:39   ` Markos Chandras
@ 2014-02-12 15:31     ` Paul Gortmaker
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Gortmaker @ 2014-02-12 15:31 UTC (permalink / raw)
  To: Markos Chandras; +Cc: linux-mips, linux-next

On 14-02-12 04:39 AM, Markos Chandras wrote:
> On 02/12/2014 12:58 AM, Paul Gortmaker wrote:
>> On Wed, Jan 22, 2014 at 9:39 AM, Markos Chandras
>> <markos.chandras@imgtec.com> wrote:
>>> Hi,
>>>
>>> This patch improves the existing seccomp-bpf support for MIPS.
>>> It fixes a bug when copying system call arguments for the filter
>>> checks and it also moves away from strict filtering to actually
>>> use the filter supplied by the userspace process.
>>
>> Hi all,
>>
>> It seems this causes a build fail on linux-next allmodconfig.  I left
>> a mindless "git bisect run .." go against it and it came up with:
>> ----------------------------
>> make[2]: *** [samples/seccomp/bpf-direct.o] Error 1
>> make[1]: *** [samples/seccomp] Error 2
>> make[1]: *** Waiting for unfinished jobs....
>> make: *** [vmlinux] Error 2
>> 5c5df77172430c6377ec3434ce62f2b14a6799fc is the first bad commit
>> commit 5c5df77172430c6377ec3434ce62f2b14a6799fc
>> Author: Markos Chandras <markos.chandras@imgtec.com>
>> Date:   Wed Jan 22 14:40:04 2014 +0000
>>
>>      MIPS: Select HAVE_ARCH_SECCOMP_FILTER
>>
>>      Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
>>      Reviewed-by: James Hogan <james.hogan@imgtec.com>
>>      Reviewed-by: Paul Burton <paul.burton@imgtec.com>
>>      Cc: linux-mips@linux-mips.org
>>      Patchwork: https://patchwork.linux-mips.org/patch/6401/
>>      Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
>> ---------------------
>>
>> The original linux-next fail is at:
>>
>> http://kisskb.ellerman.id.au/kisskb/buildresult/10601740/
>>
>> Paul.
> 
> Hi Paul,
> 
> I don't think this is caused by my patch. My patch just exposed it. To

Ha, well that is one and the same thing for all intents and purposes.

Would you please formalize your patch below and put it in your
queue, in advance of the patch(es) that cause/trigger the breakage?

That way we won't be introducing a build bisection failure into the
permanent git history.

Thanks,
Paul.
--

> my understanding, the samples/seccomp are not meant to be 
> cross-compiled. The tests use the host toolchain. However, when 
> cross-compiling for MIPS, for example, __NR_write is only defined if
> 
> 1) _MIPS_SIM == _MIPS_SIM_ABI64
> 2) _MIPS_SIM == _MIPS_SIM_ABI32
> 3) _MIPS_SIM == _MIPS_SIM_NABI32
> 
> which clearly makes no sense for the x86_64 toolchain. I would propose a 
> fix like this in order to prevent test from being cross-compiled.
> 
> diff --git a/samples/seccomp/Makefile b/samples/seccomp/Makefile
> index 7203e66..f3a018e 100644
> --- a/samples/seccomp/Makefile
> +++ b/samples/seccomp/Makefile
> @@ -17,9 +17,9 @@ HOSTCFLAGS_bpf-direct.o += -I$(objtree)/usr/include
>   HOSTCFLAGS_bpf-direct.o += -idirafter $(objtree)/include
>   bpf-direct-objs := bpf-direct.o
> 
> +ifndef CROSS_COMPILE
>   # Try to match the kernel target.
>   ifndef CONFIG_64BIT
> -ifndef CROSS_COMPILE
> 
>   # s390 has -m31 flag to build 31 bit binaries
>   ifndef CONFIG_S390
> @@ -36,7 +36,7 @@ HOSTLOADLIBES_bpf-direct += $(MFLAG)
>   HOSTLOADLIBES_bpf-fancy += $(MFLAG)
>   HOSTLOADLIBES_dropper += $(MFLAG)
>   endif
> -endif
> 
>   # Tell kbuild to always build the programs
>   always := $(hostprogs-y)
> +endif
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-02-12 15:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1390401604-11830-1-git-send-email-markos.chandras@imgtec.com>
2014-02-12  0:58 ` [PATCH 0/8] Improved seccomp-bpf support for MIPS Paul Gortmaker
2014-02-12  9:39   ` Markos Chandras
2014-02-12 15:31     ` Paul Gortmaker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).