[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y+KoGikLhfhDoMWv@gmail.com>
Date: Tue, 7 Feb 2023 19:35:54 +0000
From: Eric Biggers <ebiggers@...nel.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Dan Carpenter <error27@...il.com>, linux-block@...r.kernel.org,
Julia Lawall <julia.lawall@...ia.fr>,
Luis Chamberlain <mcgrof@...nel.org>,
Hongchen Zhang <zhanghongchen@...ngson.cn>,
Alexander Viro <viro@...iv.linux.org.uk>,
Andrew Morton <akpm@...ux-foundation.org>,
"Christian Brauner (Microsoft)" <brauner@...nel.org>,
David Howells <dhowells@...hat.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Eric Dumazet <edumazet@...gle.com>,
"Fabio M. De Francesco" <fmdefrancesco@...il.com>,
Christophe JAILLET <christophe.jaillet@...adoo.fr>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
maobibo <maobibo@...ngson.cn>,
Matthew Wilcox <willy@...radead.org>,
Sedat Dilek <sedat.dilek@...il.com>
Subject: Re: block: sleeping in atomic warnings
On Tue, Feb 07, 2023 at 10:57:08AM -0800, Linus Torvalds wrote:
> On Tue, Feb 7, 2023 at 10:36 AM Eric Biggers <ebiggers@...nel.org> wrote:
> >
> > Also note that keys are normally added using an ioctl, which can only be
> > executed after the filesystem was mounted. The only exception is the key
> > associated with the "test_dummy_encryption" mount option.
>
> Could we perhaps then replace the
>
> fscrypt_destroy_keyring(s);
>
> with a more specific
>
> fscrypt_destroy_dummy_keyring(s);
>
> thing, that would only handle the dummy encryption case?
Sure, they would still need to do most of the same things though.
> Or could we just *fix* the dummy encryption test to actually work like
> real encryption cases, so that it doesn't have this bogus case?
We've wanted to do that for a very long time, but there never has been a way to
actually do it. Especially with the filesystem-level keyring now, if the kernel
doesn't automatically add the key for test_dummy_encryption, then userspace
would have to do it *every time it mounts the filesystem*.
The point of the "test_dummy_encryption" mount option is that you can just add
it to the mount options and run existing tests, such as a full run of xfstests,
and test all the encrypted I/O paths that way. Which is extremely useful; it
wouldn't really be possible to properly test the encryption feature without it.
So that's why we've gone through some pain to keep "test_dummy_encryption"
working over time.
Now, it's possible that "the kernel automatically adds the key for
test_dummy_encryption" could be implemented a bit differently. It maybe could
be done at the last minute, when the key is being looked for due to a user
filesystem operation, instead of during the mount itself. That would eliminate
the need to call fscrypt_destroy_keyring() from __put_super(), which would avoid
the issue being discussed here. I'll see if there's a good way to do that.
- Eric
Powered by blists - more mailing lists