From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: io_uring vs in_compat_syscall() Date: Mon, 20 Jul 2020 08:10:46 +0200 Message-ID: <20200720061046.GA10678@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Jens Axboe Cc: linux-arch-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, io-uring-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-arch.vger.kernel.org Hi Jens, I just found a (so far theoretical) issue with the io_uring submission offloading to workqueues or threads. We have lots of places using in_compat_syscall() to check if a syscall needs compat treatmenet. While the biggest users is iocttl(), we also have a fair amount of places using in_compat_task() in read and write methods, and these will not do the wrong thing when used with io_uring under certain conditions. I'm not sure how to best fix this, except for making sure in_compat_syscall() returns true one way or another for these cases. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from verein.lst.de ([213.95.11.211]:45446 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725805AbgGTGKt (ORCPT ); Mon, 20 Jul 2020 02:10:49 -0400 Date: Mon, 20 Jul 2020 08:10:46 +0200 From: Christoph Hellwig Subject: io_uring vs in_compat_syscall() Message-ID: <20200720061046.GA10678@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-arch-owner@vger.kernel.org List-ID: To: Jens Axboe Cc: linux-arch@vger.kernel.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, io-uring@vger.kernel.org Message-ID: <20200720061046.MXflEx-26Y1ovM7Mk1xLsAvrJJ28kX_wZSyuYnzIDuM@z> Hi Jens, I just found a (so far theoretical) issue with the io_uring submission offloading to workqueues or threads. We have lots of places using in_compat_syscall() to check if a syscall needs compat treatmenet. While the biggest users is iocttl(), we also have a fair amount of places using in_compat_task() in read and write methods, and these will not do the wrong thing when used with io_uring under certain conditions. I'm not sure how to best fix this, except for making sure in_compat_syscall() returns true one way or another for these cases.