[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4731114.hBXBvkC8xh@wuerfel>
Date: Wed, 25 May 2016 22:26:54 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Yury Norov <ynorov@...iumnetworks.com>
Cc: catalin.marinas@....com, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
linux-arch@...r.kernel.org, linux-s390@...r.kernel.org,
libc-alpha@...rceware.org, schwidefsky@...ibm.com,
heiko.carstens@...ibm.com, pinskia@...il.com, broonie@...nel.org,
joseph@...esourcery.com, christoph.muellner@...obroma-systems.com,
bamvor.zhangjian@...wei.com, szabolcs.nagy@....com,
klimov.linux@...il.com, Nathan_Lynch@...tor.com, agraf@...e.de,
Prasun.Kapoor@...iumnetworks.com, kilobyte@...band.pl,
geert@...ux-m68k.org, philipp.tomsich@...obroma-systems.com,
Andrew Pinski <apinski@...ium.com>,
Andrew Pinski <Andrew.Pinski@...iumnetworks.com>
Subject: Re: [PATCH 18/23] arm64: ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it
On Tuesday, May 24, 2016 3:04:47 AM CEST Yury Norov wrote:
> +static unsigned long compat_sys_mmap2(compat_uptr_t addr, compat_size_t len,
> + int prot, int flags, int fd, off_t pgoff)
> +{
> + if (pgoff & (~PAGE_MASK >> 12))
> + return -EINVAL;
> +
> + return sys_mmap_pgoff(addr, len, prot, flags, fd,
> + pgoff >> (PAGE_SHIFT - 12));
> +}
> +
> +static unsigned long compat_sys_pread64(unsigned int fd,
> + compat_uptr_t __user *ubuf, compat_size_t count, off_t offset)
> +{
> + return sys_pread64(fd, (char *) ubuf, count, offset);
> +}
> +
> +static unsigned long compat_sys_pwrite64(unsigned int fd,
> + compat_uptr_t __user *ubuf, compat_size_t count, off_t offset)
> +{
> + return sys_pwrite64(fd, (char *) ubuf, count, offset);
> +}
>
The use of compat_uptr_t seems inconsistent here, and neither of the two
ways of doing it is what we do elsewhere. compat_uptr_t is meant to
be a scalar 32-bit type that gets converted into a pointer using the
compat_ptr() macro, so compat_sys_mmap2 should not use compat_ptr_t
(we don't access it as a pointer in mmap_pgoff) but compat_ulong_t,
and compat_sys_pread64() should have a compat_uptr_t argument, not
pointer to compat_uptr_t.
Arnd
Powered by blists - more mailing lists