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]
Message-ID: <CAAhV-H5Aov1NVsbNWZa9psPhBiNssYWWEzNOyLooeXGKsYxN+w@mail.gmail.com>
Date:   Thu, 19 May 2022 00:54:24 +0800
From:   Huacai Chen <chenhuacai@...il.com>
To:     "Eric W. Biederman" <ebiederm@...ssion.com>
Cc:     Huacai Chen <chenhuacai@...ngson.cn>,
        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 <linux-arch@...r.kernel.org>,
        "open list:DOCUMENTATION" <linux-doc@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Xuefeng Li <lixuefeng@...ngson.cn>,
        Yanteng Si <siyanteng@...ngson.cn>,
        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

Hi, Eric,

On Thu, May 19, 2022 at 12:40 AM Eric W. Biederman
<ebiederm@...ssion.com> wrote:
>
> 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.
This is used by get_ctx_through_ctxinfo() in signal.c and I think
similar function is also needed by userspace.

Its name is once before called context_info but conflict with another
software, then I want to use ctx_info but conflict with another kernel
struct. :(
>
> Symbols that start with an underscore "_" are reserved and should not
> be used in general, and especially not in uapi header files.
Then, maybe we can use sctx_info here?

Huacai
>
> Eric

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ