[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200918134012.GY3421308@ZenIV.linux.org.uk>
Date: Fri, 18 Sep 2020 14:40:12 +0100
From: Al Viro <viro@...iv.linux.org.uk>
To: Christoph Hellwig <hch@....de>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Jens Axboe <axboe@...nel.dk>, Arnd Bergmann <arnd@...db.de>,
David Howells <dhowells@...hat.com>,
linux-arm-kernel@...ts.infradead.org, x86@...nel.org,
linux-kernel@...r.kernel.org, linux-mips@...r.kernel.org,
linux-parisc@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
linux-s390@...r.kernel.org, sparclinux@...r.kernel.org,
linux-block@...r.kernel.org, linux-scsi@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-aio@...ck.org,
io-uring@...r.kernel.org, linux-arch@...r.kernel.org,
linux-mm@...ck.org, netdev@...r.kernel.org,
keyrings@...r.kernel.org, linux-security-module@...r.kernel.org
Subject: Re: [PATCH 1/9] kernel: add a PF_FORCE_COMPAT flag
On Fri, Sep 18, 2020 at 02:45:25PM +0200, Christoph Hellwig wrote:
> Add a flag to force processing a syscall as a compat syscall. This is
> required so that in_compat_syscall() works for I/O submitted by io_uring
> helper threads on behalf of compat syscalls.
>
> Signed-off-by: Christoph Hellwig <hch@....de>
> ---
> arch/sparc/include/asm/compat.h | 3 ++-
> arch/x86/include/asm/compat.h | 2 +-
> fs/io_uring.c | 9 +++++++++
> include/linux/compat.h | 5 ++++-
> include/linux/sched.h | 1 +
> 5 files changed, 17 insertions(+), 3 deletions(-)
>
> diff --git a/arch/sparc/include/asm/compat.h b/arch/sparc/include/asm/compat.h
> index 40a267b3bd5208..fee6c51d36e869 100644
> --- a/arch/sparc/include/asm/compat.h
> +++ b/arch/sparc/include/asm/compat.h
> @@ -211,7 +211,8 @@ static inline int is_compat_task(void)
> static inline bool in_compat_syscall(void)
> {
> /* Vector 0x110 is LINUX_32BIT_SYSCALL_TRAP */
> - return pt_regs_trap_type(current_pt_regs()) == 0x110;
> + return pt_regs_trap_type(current_pt_regs()) == 0x110 ||
> + (current->flags & PF_FORCE_COMPAT);
Can't say I like that approach ;-/ Reasoning about the behaviour is much
harder when it's controlled like that - witness set_fs() shite...
Powered by blists - more mailing lists