summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorFabio M. De Francesco <fmdefrancesco@gmail.com>2023-03-15 13:52:56 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-05-11 23:17:24 +0900
commite3c4de959c9c5d663a12a4d0fd336f757c3739d7 (patch)
treededd7e0af0de871918341164afcbe025d02e70ac /kernel
parentbdeb51863f9d18b85afeb75da439105154e1184a (diff)
downloadlinux-stable-e3c4de959c9c5d663a12a4d0fd336f757c3739d7.tar.gz
linux-stable-e3c4de959c9c5d663a12a4d0fd336f757c3739d7.tar.bz2
linux-stable-e3c4de959c9c5d663a12a4d0fd336f757c3739d7.zip
module/decompress: Never use kunmap() for local un-mappings
[ Upstream commit 3c17655ab13704582fe25e8ea3200a9b2f8bf20a ] 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> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Reviewed-by: Piotr Gorski <piotrgorski@cachyos.org> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/module/decompress.c2
1 files changed, 1 insertions, 1 deletions
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;