public inbox for live-patching@vger.kernel.org
 help / color / mirror / Atom feed
From: Piotr Gorski <piotrgorski@cachyos.org>
To: linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org,
	kgdb-bugreport@lists.sourceforge.net,
	live-patching@vger.kernel.org, bpf@vger.kernel.org,
	llvm@lists.linux.dev
Subject: Re: [PATCH] module/decompress: Never use kunmap() for local un-mappings
Date: Tue, 21 Mar 2023 09:33:00 +0100	[thread overview]
Message-ID: <c0217d44-b13b-7126-8291-b2e9ee8c4db2@cachyos.org> (raw)
In-Reply-To: <20230315125256.22772-1-fmdefrancesco@gmail.com>

Reviewed-by: Piotr Gorski <piotrgorski@cachyos.org>

W dniu 15.03.2023 o 13:52, Fabio M. De Francesco pisze:
> 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;

  parent reply	other threads:[~2023-03-21  8:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2023-03-22 23:24 ` Luis Chamberlain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c0217d44-b13b-7126-8291-b2e9ee8c4db2@cachyos.org \
    --to=piotrgorski@cachyos.org \
    --cc=bpf@vger.kernel.org \
    --cc=kgdb-bugreport@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox