All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dmitry V. Levin" <ldv@altlinux.org>
To: linux-kernel@vger.kernel.org
Cc: Elvira Khabirova <lineprinter@altlinux.org>,
	Eugene Syromyatnikov <esyr@redhat.com>,
	Oleg Nesterov <oleg@redhat.com>,
	Andy Lutomirski <luto@kernel.org>,
	Vineet Gupta <vgupta@synopsys.com>,
	Alexey Brodkin <alexey.brodkin@synopsys.com>,
	Paul Moore <paul@paul-moore.com>, Eric Paris <eparis@redhat.com>,
	linux-snps-arc@lists.infradead.org, linux-audit@redhat.com
Subject: [PATCH v6 05/27] arc: define syscall_get_arch()
Date: Thu, 13 Dec 2018 20:21:47 +0300	[thread overview]
Message-ID: <20181213172146.GE6024@altlinux.org> (raw)
In-Reply-To: 20181213171833.GA5240@altlinux.org

syscall_get_arch() is required to be implemented on all architectures
in addition to already implemented syscall_get_nr(),
syscall_get_arguments(), syscall_get_error(), and
syscall_get_return_value() functions in order to extend the generic
ptrace API with PTRACE_GET_SYSCALL_INFO request.

Acked-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Elvira Khabirova <lineprinter@altlinux.org>
Cc: Eugene Syromyatnikov <esyr@redhat.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Alexey Brodkin <alexey.brodkin@synopsys.com>
Cc: Paul Moore <paul@paul-moore.com>
Cc: Eric Paris <eparis@redhat.com>
Cc: linux-snps-arc@lists.infradead.org
Cc: linux-audit@redhat.com
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
---

Notes:
    v6: unchanged
    v5: added Cc
    v2: added Acked-by

 arch/arc/include/asm/syscall.h | 11 +++++++++++
 include/uapi/linux/audit.h     |  4 ++++
 2 files changed, 15 insertions(+)

diff --git a/arch/arc/include/asm/syscall.h b/arch/arc/include/asm/syscall.h
index 29de09804306..c7fc4c0c3bcb 100644
--- a/arch/arc/include/asm/syscall.h
+++ b/arch/arc/include/asm/syscall.h
@@ -9,6 +9,7 @@
 #ifndef _ASM_ARC_SYSCALL_H
 #define _ASM_ARC_SYSCALL_H  1
 
+#include <uapi/linux/audit.h>
 #include <linux/err.h>
 #include <linux/sched.h>
 #include <asm/unistd.h>
@@ -68,4 +69,14 @@ syscall_get_arguments(struct task_struct *task, struct pt_regs *regs,
 	}
 }
 
+static inline int
+syscall_get_arch(void)
+{
+	return IS_ENABLED(CONFIG_ISA_ARCOMPACT)
+		? (IS_ENABLED(CONFIG_CPU_BIG_ENDIAN)
+			? AUDIT_ARCH_ARCOMPACTBE : AUDIT_ARCH_ARCOMPACT)
+		: (IS_ENABLED(CONFIG_CPU_BIG_ENDIAN)
+			? AUDIT_ARCH_ARCV2BE : AUDIT_ARCH_ARCV2);
+}
+
 #endif
diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h
index 818ae690ab79..bedf3bf54c3a 100644
--- a/include/uapi/linux/audit.h
+++ b/include/uapi/linux/audit.h
@@ -375,6 +375,10 @@ enum {
 
 #define AUDIT_ARCH_AARCH64	(EM_AARCH64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
 #define AUDIT_ARCH_ALPHA	(EM_ALPHA|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_ARCOMPACT	(EM_ARCOMPACT|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_ARCOMPACTBE	(EM_ARCOMPACT)
+#define AUDIT_ARCH_ARCV2	(EM_ARCV2|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_ARCV2BE	(EM_ARCV2)
 #define AUDIT_ARCH_ARM		(EM_ARM|__AUDIT_ARCH_LE)
 #define AUDIT_ARCH_ARMEB	(EM_ARM)
 #define AUDIT_ARCH_CRIS		(EM_CRIS|__AUDIT_ARCH_LE)
-- 
ldv

WARNING: multiple messages have this Message-ID (diff)
From: ldv@altlinux.org (Dmitry V. Levin)
To: linux-snps-arc@lists.infradead.org
Subject: [PATCH v6 05/27] arc: define syscall_get_arch()
Date: Thu, 13 Dec 2018 20:21:47 +0300	[thread overview]
Message-ID: <20181213172146.GE6024@altlinux.org> (raw)
In-Reply-To: 20181213171833.GA5240@altlinux.org

syscall_get_arch() is required to be implemented on all architectures
in addition to already implemented syscall_get_nr(),
syscall_get_arguments(), syscall_get_error(), and
syscall_get_return_value() functions in order to extend the generic
ptrace API with PTRACE_GET_SYSCALL_INFO request.

Acked-by: Vineet Gupta <vgupta at synopsys.com>
Cc: Elvira Khabirova <lineprinter at altlinux.org>
Cc: Eugene Syromyatnikov <esyr at redhat.com>
Cc: Oleg Nesterov <oleg at redhat.com>
Cc: Andy Lutomirski <luto at kernel.org>
Cc: Alexey Brodkin <alexey.brodkin at synopsys.com>
Cc: Paul Moore <paul at paul-moore.com>
Cc: Eric Paris <eparis at redhat.com>
Cc: linux-snps-arc at lists.infradead.org
Cc: linux-audit at redhat.com
Signed-off-by: Dmitry V. Levin <ldv at altlinux.org>
---

Notes:
    v6: unchanged
    v5: added Cc
    v2: added Acked-by

 arch/arc/include/asm/syscall.h | 11 +++++++++++
 include/uapi/linux/audit.h     |  4 ++++
 2 files changed, 15 insertions(+)

diff --git a/arch/arc/include/asm/syscall.h b/arch/arc/include/asm/syscall.h
index 29de09804306..c7fc4c0c3bcb 100644
--- a/arch/arc/include/asm/syscall.h
+++ b/arch/arc/include/asm/syscall.h
@@ -9,6 +9,7 @@
 #ifndef _ASM_ARC_SYSCALL_H
 #define _ASM_ARC_SYSCALL_H  1
 
+#include <uapi/linux/audit.h>
 #include <linux/err.h>
 #include <linux/sched.h>
 #include <asm/unistd.h>
@@ -68,4 +69,14 @@ syscall_get_arguments(struct task_struct *task, struct pt_regs *regs,
 	}
 }
 
+static inline int
+syscall_get_arch(void)
+{
+	return IS_ENABLED(CONFIG_ISA_ARCOMPACT)
+		? (IS_ENABLED(CONFIG_CPU_BIG_ENDIAN)
+			? AUDIT_ARCH_ARCOMPACTBE : AUDIT_ARCH_ARCOMPACT)
+		: (IS_ENABLED(CONFIG_CPU_BIG_ENDIAN)
+			? AUDIT_ARCH_ARCV2BE : AUDIT_ARCH_ARCV2);
+}
+
 #endif
diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h
index 818ae690ab79..bedf3bf54c3a 100644
--- a/include/uapi/linux/audit.h
+++ b/include/uapi/linux/audit.h
@@ -375,6 +375,10 @@ enum {
 
 #define AUDIT_ARCH_AARCH64	(EM_AARCH64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
 #define AUDIT_ARCH_ALPHA	(EM_ALPHA|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_ARCOMPACT	(EM_ARCOMPACT|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_ARCOMPACTBE	(EM_ARCOMPACT)
+#define AUDIT_ARCH_ARCV2	(EM_ARCV2|__AUDIT_ARCH_LE)
+#define AUDIT_ARCH_ARCV2BE	(EM_ARCV2)
 #define AUDIT_ARCH_ARM		(EM_ARM|__AUDIT_ARCH_LE)
 #define AUDIT_ARCH_ARMEB	(EM_ARM)
 #define AUDIT_ARCH_CRIS		(EM_CRIS|__AUDIT_ARCH_LE)
-- 
ldv

  parent reply	other threads:[~2018-12-13 17:21 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-13 17:18 [PATCH v6 00/27] ptrace: add PTRACE_GET_SYSCALL_INFO request Dmitry V. Levin
2018-12-13 17:18 ` Dmitry V. Levin
2018-12-13 17:18 ` Dmitry V. Levin
2018-12-13 17:18 ` [OpenRISC] " Dmitry V. Levin
2018-12-13 17:18 ` Dmitry V. Levin
2018-12-13 17:18 ` Dmitry V. Levin
2018-12-13 17:18 ` Dmitry V. Levin
2018-12-13 17:21 ` [PATCH v6 01/27] asm-generic/syscall.h: prepare for inclusion by other files Dmitry V. Levin
2018-12-13 17:21   ` Dmitry V. Levin
2018-12-13 17:21 ` [PATCH v6 02/27] asm-generic/syscall.h: turn syscall_[gs]et_arguments into wrappers Dmitry V. Levin
2018-12-13 17:21 ` [PATCH v6 03/27] alpha: define remaining syscall_get_* functions Dmitry V. Levin
2018-12-13 17:21 ` [PATCH v6 04/27] Move EM_ARCOMPACT and EM_ARCV2 to uapi/linux/elf-em.h Dmitry V. Levin
2018-12-13 17:21   ` Dmitry V. Levin
2018-12-21  1:19   ` Dmitry V. Levin
2018-12-21  1:19     ` Dmitry V. Levin
2018-12-13 17:21 ` Dmitry V. Levin [this message]
2018-12-13 17:21   ` [PATCH v6 05/27] arc: define syscall_get_arch() Dmitry V. Levin
2018-12-21  1:21   ` Dmitry V. Levin
2018-12-21  1:21     ` Dmitry V. Levin
2018-12-13 17:21 ` [PATCH v6 06/27] c6x: " Dmitry V. Levin
2018-12-13 17:22 ` [PATCH v6 07/27] elf-em.h: add EM_CSKY Dmitry V. Levin
2018-12-14  4:43   ` Guo Ren
2018-12-21  2:35     ` Dmitry V. Levin
2018-12-21 14:49       ` Guo Ren
2018-12-13 17:22 ` [PATCH v6 08/27] csky: define syscall_get_arch() Dmitry V. Levin
2018-12-14  4:44   ` Guo Ren
2018-12-21  2:36     ` Dmitry V. Levin
2018-12-21 14:48       ` Guo Ren
2018-12-13 17:22 ` [PATCH v6 09/27] h8300: define remaining syscall_get_* functions Dmitry V. Levin
2018-12-13 17:22 ` [PATCH v6 10/27] Move EM_HEXAGON to uapi/linux/elf-em.h Dmitry V. Levin
2018-12-13 17:22 ` [PATCH v6 11/27] hexagon: define remaining syscall_get_* functions Dmitry V. Levin
2018-12-13 17:22 ` [PATCH v6 12/27] Move EM_NDS32 to uapi/linux/elf-em.h Dmitry V. Levin
2018-12-13 17:22 ` [PATCH v6 13/27] nds32: define syscall_get_arch() Dmitry V. Levin
2018-12-13 17:22 ` [PATCH v6 14/27] nios2: " Dmitry V. Levin
2018-12-13 17:22 ` [PATCH v6 15/27] m68k: add asm/syscall.h Dmitry V. Levin
2018-12-13 17:23 ` [PATCH v6 16/27] mips: define syscall_get_error() Dmitry V. Levin
2018-12-13 19:00   ` Paul Burton
2018-12-21  1:31     ` Dmitry V. Levin
2018-12-13 17:23 ` [PATCH v6 17/27] parisc: " Dmitry V. Levin
2018-12-13 17:23 ` [PATCH v6 18/27] powerpc: " Dmitry V. Levin
2018-12-13 17:23   ` Dmitry V. Levin
2018-12-18 12:36   ` powerpc syscall_set_return_value() is confused (was Re: [PATCH v6 18/27] powerpc: define syscall_get_error()) Michael Ellerman
2018-12-18 12:36     ` Michael Ellerman
2018-12-13 17:23 ` [PATCH v6 19/27] riscv: define syscall_get_arch() Dmitry V. Levin
2018-12-13 17:23   ` Dmitry V. Levin
2018-12-13 17:23 ` [PATCH v6 20/27] Move EM_XTENSA to uapi/linux/elf-em.h Dmitry V. Levin
2018-12-13 17:23 ` [PATCH v6 21/27] xtensa: define syscall_get_* functions Dmitry V. Levin
2018-12-13 17:24 ` [PATCH v6 22/27] Move EM_UNICORE to uapi/linux/elf-em.h Dmitry V. Levin
2018-12-13 17:24 ` [PATCH v6 23/27] unicore32: add asm/syscall.h Dmitry V. Levin
2018-12-13 17:24 ` [PATCH v6 24/27] syscall_get_arch: add "struct task_struct *" argument Dmitry V. Levin
2018-12-13 17:24   ` [OpenRISC] " Dmitry V. Levin
2018-12-13 17:24   ` Dmitry V. Levin
2018-12-13 17:24   ` Dmitry V. Levin
2018-12-13 17:24   ` Dmitry V. Levin
2018-12-13 17:24   ` Dmitry V. Levin
2018-12-13 17:24   ` Dmitry V. Levin
2018-12-13 17:24 ` [PATCH v6 25/27] powerpc/ptrace: replace ptrace_report_syscall() with a tracehook call Dmitry V. Levin
2018-12-13 17:24   ` Dmitry V. Levin
2018-12-13 17:24 ` [PATCH v6 26/27] ptrace: add PTRACE_GET_SYSCALL_INFO request Dmitry V. Levin
2018-12-13 17:24 ` [PATCH v6 27/27] selftests/ptrace: add a test case for PTRACE_GET_SYSCALL_INFO Dmitry V. Levin
2018-12-13 17:24   ` Dmitry V. Levin
2018-12-13 17:24   ` ldv
2018-12-14 20:15 ` [PATCH v6 00/27] ptrace: add PTRACE_GET_SYSCALL_INFO request Paul Moore
2018-12-14 20:15   ` Paul Moore
2018-12-14 20:15   ` [OpenRISC] " Paul Moore
2018-12-14 20:15   ` Paul Moore
2018-12-14 20:15   ` Paul Moore
2018-12-14 20:15   ` 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=20181213172146.GE6024@altlinux.org \
    --to=ldv@altlinux.org \
    --cc=alexey.brodkin@synopsys.com \
    --cc=eparis@redhat.com \
    --cc=esyr@redhat.com \
    --cc=lineprinter@altlinux.org \
    --cc=linux-audit@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=luto@kernel.org \
    --cc=oleg@redhat.com \
    --cc=paul@paul-moore.com \
    --cc=vgupta@synopsys.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.