[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20221205180842.014cd7e9@kernel.org>
Date: Mon, 5 Dec 2022 18:08:42 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Nir Levy <bhr166@...il.com>
Cc: Leon Romanovsky <leon@...nel.org>, davem@...emloft.net,
edumazet@...gle.com, pabeni@...hat.com,
linux-atm-general@...ts.sourceforge.net, netdev@...r.kernel.org
Subject: Re: [PATCH] atm: Fix use-after-free bug in atm_dev_register()
On Tue, 6 Dec 2022 00:08:32 +0200 Nir Levy wrote:
> From 5cb38a02b10a2f52bf7f7eef67fa4abc0974b21b Mon Sep 17 00:00:00 2001
> From: Nir Levy <bhr166@...il.com>
> Date: Fri, 25 Nov 2022 21:06:48 +0200
> Subject: [PATCH net] net: atm: Fix use-after-free bug in atm_dev_register()
>
> When device_register() return failed in atm_register_sysfs,
> the program will return to atm_dev_register and will kfree
> the device. As the comment of device_register() says,
> put_device() needs to be used to give up the reference
> in the error path. Using kfree instead triggers a UAF,
> as shown by the following KASAN report, obtained by causing
> device_register() to fail. This patch calls put_device
> when atm_register_sysfs has failed, and call kfree
> only when atm_proc_dev_register has failed.
Please make a fresh submission, it doesn't have to be in the same
thread (in fact that's discouraged).
Powered by blists - more mailing lists