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:   Mon, 18 Dec 2017 12:19:46 +0100
From:   Arnd Bergmann <arnd@...db.de>
To:     Greentime Hu <green.hu@...il.com>
Cc:     Greentime <greentime@...estech.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-arch <linux-arch@...r.kernel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Jason Cooper <jason@...edaemon.net>,
        Marc Zyngier <marc.zyngier@....com>,
        Rob Herring <robh+dt@...nel.org>,
        Networking <netdev@...r.kernel.org>,
        Vincent Chen <deanbo422@...il.com>,
        DTML <devicetree@...r.kernel.org>,
        Al Viro <viro@...iv.linux.org.uk>,
        David Howells <dhowells@...hat.com>,
        Will Deacon <will.deacon@....com>,
        Daniel Lezcano <daniel.lezcano@...aro.org>,
        linux-serial@...r.kernel.org,
        Geert Uytterhoeven <geert.uytterhoeven@...il.com>,
        Linus Walleij <linus.walleij@...aro.org>,
        Mark Rutland <mark.rutland@....com>, Greg KH <greg@...ah.com>,
        ren_guo@...ky.com, Philippe Ombredanne <pombredanne@...b.com>,
        Vincent Chen <vincentc@...estech.com>
Subject: Re: [PATCH v4 16/36] nds32: System calls handling

On Mon, Dec 18, 2017 at 7:46 AM, Greentime Hu <green.hu@...il.com> wrote:


> new file mode 100644
> index 0000000..90da745
> --- /dev/null
> +++ b/arch/nds32/include/uapi/asm/unistd.h
> @@ -0,0 +1,12 @@
> +// SPDX-License-Identifier: GPL-2.0
> +// Copyright (C) 2005-2017 Andes Technology Corporation
> +
> +#define __ARCH_WANT_SYNC_FILE_RANGE2
> +
> +/* Use the standard ABI for syscalls */
> +#include <asm-generic/unistd.h>
> +
> +/* Additional NDS32 specific syscalls. */
> +#define __NR_cacheflush                (__NR_arch_specific_syscall)
> +#define __NR__llseek             __NR_llseek
> +__SYSCALL(__NR_cacheflush, sys_cacheflush)

I'm still confused by __NR__llseek here, why do you need that one?

> +SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len,
> +              unsigned long, prot, unsigned long, flags,
> +              unsigned long, fd, unsigned long, pgoff)
> +{
> +       if (pgoff & (~PAGE_MASK >> 12))
> +               return -EINVAL;
> +
> +       return sys_mmap_pgoff(addr, len, prot, flags, fd,
> +                             pgoff >> (PAGE_SHIFT - 12));
> +}
> +
> +SYSCALL_DEFINE6(mmap, unsigned long, addr, unsigned long, len,
> +              unsigned long, prot, unsigned long, flags,
> +              unsigned long, fd, unsigned long, pgoff)
> +{
> +       if (unlikely(pgoff & ~PAGE_MASK))
> +               return -EINVAL;
> +
> +       return sys_mmap_pgoff(addr, len, prot, flags, fd,
> +                             pgoff >> PAGE_SHIFT);
> +}

And I don't see why you define sys_mmap() in addition to sys_mmap2().

The rest of the syscall handling looks good now.

         Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ