[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZGvc6tMIlvcp8zvt@bombadil.infradead.org>
Date: Mon, 22 May 2023 14:21:46 -0700
From: Luis Chamberlain <mcgrof@...nel.org>
To: Harshit Mogalapalli <harshit.m.mogalapalli@...cle.com>
Cc: linux-modules@...r.kernel.org, linux-kernel@...r.kernel.org,
error27@...il.com, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] module: Fix use-after-free bug in read_file_mod_stats()
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@...cle.com>
> ---
Queued up, thanks!
Luis
Powered by blists - more mailing lists