* [PATCH] fscrypt: remove WARN_ON_ONCE() when decryption fails
@ 2019-03-15 21:16 Eric Biggers
2019-04-16 22:45 ` Theodore Ts'o
0 siblings, 1 reply; 2+ messages in thread
From: Eric Biggers @ 2019-03-15 21:16 UTC (permalink / raw)
To: linux-fscrypt
From: Eric Biggers <ebiggers@google.com>
If decrypting a block fails, fscrypt did a WARN_ON_ONCE(). But WARN is
meant for kernel bugs, which this isn't; this could be hit by fuzzers
using fault injection, for example. Also, there is already a proper
warning message logged in fscrypt_do_page_crypto(), so the WARN doesn't
add much.
Just remove the unnessary WARN.
Signed-off-by: Eric Biggers <ebiggers@google.com>
---
fs/crypto/bio.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/fs/crypto/bio.c b/fs/crypto/bio.c
index 5759bcd018cd..d7ad74818b2b 100644
--- a/fs/crypto/bio.c
+++ b/fs/crypto/bio.c
@@ -37,12 +37,10 @@ static void __fscrypt_decrypt_bio(struct bio *bio, bool done)
int ret = fscrypt_decrypt_page(page->mapping->host, page,
PAGE_SIZE, 0, page->index);
- if (ret) {
- WARN_ON_ONCE(1);
+ if (ret)
SetPageError(page);
- } else if (done) {
+ else if (done)
SetPageUptodate(page);
- }
if (done)
unlock_page(page);
}
--
2.21.0.360.g471c308f928-goog
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] fscrypt: remove WARN_ON_ONCE() when decryption fails
2019-03-15 21:16 [PATCH] fscrypt: remove WARN_ON_ONCE() when decryption fails Eric Biggers
@ 2019-04-16 22:45 ` Theodore Ts'o
0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2019-04-16 22:45 UTC (permalink / raw)
To: Eric Biggers; +Cc: linux-fscrypt
On Fri, Mar 15, 2019 at 02:16:32PM -0700, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
>
> If decrypting a block fails, fscrypt did a WARN_ON_ONCE(). But WARN is
> meant for kernel bugs, which this isn't; this could be hit by fuzzers
> using fault injection, for example. Also, there is already a proper
> warning message logged in fscrypt_do_page_crypto(), so the WARN doesn't
> add much.
>
> Just remove the unnessary WARN.
>
> Signed-off-by: Eric Biggers <ebiggers@google.com>
Looks good, applied.
- Ted
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-04-16 22:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-15 21:16 [PATCH] fscrypt: remove WARN_ON_ONCE() when decryption fails Eric Biggers
2019-04-16 22:45 ` Theodore Ts'o
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).