This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 01/23] all: syscall wrappers: add documentation
- From: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- To: Catalin Marinas <catalin dot marinas at arm dot com>, David Miller <davem at davemloft dot net>
- Cc: <nd at arm dot com>, <arnd at arndb dot de>, <ynorov at caviumnetworks dot com>, <linux-arm-kernel at lists dot infradead dot org>, <linux-kernel at vger dot kernel dot org>, <linux-doc at vger dot kernel dot org>, <linux-arch at vger dot kernel dot org>, <linux-s390 at vger dot kernel dot org>, <libc-alpha at sourceware dot org>, <schwidefsky at de dot ibm dot com>, <heiko dot carstens at de dot ibm dot com>, <pinskia at gmail dot com>, <broonie at kernel dot org>, <joseph at codesourcery dot com>, <christoph dot muellner at theobroma-systems dot com>, <bamvor dot zhangjian at huawei dot com>, <klimov dot linux at gmail dot com>, <Nathan_Lynch at mentor dot com>, <agraf at suse dot de>, <Prasun dot Kapoor at caviumnetworks dot com>, <kilobyte at angband dot pl>, <geert at linux-m68k dot org>, <philipp dot tomsich at theobroma-systems dot com>
- Date: Thu, 26 May 2016 15:50:01 +0100
- Subject: Re: [PATCH 01/23] all: syscall wrappers: add documentation
- Authentication-results: sourceware.org; auth=none
- Nodisclaimer: True
- References: <6293194 dot tGy03QJ9ME at wuerfel> <20160525 dot 135039 dot 244098606649448826 dot davem at davemloft dot net> <6407614 dot fdv5XFSBue at wuerfel> <20160525 dot 142821 dot 1719403997976778673 dot davem at davemloft dot net> <20160526142057 dot GA7456 at e104818-lin dot cambridge dot arm dot com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:23
On 26/05/16 15:20, Catalin Marinas wrote:
> While writing the above, I realised the current ILP32 patches still miss
> on converting pointers passed from user space (unless I got myself
> confused in macros). The new __SC_WRAP() and COMPAT_SYSCALL_WRAPx()
> macros take care of zero or sign extension via __SC_COMPAT_CAST().
> However, we have two more existing cases which I don't see covered:
>
> a) Native syscalls taking a pointer argument and invoked directly from
> ILP32. For example, sys_read() takes a pointer but I don't see any
> __SC_WRAP added by patch 5
>
> b) Current compat syscalls taking a pointer argument. For example,
> compat_sys_vmsplice() gets the iov32 pointer and the compiler assumes
> it is a 64-bit variable. I don't see where the upper half is zeroed
>
on x32 sign/zero extension is currently left to userspace,
which is difficult to deal with, (long long)arg does the
wrong thing for pointer args.
> We can solve (a) by adding more __SC_WRAP annotations in the generic
> unistd.h. For (b), we would need an __SC_DELOUSE with a bit of penalty
> on AArch32/compat support where it isn't needed. So maybe davem has a
> point on the overall impact of always zeroing the upper half of the
> arguments ;) (both from a performance and maintainability perspective).
> I guess this part of the ABI is still up for discussion.
>