public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
From: Paul Moore <paul@paul-moore.com>
To: Tony Jones <tonyj@suse.de>, Steve Grubb <sgrubb@redhat.com>
Cc: linux-audit@redhat.com
Subject: Re: [PATCH] audit:  add ppc64 mach support
Date: Tue, 02 Dec 2014 15:18:35 -0500	[thread overview]
Message-ID: <2573861.NOhY4taJkb@sifl> (raw)
In-Reply-To: <547D0091.909@suse.de>

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?

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)

-- 
paul moore
www.paul-moore.com

  reply	other threads:[~2014-12-02 20:18 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 [this message]
2014-12-02 20:29       ` Steve Grubb
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=2573861.NOhY4taJkb@sifl \
    --to=paul@paul-moore.com \
    --cc=linux-audit@redhat.com \
    --cc=sgrubb@redhat.com \
    --cc=tonyj@suse.de \
    /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