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:	Thu, 05 Nov 2015 14:50:10 +0100
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, pinskia@...il.com,
	ddaney.cavm@...il.com, jan.dakinevich@...il.com,
	Prasun.Kapoor@...iumnetworks.com,
	christoph.muellner@...obroma-systems.com,
	philipp.tomsich@...obroma-systems.com, broonie@...nel.org,
	andrey.konovalov@...aro.org, Nathan_Lynch@...tor.com,
	agraf@...e.de, bamvor.zhangjian@...wei.com, klimov.linux@...il.com,
	Andrew Pinski <apinski@...ium.com>,
	Andrew Pinski <Andrew.Pinski@...iumnetworks.com>
Subject: Re: [PATCH v6 13/17] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

On Tuesday 03 November 2015 02:30:42 Yury Norov wrote:
> From: Andrew Pinski <apinski@...ium.com>
> 
> Add a separate syscall-table for ILP32, which dispatches either to native
> LP64 system call implementation or to compat-syscalls, as appropriate.

The uapi/asm-generic/unistd.h already contains a list of compat syscalls
that should work by default, I think it would be better to use that
list and override only the ones that differ between normal compat
mode and the new mode, e.g. when you require a wrapper or want to
use the native syscall entry.

> +/* We need to make sure the pointer gets copied correctly. */
> +asmlinkage long ilp32_sys_mq_notify(mqd_t mqdes, const struct sigevent __user *u_notification)
> +{
> +	struct sigevent __user *p = NULL;
> +	if (u_notification) {
> +		struct sigevent n;
> +		p = compat_alloc_user_space(sizeof(*p));
> +		if (copy_from_user(&n, u_notification, sizeof(*p)))
> +			return -EFAULT;
> +		if (n.sigev_notify == SIGEV_THREAD)
> +			n.sigev_value.sival_ptr = compat_ptr((uintptr_t)n.sigev_value.sival_ptr);
> +		if (copy_to_user(p, &n, sizeof(*p)))
> +			return -EFAULT;
> +	}
> +	return sys_mq_notify(mqdes, p);
> +}

Could this be avoided by defining sigval_t in a way that is
compatible?

> +/* sigevent contains sigval_t which is now 64bit always
> +   but need special handling due to padding for SIGEV_THREAD.  */
> +#define sys_mq_notify		ilp32_sys_mq_notify
> +
> +/* sigaltstack needs some special handling as the
> +   padding for stack_t might not be non-zero. */
> +long ilp32_sys_sigaltstack(const stack_t __user *uss_ptr,
> +			   stack_t __user *uoss_ptr)

asmlinkage?

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ