[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b754dad5-ee85-8a2f-f41a-8bdc56de42e8@kernel.dk>
Date: Mon, 20 Jul 2020 11:02:19 -0600
From: Jens Axboe <axboe@...nel.dk>
To: Andy Lutomirski <luto@...capital.net>
Cc: Christoph Hellwig <hch@....de>, linux-arch@...r.kernel.org,
linux-api@...r.kernel.org, linux-kernel@...r.kernel.org,
io-uring@...r.kernel.org
Subject: Re: io_uring vs in_compat_syscall()
On 7/20/20 10:58 AM, Andy Lutomirski wrote:
>
>> On Jul 20, 2020, at 9:37 AM, Jens Axboe <axboe@...nel.dk> wrote:
>>
>> On 7/20/20 12:10 AM, Christoph Hellwig wrote:
>>> 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.
>>
>> We can probably propagate this information in the io_kiocb via a flag,
>> and have the io-wq worker set TS_COMPAT if that's the case.
>>
>
> Is TS_COMPAT actually a cross-arch concept for which this is safe?
> Having a real arch helper for “set the current syscall arch for the
> current kernel thread” seems more sensible to me.
Sure, I'd consider that implementation detail for the actual patch(es)
for this issue.
--
Jens Axboe
Powered by blists - more mailing lists