[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250225142518.cec35a0ea77a0d86f3e860c3@linux-foundation.org>
Date: Tue, 25 Feb 2025 14:25:18 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Nhat Pham <nphamcs@...il.com>
Cc: hannes@...xchg.org, yosryahmed@...gle.com, chengming.zhou@...ux.dev,
linux-mm@...ck.org, kernel-team@...a.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] zswap: do not crash the kernel on decompression failure
On Tue, 25 Feb 2025 13:32:00 -0800 Nhat Pham <nphamcs@...il.com> wrote:
> @@ -984,12 +987,19 @@ static void zswap_decompress(struct zswap_entry *entry, struct folio *folio)
> sg_init_table(&output, 1);
> sg_set_folio(&output, folio, PAGE_SIZE, 0);
> acomp_request_set_params(acomp_ctx->req, &input, &output, entry->length, PAGE_SIZE);
> - BUG_ON(crypto_wait_req(crypto_acomp_decompress(acomp_ctx->req), &acomp_ctx->wait));
> - BUG_ON(acomp_ctx->req->dlen != PAGE_SIZE);
> + if (crypto_wait_req(crypto_acomp_decompress(acomp_ctx->req), &acomp_ctx->wait) ||
> + acomp_ctx->req->dlen != PAGE_SIZE) {
> + ret = false;
> + zswap_reject_decompress_fail++;
> + pr_alert_ratelimited(
> + "decompression failed on zswap entry with offset %08lx\n",
> + entry->swpentry.val);
> + }
> mutex_unlock(&acomp_ctx->mutex);
This mutex_unlock() isn't present in current kernels. I'd normally just fix
the reject but a change in the locking environment needs some careful
checking and retesting, please.
Powered by blists - more mailing lists