live-patching.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] module/decompress: Never use kunmap() for local un-mappings
@ 2023-03-15 12:52 Fabio M. De Francesco
  2023-03-15 18:16 ` Ira Weiny
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Fabio M. De Francesco @ 2023-03-15 12:52 UTC (permalink / raw)
  To: Luis Chamberlain, Jason Wessel, Daniel Thompson,
	Douglas Anderson, Josh Poimboeuf, Jiri Kosina, Miroslav Benes,
	Petr Mladek, Joe Lawrence, Chris Down, Nick Terrell,
	Nathan Chancellor, Nick Desaulniers, Tom Rix, linux-modules,
	linux-kernel, kgdb-bugreport, live-patching, bpf, llvm
  Cc: Fabio M. De Francesco, Piotr Gorski, Dmitry Torokhov,
	Stephen Boyd, Ira Weiny

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@cachyos.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Luis Chamberlain <mcgrof@kernel.org>
Cc: Stephen Boyd <swboyd@chromium.org>
Cc: Ira Weiny <ira.weiny@intel.com>
Fixes: 169a58ad824d ("module/decompress: Support zstd in-kernel decompression")
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-03-22 23:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-15 12:52 [PATCH] module/decompress: Never use kunmap() for local un-mappings Fabio M. De Francesco
2023-03-15 18:16 ` Ira Weiny
2023-03-17 19:04 ` Stephen Boyd
2023-03-21  8:23 ` Piotr Gorski
2023-03-21  8:33 ` Piotr Gorski
2023-03-22 23:24 ` Luis Chamberlain

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).