[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <64120b7f2e123_2513fa294a7@iweiny-mobl.notmuch>
Date: Wed, 15 Mar 2023 11:16:31 -0700
From: Ira Weiny <ira.weiny@...el.com>
To: "Fabio M. De Francesco" <fmdefrancesco@...il.com>,
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: Re: [PATCH] module/decompress: Never use kunmap() for local
un-mappings
Fabio M. De Francesco wrote:
> 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>
Reviewed-by: 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