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:   Wed, 18 May 2022 11:39:51 -0500
From:   "Eric W. Biederman" <ebiederm@...ssion.com>
To:     Huacai Chen <chenhuacai@...ngson.cn>
Cc:     Arnd Bergmann <arnd@...db.de>, Andy Lutomirski <luto@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Peter Zijlstra <peterz@...radead.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        David Airlie <airlied@...ux.ie>,
        Jonathan Corbet <corbet@....net>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        linux-arch@...r.kernel.org, linux-doc@...r.kernel.org,
        linux-kernel@...r.kernel.org, Xuefeng Li <lixuefeng@...ngson.cn>,
        Yanteng Si <siyanteng@...ngson.cn>,
        Huacai Chen <chenhuacai@...il.com>,
        Guo Ren <guoren@...nel.org>, Xuerui Wang <kernel@...0n.name>,
        Jiaxun Yang <jiaxun.yang@...goat.com>,
        Stephen Rothwell <sfr@...b.auug.org.au>,
        Al Viro <viro@...iv.linux.org.uk>
Subject: Re: [PATCH V11 14/22] LoongArch: Add signal handling support

Huacai Chen <chenhuacai@...ngson.cn> writes:

> Add ucontext/sigcontext definition and signal handling support for
> LoongArch.
>
> Cc: Eric Biederman <ebiederm@...ssion.com>
> Cc: Al Viro <viro@...iv.linux.org.uk>
> Signed-off-by: Huacai Chen <chenhuacai@...ngson.cn>
> ---
>  arch/loongarch/include/uapi/asm/sigcontext.h |  44 ++
>  arch/loongarch/include/uapi/asm/signal.h     |  13 +
>  arch/loongarch/include/uapi/asm/ucontext.h   |  35 ++
>  arch/loongarch/kernel/signal.c               | 566 +++++++++++++++++++
>  4 files changed, 658 insertions(+)
>  create mode 100644 arch/loongarch/include/uapi/asm/sigcontext.h
>  create mode 100644 arch/loongarch/include/uapi/asm/signal.h
>  create mode 100644 arch/loongarch/include/uapi/asm/ucontext.h
>  create mode 100644 arch/loongarch/kernel/signal.c
>
> diff --git a/arch/loongarch/include/uapi/asm/sigcontext.h b/arch/loongarch/include/uapi/asm/sigcontext.h
> new file mode 100644
> index 000000000000..be3d3c6ac83e
> --- /dev/null
> +++ b/arch/loongarch/include/uapi/asm/sigcontext.h
> @@ -0,0 +1,44 @@
> +/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
> +/*
> + * Author: Hanlu Li <lihanlu@...ngson.cn>
> + *         Huacai Chen <chenhuacai@...ngson.cn>
> + *
> + * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
> + */
> +#ifndef _UAPI_ASM_SIGCONTEXT_H
> +#define _UAPI_ASM_SIGCONTEXT_H
> +
> +#include <linux/types.h>
> +#include <linux/posix_types.h>
> +
> +/* FP context was used */
> +#define SC_USED_FP		(1 << 0)
> +/* Address error was due to memory load */
> +#define SC_ADDRERR_RD		(1 << 30)
> +/* Address error was due to memory store */
> +#define SC_ADDRERR_WR		(1 << 31)
> +
> +struct sigcontext {
> +	__u64	sc_pc;
> +	__u64	sc_regs[32];
> +	__u32	sc_flags;
> +	__u64	sc_extcontext[0] __attribute__((__aligned__(16)));
> +};
> +
> +#define CONTEXT_INFO_ALIGN	16
> +struct _ctxinfo {
> +	__u32	magic;
> +	__u32	size;
> +	__u64	padding;	/* padding to 16 bytes */
> +};

This is probably something I a missing but what is struct _ctxinfo and
why is it in a uapi header?

I don't see anything else in the uapi implementation using it.

Symbols that start with an underscore "_" are reserved and should not
be used in general, and especially not in uapi header files.

Eric

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ