Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2016-01-07 Thread Arnd Bergmann
On Wednesday 06 January 2016 17:10:47 Catalin Marinas wrote: > On Tue, Jan 05, 2016 at 10:12:20PM +0100, Arnd Bergmann wrote: > > On Tuesday 05 January 2016 18:26:57 Yury Norov wrote: > > > > So the calling conventions avoid the problem of being able to set > > > > the upper bits from malicious

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2016-01-07 Thread Arnd Bergmann
On Wednesday 06 January 2016 17:10:47 Catalin Marinas wrote: > On Tue, Jan 05, 2016 at 10:12:20PM +0100, Arnd Bergmann wrote: > > On Tuesday 05 January 2016 18:26:57 Yury Norov wrote: > > > > So the calling conventions avoid the problem of being able to set > > > > the upper bits from malicious

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2016-01-06 Thread Catalin Marinas
On Tue, Jan 05, 2016 at 10:12:20PM +0100, Arnd Bergmann wrote: > On Tuesday 05 January 2016 18:26:57 Yury Norov wrote: > > > So the calling conventions avoid the problem of being able to set > > > the upper bits from malicious user space when the kernel assumes they > > > are zeroed out (we had

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2016-01-06 Thread Catalin Marinas
On Tue, Jan 05, 2016 at 10:12:20PM +0100, Arnd Bergmann wrote: > On Tuesday 05 January 2016 18:26:57 Yury Norov wrote: > > > So the calling conventions avoid the problem of being able to set > > > the upper bits from malicious user space when the kernel assumes they > > > are zeroed out (we had

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2016-01-05 Thread Arnd Bergmann
On Tuesday 05 January 2016 18:26:57 Yury Norov wrote: > > So the calling conventions avoid the problem of being able to set > > the upper bits from malicious user space when the kernel assumes they > > are zeroed out (we had security bugs in this area, before we introduced > > SYSCALL_DEFINEx()),

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2016-01-05 Thread Yury Norov
On Thu, Dec 17, 2015 at 09:50:52PM +0100, Arnd Bergmann wrote: > On Thursday 17 December 2015 12:14:20 Andrew Pinski wrote: > > On Thu, Dec 17, 2015 at 12:10 PM, Arnd Bergmann wrote: > > > On Thursday 17 December 2015 18:27:53 Catalin Marinas wrote: > > >> On Wed, Dec 16, 2015 at 12:42:38AM

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2016-01-05 Thread Yury Norov
On Thu, Dec 17, 2015 at 09:50:52PM +0100, Arnd Bergmann wrote: > On Thursday 17 December 2015 12:14:20 Andrew Pinski wrote: > > On Thu, Dec 17, 2015 at 12:10 PM, Arnd Bergmann wrote: > > > On Thursday 17 December 2015 18:27:53 Catalin Marinas wrote: > > >> On Wed, Dec 16, 2015 at

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2016-01-05 Thread Arnd Bergmann
On Tuesday 05 January 2016 18:26:57 Yury Norov wrote: > > So the calling conventions avoid the problem of being able to set > > the upper bits from malicious user space when the kernel assumes they > > are zeroed out (we had security bugs in this area, before we introduced > > SYSCALL_DEFINEx()),

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2015-12-23 Thread Arnd Bergmann
On Wednesday 23 December 2015, Yury Norov wrote: > On Mon, Dec 21, 2015 at 11:31:57PM +0100, Arnd Bergmann wrote: > > On Tuesday 15 December 2015, Yury Norov wrote: > > > + > > > +#define compat_sys_open_by_handle_at sys_open_by_handle_at > > > +#define compat_sys_openat sys_openat

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2015-12-23 Thread Yury Norov
On Mon, Dec 21, 2015 at 11:31:57PM +0100, Arnd Bergmann wrote: > On Tuesday 15 December 2015, Yury Norov wrote: > > + > > +#define compat_sys_open_by_handle_at sys_open_by_handle_at > > +#define compat_sys_openat sys_openat > > + > > One more thing I just remembered: I think we

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2015-12-23 Thread Yury Norov
On Mon, Dec 21, 2015 at 11:31:57PM +0100, Arnd Bergmann wrote: > On Tuesday 15 December 2015, Yury Norov wrote: > > + > > +#define compat_sys_open_by_handle_at sys_open_by_handle_at > > +#define compat_sys_openat sys_openat > > + > > One more thing I just remembered: I think we

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2015-12-23 Thread Arnd Bergmann
On Wednesday 23 December 2015, Yury Norov wrote: > On Mon, Dec 21, 2015 at 11:31:57PM +0100, Arnd Bergmann wrote: > > On Tuesday 15 December 2015, Yury Norov wrote: > > > + > > > +#define compat_sys_open_by_handle_at sys_open_by_handle_at > > > +#define compat_sys_openat sys_openat

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2015-12-21 Thread Arnd Bergmann
On Tuesday 15 December 2015, Yury Norov wrote: > + > +#define compat_sys_open_by_handle_at sys_open_by_handle_at > +#define compat_sys_openat sys_openat > + One more thing I just remembered: I think we want this behavior for all new 32-bit architectures, it was a bug to call

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2015-12-21 Thread Arnd Bergmann
On Monday 21 December 2015, Catalin Marinas wrote: > On Fri, Dec 18, 2015 at 01:47:55PM +0100, Arnd Bergmann wrote: > > On Friday 18 December 2015 11:42:19 Catalin Marinas wrote: > > > 2. Follow the PCS up to glibc and get glibc to zero the top part (not > > >always safe with hand-written

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2015-12-21 Thread Arnd Bergmann
On Monday 21 December 2015, Dr. Philipp Tomsich wrote: > > > On 18 Dec 2015, at 13:47, Arnd Bergmann wrote: > > > >> 3. Follow the PCS up to glibc but always pass syscall arguments in W > >> registers, like AArch32 compat support (the least preferred option, > >> the only advantage is a

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2015-12-21 Thread Dr. Philipp Tomsich
> On 18 Dec 2015, at 13:47, Arnd Bergmann wrote: > >> 3. Follow the PCS up to glibc but always pass syscall arguments in W >> registers, like AArch32 compat support (the least preferred option, >> the only advantage is a single wrapper for all syscalls but it would >> be doing unnecessary

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2015-12-21 Thread Catalin Marinas
On Fri, Dec 18, 2015 at 01:47:55PM +0100, Arnd Bergmann wrote: > On Friday 18 December 2015 11:42:19 Catalin Marinas wrote: > > On Thu, Dec 17, 2015 at 12:14:20PM -0800, Andrew Pinski wrote: > > > Well (just like LP64 on AARCH64), when passing a 32bit value to a > > > function, the upper 32bits

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2015-12-21 Thread Dr. Philipp Tomsich
> On 18 Dec 2015, at 13:47, Arnd Bergmann wrote: > >> 3. Follow the PCS up to glibc but always pass syscall arguments in W >> registers, like AArch32 compat support (the least preferred option, >> the only advantage is a single wrapper for all syscalls but it would >> be

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2015-12-21 Thread Catalin Marinas
On Fri, Dec 18, 2015 at 01:47:55PM +0100, Arnd Bergmann wrote: > On Friday 18 December 2015 11:42:19 Catalin Marinas wrote: > > On Thu, Dec 17, 2015 at 12:14:20PM -0800, Andrew Pinski wrote: > > > Well (just like LP64 on AARCH64), when passing a 32bit value to a > > > function, the upper 32bits

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2015-12-21 Thread Arnd Bergmann
On Monday 21 December 2015, Dr. Philipp Tomsich wrote: > > > On 18 Dec 2015, at 13:47, Arnd Bergmann wrote: > > > >> 3. Follow the PCS up to glibc but always pass syscall arguments in W > >> registers, like AArch32 compat support (the least preferred option, > >> the only

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2015-12-21 Thread Arnd Bergmann
On Monday 21 December 2015, Catalin Marinas wrote: > On Fri, Dec 18, 2015 at 01:47:55PM +0100, Arnd Bergmann wrote: > > On Friday 18 December 2015 11:42:19 Catalin Marinas wrote: > > > 2. Follow the PCS up to glibc and get glibc to zero the top part (not > > >always safe with hand-written

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2015-12-21 Thread Arnd Bergmann
On Tuesday 15 December 2015, Yury Norov wrote: > + > +#define compat_sys_open_by_handle_at sys_open_by_handle_at > +#define compat_sys_openat sys_openat > + One more thing I just remembered: I think we want this behavior for all new 32-bit architectures, it was a bug to call

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2015-12-18 Thread Arnd Bergmann
On Friday 18 December 2015 11:42:19 Catalin Marinas wrote: > On Thu, Dec 17, 2015 at 12:14:20PM -0800, Andrew Pinski wrote: > > Well (just like LP64 on AARCH64), when passing a 32bit value to a > > function, the upper 32bits are undefined. I ran into this when I was > > debugging the GCC go

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2015-12-18 Thread Catalin Marinas
(cc'ing Marcus for more insight on the tools side) On Thu, Dec 17, 2015 at 12:14:20PM -0800, Andrew Pinski wrote: > On Thu, Dec 17, 2015 at 12:10 PM, Arnd Bergmann wrote: > > On Thursday 17 December 2015 18:27:53 Catalin Marinas wrote: > >> On Wed, Dec 16, 2015 at 12:42:38AM +0300, Yury Norov

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2015-12-18 Thread Catalin Marinas
(cc'ing Marcus for more insight on the tools side) On Thu, Dec 17, 2015 at 12:14:20PM -0800, Andrew Pinski wrote: > On Thu, Dec 17, 2015 at 12:10 PM, Arnd Bergmann wrote: > > On Thursday 17 December 2015 18:27:53 Catalin Marinas wrote: > >> On Wed, Dec 16, 2015 at 12:42:38AM

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2015-12-18 Thread Arnd Bergmann
On Friday 18 December 2015 11:42:19 Catalin Marinas wrote: > On Thu, Dec 17, 2015 at 12:14:20PM -0800, Andrew Pinski wrote: > > Well (just like LP64 on AARCH64), when passing a 32bit value to a > > function, the upper 32bits are undefined. I ran into this when I was > > debugging the GCC go

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2015-12-17 Thread Arnd Bergmann
On Thursday 17 December 2015 12:14:20 Andrew Pinski wrote: > On Thu, Dec 17, 2015 at 12:10 PM, Arnd Bergmann wrote: > > On Thursday 17 December 2015 18:27:53 Catalin Marinas wrote: > >> On Wed, Dec 16, 2015 at 12:42:38AM +0300, Yury Norov wrote: > > > >> > +#define compat_sys_lookup_dcookie

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2015-12-17 Thread Andrew Pinski
On Thu, Dec 17, 2015 at 12:10 PM, Arnd Bergmann wrote: > On Thursday 17 December 2015 18:27:53 Catalin Marinas wrote: >> On Wed, Dec 16, 2015 at 12:42:38AM +0300, Yury Norov wrote: > >> > +#define compat_sys_lookup_dcookie sys_lookup_dcookie >> > +#define compat_sys_pread64

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2015-12-17 Thread Arnd Bergmann
On Thursday 17 December 2015 18:27:53 Catalin Marinas wrote: > On Wed, Dec 16, 2015 at 12:42:38AM +0300, Yury Norov wrote: > > +#define compat_sys_lookup_dcookie sys_lookup_dcookie > > +#define compat_sys_pread64 sys_pread64 > > +#define compat_sys_pwrite64

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2015-12-17 Thread Catalin Marinas
On Wed, Dec 16, 2015 at 12:42:38AM +0300, Yury Norov wrote: > +/* Using non-compat syscalls where necessary */ > +#define compat_sys_fadvise64_64sys_fadvise64_64 > +#define compat_sys_fallocate sys_fallocate > +#define compat_sys_ftruncate64 sys_ftruncate I initially

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2015-12-17 Thread Catalin Marinas
On Wed, Dec 16, 2015 at 12:42:38AM +0300, Yury Norov wrote: > +/* Using non-compat syscalls where necessary */ > +#define compat_sys_fadvise64_64sys_fadvise64_64 > +#define compat_sys_fallocate sys_fallocate > +#define compat_sys_ftruncate64 sys_ftruncate I initially

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2015-12-17 Thread Arnd Bergmann
On Thursday 17 December 2015 18:27:53 Catalin Marinas wrote: > On Wed, Dec 16, 2015 at 12:42:38AM +0300, Yury Norov wrote: > > +#define compat_sys_lookup_dcookie sys_lookup_dcookie > > +#define compat_sys_pread64 sys_pread64 > > +#define compat_sys_pwrite64

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2015-12-17 Thread Arnd Bergmann
On Thursday 17 December 2015 12:14:20 Andrew Pinski wrote: > On Thu, Dec 17, 2015 at 12:10 PM, Arnd Bergmann wrote: > > On Thursday 17 December 2015 18:27:53 Catalin Marinas wrote: > >> On Wed, Dec 16, 2015 at 12:42:38AM +0300, Yury Norov wrote: > > > >> > +#define

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2015-12-17 Thread Andrew Pinski
On Thu, Dec 17, 2015 at 12:10 PM, Arnd Bergmann wrote: > On Thursday 17 December 2015 18:27:53 Catalin Marinas wrote: >> On Wed, Dec 16, 2015 at 12:42:38AM +0300, Yury Norov wrote: > >> > +#define compat_sys_lookup_dcookie sys_lookup_dcookie >> > +#define compat_sys_pread64

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2015-12-16 Thread Arnd Bergmann
On Wednesday 16 December 2015 00:42:38 Yury Norov wrote: > +/* Using non-compat syscalls where necessary */ > +#define compat_sys_fadvise64_64sys_fadvise64_64 > +#define compat_sys_fallocate sys_fallocate > +#define compat_sys_ftruncate64 sys_ftruncate > +#define

Re: [PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2015-12-16 Thread Arnd Bergmann
On Wednesday 16 December 2015 00:42:38 Yury Norov wrote: > +/* Using non-compat syscalls where necessary */ > +#define compat_sys_fadvise64_64sys_fadvise64_64 > +#define compat_sys_fallocate sys_fallocate > +#define compat_sys_ftruncate64 sys_ftruncate > +#define

[PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2015-12-15 Thread Yury Norov
From: Andrew Pinski Add a separate syscall-table for ILP32, which dispatches either to native LP64 system call implementation or to compat-syscalls, as appropriate. Reviewed-by: David Daney Signed-off-by: Philipp Tomsich Signed-off-by: Christoph Muellner Signed-off-by: Yury Norov

[PATCH v6 12/20] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

2015-12-15 Thread Yury Norov
From: Andrew Pinski Add a separate syscall-table for ILP32, which dispatches either to native LP64 system call implementation or to compat-syscalls, as appropriate. Reviewed-by: David Daney Signed-off-by: Philipp Tomsich