[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230315125256.22772-1-fmdefrancesco@gmail.com>
Date: Wed, 15 Mar 2023 13:52:56 +0100
From: "Fabio M. De Francesco" <fmdefrancesco@...il.com>
To: Luis Chamberlain <mcgrof@...nel.org>,
Jason Wessel <jason.wessel@...driver.com>,
Daniel Thompson <daniel.thompson@...aro.org>,
Douglas Anderson <dianders@...omium.org>,
Josh Poimboeuf <jpoimboe@...nel.org>,
Jiri Kosina <jikos@...nel.org>,
Miroslav Benes <mbenes@...e.cz>,
Petr Mladek <pmladek@...e.com>,
Joe Lawrence <joe.lawrence@...hat.com>,
Chris Down <chris@...isdown.name>,
Nick Terrell <terrelln@...com>,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Tom Rix <trix@...hat.com>, linux-modules@...r.kernel.org,
linux-kernel@...r.kernel.org, kgdb-bugreport@...ts.sourceforge.net,
live-patching@...r.kernel.org, bpf@...r.kernel.org,
llvm@...ts.linux.dev
Cc: "Fabio M. De Francesco" <fmdefrancesco@...il.com>,
Piotr Gorski <piotrgorski@...hyos.org>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Stephen Boyd <swboyd@...omium.org>,
Ira Weiny <ira.weiny@...el.com>
Subject: [PATCH] module/decompress: Never use kunmap() for local un-mappings
Use kunmap_local() to unmap pages locally mapped with kmap_local_page().
kunmap_local() must be called on the kernel virtual address returned by
kmap_local_page(), differently from how we use kunmap() which instead
expects the mapped page as its argument.
In module_zstd_decompress() we currently map with kmap_local_page() and
unmap with kunmap(). This breaks the code and so it should be fixed.
Cc: Piotr Gorski <piotrgorski@...hyos.org>
Cc: Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc: Luis Chamberlain <mcgrof@...nel.org>
Cc: Stephen Boyd <swboyd@...omium.org>
Cc: Ira Weiny <ira.weiny@...el.com>
Fixes: 169a58ad824d ("module/decompress: Support zstd in-kernel decompression")
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@...il.com>
---
kernel/module/decompress.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/module/decompress.c b/kernel/module/decompress.c
index bb79ac1a6d8f..7ddc87bee274 100644
--- a/kernel/module/decompress.c
+++ b/kernel/module/decompress.c
@@ -267,7 +267,7 @@ static ssize_t module_zstd_decompress(struct load_info *info,
zstd_dec.size = PAGE_SIZE;
ret = zstd_decompress_stream(dstream, &zstd_dec, &zstd_buf);
- kunmap(page);
+ kunmap_local(zstd_dec.dst);
retval = zstd_get_error_code(ret);
if (retval)
break;
--
2.39.2
Powered by blists - more mailing lists