]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mips: cdmm: fix use-after-free in mips_cdmm_bus_discover
authorQinglang Miao <miaoqinglang@huawei.com>
Fri, 20 Nov 2020 07:48:47 +0000 (15:48 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:25:57 +0000 (11:25 +0100)
commit84f341fa31faf4233a283d46fe4f6dc9b3026539
tree06b002319d77c8e39ea243db6bd71012f388c3a8
parent5f73062a69ecd13eb1940c990958123e9e186309
mips: cdmm: fix use-after-free in mips_cdmm_bus_discover

[ Upstream commit f0e82242b16826077a2775eacfe201d803bb7a22 ]

kfree(dev) has been called inside put_device so anther
kfree would cause a use-after-free bug/

Fixes: 8286ae03308c ("MIPS: Add CDMM bus support")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
Acked-by: Serge Semin <fancer.lancer@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/bus/mips_cdmm.c