From: Will Deacon <will.deacon@arm.com>
To: Kees Cook <keescook@chromium.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Russell King <linux@arm.linux.org.uk>,
Will Drewry <wad@chromium.org>,
Geremy Condra <gcondra@google.com>,
Al Viro <viro@zeniv.linux.org.uk>,
Catalin Marinas <Catalin.Marinas@arm.com>
Subject: Re: [PATCH 1/4] arch/arm: add syscall_get_arch
Date: Mon, 5 Nov 2012 13:29:07 +0000 [thread overview]
Message-ID: <20121105132907.GL3351@mudshark.cambridge.arm.com> (raw)
In-Reply-To: <1351815300-28627-2-git-send-email-keescook@chromium.org>
On Fri, Nov 02, 2012 at 12:14:57AM +0000, Kees Cook wrote:
> From: Will Drewry <wad@chromium.org>
>
> Provide an ARM implementation of syscall_get_arch. This is a pre-requisite
> for CONFIG_HAVE_ARCH_SECCOMP_FILTER.
>
> Signed-off-by: Will Drewry <wad@chromium.org>
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
> arch/arm/include/asm/syscall.h | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/arch/arm/include/asm/syscall.h b/arch/arm/include/asm/syscall.h
> index 9fdded6..803f433 100644
> --- a/arch/arm/include/asm/syscall.h
> +++ b/arch/arm/include/asm/syscall.h
> @@ -7,6 +7,8 @@
> #ifndef _ASM_ARM_SYSCALL_H
> #define _ASM_ARM_SYSCALL_H
>
> +#include <linux/audit.h> /* for AUDIT_ARCH_* */
> +#include <linux/elf.h> /* for ELF_EM */
> #include <linux/err.h>
> #include <linux/sched.h>
>
> @@ -95,4 +97,15 @@ static inline void syscall_set_arguments(struct task_struct *task,
> memcpy(®s->ARM_r0 + i, args, n * sizeof(args[0]));
> }
>
> +static inline int syscall_get_arch(struct task_struct *task,
> + struct pt_regs *regs)
> +{
> + /* ARM tasks don't change audit architectures on the fly. */
> +#ifdef __ARMEB__
> + return AUDIT_ARCH_ARMEB;
> +#else
> + return AUDIT_ARCH_ARM;
> +#endif
> +}
I think you can just use AUDIT_ARCH_ARM unconditionally here as the syscall
ABI is not related to the endianness of the CPU. I believe AUDIT_ARCH_ARMEB
was added accidentally because somebody incorrectly thought the -EB suffix
signified EABI.
If it wasn't in a user-header I'd be all for deleting the old definition...
Will
next prev parent reply other threads:[~2012-11-05 13:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-02 0:14 [PATCH v3 0/4] arch/arm: support seccomp Kees Cook
2012-11-02 0:14 ` [PATCH 1/4] arch/arm: add syscall_get_arch Kees Cook
2012-11-05 13:29 ` Will Deacon [this message]
2012-11-02 0:14 ` [PATCH 2/4] arch/arm: move secure_computing into trace Kees Cook
2012-11-02 0:14 ` [PATCH 3/4] arch/arm: allow a scno of -1 to not cause a SIGILL Kees Cook
2012-11-02 0:15 ` [PATCH 4/4] arch/arm: select HAVE_ARCH_SECCOMP_FILTER Kees Cook
-- strict thread matches above, loose matches on Subject: below --
2012-11-10 22:44 [PATCH v5 0/4] arch/arm: support seccomp Kees Cook
2012-11-10 22:44 ` [PATCH 1/4] arch/arm: add syscall_get_arch Kees Cook
2012-11-08 20:59 [PATCH v4 0/4] arch/arm: support seccomp Kees Cook
2012-11-08 20:59 ` [PATCH 1/4] arch/arm: add syscall_get_arch Kees Cook
2012-11-01 19:46 [PATCH v2 0/4] arch/arm: support seccomp Kees Cook
2012-11-01 19:46 ` [PATCH 1/4] arch/arm: add syscall_get_arch Kees Cook
2012-10-30 0:41 [PATCH 0/4] arch/arm: support seccomp Kees Cook
2012-10-30 0:41 ` [PATCH 1/4] arch/arm: add syscall_get_arch Kees Cook
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121105132907.GL3351@mudshark.cambridge.arm.com \
--to=will.deacon@arm.com \
--cc=Catalin.Marinas@arm.com \
--cc=gcondra@google.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=viro@zeniv.linux.org.uk \
--cc=wad@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®