[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8d532de2-bf3a-dee4-1cad-e11714e914d0@kernel.dk>
Date: Tue, 21 Mar 2023 13:16:08 -0600
From: Jens Axboe <axboe@...nel.dk>
To: Linus Torvalds <torvalds@...ux-foundation.org>,
David Howells <dhowells@...hat.com>
Cc: Jarkko Sakkinen <jarkko@...nel.org>,
Bharath SM <bharathsm@...rosoft.com>,
Shyam Prasad N <nspmangalore@...il.com>,
Steve French <smfrench@...il.com>,
Robbie Harwood <rharwood@...hat.com>,
Eric Biederman <ebiederm@...ssion.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
keyrings@...r.kernel.org, linux-cifs@...r.kernel.org,
linux-crypto@...r.kernel.org, kexec@...ts.infradead.org,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [GIT PULL] keys: Miscellaneous fixes/changes
On 3/21/23 12:48?PM, Linus Torvalds wrote:
> On Tue, Mar 21, 2023 at 9:43?AM David Howells <dhowells@...hat.com> wrote:
>>
>> (1) Fix request_key() so that it doesn't cache a looked up key on the
>> current thread if that thread is a kernel thread. The cache is
>> cleared during notify_resume - but that doesn't happen in kernel
>> threads. This is causing cifs DNS keys to be un-invalidateable.
>
> I've pulled this, but I'd like people to look a bit more at this.
>
> The issue with TIF_NOTIFY_RESUME is that it is only done on return to
> user space.
>
> And these days, PF_KTHREAD isn't the only case that never returns to
> user space. PF_IO_WORKER has the exact same behaviour.
>
> Now, to counteract this, as of this merge window (and marked for
> stable) IO threads do a fake "return to user mode" handling in
> io_run_task_work(), and so I think we're all good, but I'd like people
> to at least think about this.
I haven't seen the patch yet as it hasn't been pushed, but can imagine
what it looks like. It may make sense to add some debug check for
PF_KTHREAD having TIF_NOTIFY_RESUME set, or task_work pending for that
matter, as that is generally not workable without doing something to
handle it explicitly.
For PF_IO_WORKER, with the commit you mentioned, those threads should
deal with TIF_NOTIFY_RESUME just fine. Until something else gets added
that is also run from exit_to_user_mode...
--
Jens Axboe
Powered by blists - more mailing lists