linux-audit.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Steve Grubb <sgrubb@redhat.com>
To: Paul Moore <paul@paul-moore.com>
Cc: linux-audit@redhat.com
Subject: Re: [PATCH] audit:  add ppc64 mach support
Date: Tue, 02 Dec 2014 15:29:29 -0500	[thread overview]
Message-ID: <1678380.WNrdWIL7BC@x2> (raw)
In-Reply-To: <2573861.NOhY4taJkb@sifl>

On Tuesday, December 02, 2014 03:18:35 PM Paul Moore wrote:
> On Monday, December 01, 2014 03:58:09 PM Tony Jones wrote:
> > Mainline kernel reports ppc64le (per
> > a0588015deab1844261b27a67ae6f5b910fe2830) but there is no matching
> > AUDIT_ARCH_PPC64LE.  Eric just pinged me on irc about it.   Fix to add it
> > to include/uapi/linux/audit.h shoudld probably go upstream.
> 
> Untested, uncompiled too, but beyond the patch below, is there anything else
> we would need in the kernel to enable proper ppc64le support?

The only question I have is whether or not PPC LE is just 64 bit or if it has 
a 32 bit ABI also. The uname patch referenced above seems to show a ppcle and 
ppc64le return. The original patch accepted was only for 64 bit ABI.

Thanks,
-Steve


> commit 853ff573b5e5d9d09d1dff579a4a8d6fe8ca698c
> Author: Paul Moore <pmoore@redhat.com>
> Date:   Tue Dec 2 14:50:28 2014 -0500
> 
>     audit: add basic support for PPC64LE
> 
>     Signed-off-by: Paul Moore <pmoore@redhat.com>
> 
> diff --git a/arch/powerpc/include/asm/syscall.h
> b/arch/powerpc/include/asm/syscall.h
> index b54b2ad..b9d65c3 100644
> --- a/arch/powerpc/include/asm/syscall.h
> +++ b/arch/powerpc/include/asm/syscall.h
> @@ -86,4 +86,16 @@ static inline void syscall_set_arguments(struct
> task_struct *task,
>  	memcpy(&regs->gpr[3 + i], args, n * sizeof(args[0]));
>  }
> 
> +static inline int syscall_get_arch(void)
> +{
> +#ifdef CONFIG_PPC64
> +#ifdef __LITTLE_ENDIAN__
> +	return AUDIT_ARCH_PPC64LE;
> +#else
> +	return AUDIT_ARCH_PPC64;
> +#endif /* __LITTLE_ENDIAN__ */
> +#endif /* CONFIG_PPC64 */
> +	return AUDIT_ARCH_PPC;
> +}
> +
>  #endif	/* _ASM_SYSCALL_H */
> diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
> index 2e3d2bf..6797a83 100644
> --- a/arch/powerpc/kernel/ptrace.c
> +++ b/arch/powerpc/kernel/ptrace.c
> @@ -1788,13 +1788,13 @@ long do_syscall_trace_enter(struct pt_regs *regs)
> 
>  #ifdef CONFIG_PPC64
>  	if (!is_32bit_task())
> -		audit_syscall_entry(AUDIT_ARCH_PPC64,
> +		audit_syscall_entry(syscall_get_arch(),
>  				    regs->gpr[0],
>  				    regs->gpr[3], regs->gpr[4],
>  				    regs->gpr[5], regs->gpr[6]);
>  	else
>  #endif
> -		audit_syscall_entry(AUDIT_ARCH_PPC,
> +		audit_syscall_entry(syscall_get_arch(),
>  				    regs->gpr[0],
>  				    regs->gpr[3] & 0xffffffff,
>  				    regs->gpr[4] & 0xffffffff,
> diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h
> index cf67147..c3997f4 100644
> --- a/include/uapi/linux/audit.h
> +++ b/include/uapi/linux/audit.h
> @@ -364,6 +364,7 @@ enum {
>  #define AUDIT_ARCH_PARISC64	(EM_PARISC|__AUDIT_ARCH_64BIT)
>  #define AUDIT_ARCH_PPC		(EM_PPC)
>  #define AUDIT_ARCH_PPC64	(EM_PPC64|__AUDIT_ARCH_64BIT)
> +#define AUDIT_ARCH_PPC64LE	(EM_PPC64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
>  #define AUDIT_ARCH_S390		(EM_S390)
>  #define AUDIT_ARCH_S390X	(EM_S390|__AUDIT_ARCH_64BIT)
>  #define AUDIT_ARCH_SH		(EM_SH)

  reply	other threads:[~2014-12-02 20:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-29 20:16 [PATCH] audit: add ppc64 mach support Tony Jones
2014-08-29 20:24 ` Tony Jones
2014-09-02 15:20 ` Steve Grubb
2014-12-01 22:09 ` Steve Grubb
2014-12-01 23:58   ` Tony Jones
2014-12-02 20:18     ` Paul Moore
2014-12-02 20:29       ` Steve Grubb [this message]
2014-12-02 21:27         ` Tony Jones
2014-12-02 21:27       ` Richard Guy Briggs
2014-12-02 23:19         ` Paul Moore

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=1678380.WNrdWIL7BC@x2 \
    --to=sgrubb@redhat.com \
    --cc=linux-audit@redhat.com \
    --cc=paul@paul-moore.com \
    /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;
as well as URLs for NNTP newsgroup(s).