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:   Sat, 19 Sep 2020 06:32:33 +0100
From:   Christoph Hellwig <hch@...radead.org>
To:     Arnd Bergmann <arnd@...db.de>
Cc:     Christoph Hellwig <hch@...radead.org>,
        Russell King <linux@...linux.org.uk>,
        Alexander Viro <viro@...iv.linux.org.uk>,
        linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-arch@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH v2 5/9] ARM: oabi-compat: rework epoll_wait/epoll_pwait
 emulation

> index 855aa7cc9b8e..156880943c16 100644
> --- a/arch/arm/include/asm/syscall.h
> +++ b/arch/arm/include/asm/syscall.h
> @@ -28,6 +28,17 @@ static inline int syscall_get_nr(struct task_struct *task,
>  	return task_thread_info(task)->syscall & ~__NR_OABI_SYSCALL_BASE;
>  }
>  
> +static inline bool __in_oabi_syscall(struct task_struct *task)
> +{
> +	return IS_ENABLED(CONFIG_OABI_COMPAT) &&
> +		(task_thread_info(task)->syscall & __NR_OABI_SYSCALL_BASE);
> +}
> +
> +static inline bool in_oabi_syscall(void)
> +{
> +	return __in_oabi_syscall(current);
> +}
> +

Maybe split these infrastructure additions into a separate helper?

> +#if !defined(CONFIG_ARM) || !defined(CONFIG_OABI_COMPAT)
> +/* ARM OABI has an incompatible struct layout and needs a special handler */
> +static inline struct epoll_event __user *
> +epoll_put_uevent(__poll_t revents, __u64 data,
> +		 struct epoll_event __user *uevent)
> +{
> +	if (__put_user(revents, &uevent->events) ||
> +	    __put_user(data, &uevent->data))
> +		return NULL;
> +
> +	return uevent+1;
> +}
> +#else
> +struct epoll_event __user *
> +epoll_put_uevent(__poll_t revents, __u64 data,
> +		 struct epoll_event __user *uevent);
> +#endif

So after you argued for this variant I still have minor nitpicks:

I alway find positive ifdefs better where possible, e.g.

#if defined(CONFIG_ARM) && defined(CONFIG_OABI_COMPAT)
external declaration here
#else
the real thing
#endif

but I still find the fact that the native case goes into the arch
helper a little weird.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ