Linux-Modules Archive mirror
 help / color / mirror / Atom feed
From: Luis Chamberlain <mcgrof@kernel.org>
To: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Cc: linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org,
	error27@gmail.com, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] module: Fix use-after-free bug in read_file_mod_stats()
Date: Mon, 22 May 2023 14:21:46 -0700	[thread overview]
Message-ID: <ZGvc6tMIlvcp8zvt@bombadil.infradead.org> (raw)
In-Reply-To: <20230428055933.2699308-1-harshit.m.mogalapalli@oracle.com>

On Thu, Apr 27, 2023 at 10:59:33PM -0700, Harshit Mogalapalli wrote:
> Smatch warns:
> 	kernel/module/stats.c:394 read_file_mod_stats()
> 	warn: passing freed memory 'buf'
> 
> We are passing 'buf' to simple_read_from_buffer() after freeing it.
> 
> Fix this by changing the order of 'simple_read_from_buffer' and 'kfree'.
> 
> Fixes: df3e764d8e5c ("module: add debug stats to help identify memory pressure")
> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
> ---

Queued up, thanks!

  Luis

      parent reply	other threads:[~2023-05-22 21:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-28  5:59 [PATCH] module: Fix use-after-free bug in read_file_mod_stats() Harshit Mogalapalli
2023-05-17  6:33 ` Harshit Mogalapalli
2023-05-22 21:21 ` Luis Chamberlain [this message]

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=ZGvc6tMIlvcp8zvt@bombadil.infradead.org \
    --to=mcgrof@kernel.org \
    --cc=error27@gmail.com \
    --cc=harshit.m.mogalapalli@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).