lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 9 Nov 2018 23:39:07 +0000
From:   Vineet Gupta <vineet.gupta1@...opsys.com>
To:     "Dmitry V. Levin" <ldv@...linux.org>,
        Andrew Lutomirski <luto@...nel.org>,
        Alexey Brodkin <alexey.brodkin@...opsys.com>,
        Vineet Gupta <vineet.gupta1@...opsys.com>
CC:     Elvira Khabirova <lineprinter@...linux.org>,
        Paul Moore <paul@...l-moore.com>,
        Eric Paris <eparis@...hat.com>,
        "linux-snps-arc@...ts.infradead.org" 
        <linux-snps-arc@...ts.infradead.org>,
        "linux-audit@...hat.com" <linux-audit@...hat.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 06/13 v2] arc: define syscall_get_arch()

On 11/9/18 3:33 PM, Dmitry V. Levin wrote:
> syscall_get_arch() is required to be implemented on all architectures
> that use tracehook_report_syscall_entry() in order to extend
> the generic ptrace API with PTRACE_GET_SYSCALL_INFO request.
>
> Signed-off-by: Dmitry V. Levin <ldv@...linux.org>
> ---
> v2: define AUDIT_ARCH_ARCOMPACT, AUDIT_ARCH_ARCOMPACTLE, AUDIT_ARCH_ARCV2,
> and AUDIT_ARCH_ARCV2LE instead of AUDIT_ARCH_ARC, update
> syscall_get_arch() implementation accordingly.
>
>  arch/arc/include/asm/syscall.h | 18 ++++++++++++++++++
>  include/uapi/linux/audit.h     |  4 ++++
>  2 files changed, 22 insertions(+)
>
> diff --git a/arch/arc/include/asm/syscall.h b/arch/arc/include/asm/syscall.h
> index 29de09804306..a1b698290778 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,21 @@ syscall_get_arguments(struct task_struct *task, struct pt_regs *regs,
>  	}
>  }
>  
> +static inline int syscall_get_arch(void)
> +{
> +#ifdef CONFIG_ISA_ARCOMPACT
> +# ifdef CONFIG_CPU_BIG_ENDIAN
> +	return AUDIT_ARCH_ARCOMPACT;
> +# else
> +	return AUDIT_ARCH_ARCOMPACTLE;
> +# endif
> +#else	/* CONFIG_ISA_ARCV2 */
> +# ifdef CONFIG_CPU_BIG_ENDIAN
> +	return AUDIT_ARCH_ARCV2;
> +# else
> +	return AUDIT_ARCH_ARCV2LE;
> +# endif
> +#endif
> +}

Bike shedding, but will using IS_ENABLED make the code any better.


> +
>  #endif
> diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h
> index 818ae690ab79..8e70fb70b8f8 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)
> +#define AUDIT_ARCH_ARCOMPACTLE	(EM_ARCOMPACT|__AUDIT_ARCH_LE)
> +#define AUDIT_ARCH_ARCV2	(EM_ARCV2)
> +#define AUDIT_ARCH_ARCV2LE	(EM_ARCV2|__AUDIT_ARCH_LE)

More Bike shedding, can we make LE as default and add BE suffixes variants please.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ