Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1185468
| From | Michael Ellerman <mpe@ellerman.id.au> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC PATCH 11/12] selftests/seccomp: Make seccomp tests work on big endian |
| Date | 2015-07-16 05:50 +0200 |
| Message-ID | <pMIlk-3ca-5@gated-at.bofh.it> (permalink) |
| References | <pMpsl-LG-3@gated-at.bofh.it> <pMpsm-LG-31@gated-at.bofh.it> <pMwDv-3bC-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, 2015-07-15 at 08:16 -0700, Kees Cook wrote:
> On Wed, Jul 15, 2015 at 12:37 AM, Michael Ellerman <mpe@ellerman.id.au> wrote:
> > diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c
> > index b2374c131340..51adb9afb511 100644
> > --- a/tools/testing/selftests/seccomp/seccomp_bpf.c
> > +++ b/tools/testing/selftests/seccomp/seccomp_bpf.c
> > @@ -82,7 +82,13 @@ struct seccomp_data {
> > };
> > #endif
> >
> > +#if __BYTE_ORDER == __LITTLE_ENDIAN
> > #define syscall_arg(_n) (offsetof(struct seccomp_data, args[_n]))
> > +#elif __BYTE_ORDER == __BIG_ENDIAN
> > +#define syscall_arg(_n) (offsetof(struct seccomp_data, args[_n]) + sizeof(__u32))
> > +#else
> > +#error "wut?"
> > +#endif
>
> Ah-ha! Yes, thanks. Could you change the #error to something that
> describes the particular (impossible) failure condition? "wut? Unknown
> __BYTE_ORDER?!". Not a huge deal, but I always like verbose errors. :)
> Especially for "impossible" situations. :)
Yeah sorry that was a "quick hack" which got promoted into an actual patch.
Fixed to use your message.
cheers
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[RFC PATCH 01/12] powerpc/kernel: Get pt_regs from r9 before calling do_syscall_trace_enter() Michael Ellerman <mpe@ellerman.id.au> - 2015-07-15 09:40 +0200
[RFC PATCH 03/12] powerpc/kernel: Change the do_syscall_trace_enter() API Michael Ellerman <mpe@ellerman.id.au> - 2015-07-15 09:40 +0200
[RFC PATCH 11/12] selftests/seccomp: Make seccomp tests work on big endian Michael Ellerman <mpe@ellerman.id.au> - 2015-07-15 09:40 +0200
Re: [RFC PATCH 11/12] selftests/seccomp: Make seccomp tests work on big endian Kees Cook <keescook@chromium.org> - 2015-07-15 17:20 +0200
Re: [RFC PATCH 11/12] selftests/seccomp: Make seccomp tests work on big endian Michael Ellerman <mpe@ellerman.id.au> - 2015-07-16 05:50 +0200
[RFC PATCH 04/12] powerpc: Drop unused syscall_get_error() Michael Ellerman <mpe@ellerman.id.au> - 2015-07-15 09:40 +0200
[RFC PATCH 07/12] powerpc: Use orig_gpr3 in syscall_get_arguments() Michael Ellerman <mpe@ellerman.id.au> - 2015-07-15 09:40 +0200
[RFC PATCH 02/12] powerpc/kernel: Switch to using MAX_ERRNO Michael Ellerman <mpe@ellerman.id.au> - 2015-07-15 09:50 +0200
Re: [RFC PATCH 02/12] powerpc/kernel: Switch to using MAX_ERRNO Benjamin Herrenschmidt <benh@kernel.crashing.org> - 2015-07-17 00:50 +0200
Re: [RFC PATCH 01/12] powerpc/kernel: Get pt_regs from r9 before calling do_syscall_trace_enter() Benjamin Herrenschmidt <benh@kernel.crashing.org> - 2015-07-17 00:50 +0200
Re: [RFC PATCH 01/12] powerpc/kernel: Get pt_regs from r9 before calling do_syscall_trace_enter() Michael Ellerman <mpe@ellerman.id.au> - 2015-07-17 06:50 +0200
csiph-web