In fsl_mc_bus_remove(), mc->root_mc_bus_dev->mc_io is passed to
fsl_destroy_mc_io(). However, mc->root_mc_bus_dev is already freed in
fsl_mc_device_remove(). Then reference to mc->root_mc_bus_dev->mc_io
triggers KASAN use-after-free. To avoid the use-after-free, keep the
reference to mc->root_mc_bus_dev->mc_io in a local variable and pass to
fsl_destroy_mc_io().
This patch needs rework to apply to kernels older than v5.15.
Fixes: f93627146f0e ("staging: fsl-mc: fix asymmetry in destroy of mc_io")
Cc: stable@vger.kernel.org # v5.15+
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Link: https://lore.kernel.org/r/20220601105159.87752-1-shinichiro.kawasaki@wdc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||
|---|---|---|
| .. | ||
| fsl-mc | ||
| mhi | ||
| arm-cci.c | ||
| arm-integrator-lm.c | ||
| brcmstb_gisb.c | ||
| bt1-apb.c | ||
| bt1-axi.c | ||
| da8xx-mstpri.c | ||
| hisi_lpc.c | ||
| imx-weim.c | ||
| intel-ixp4xx-eb.c | ||
| Kconfig | ||
| Makefile | ||
| mips_cdmm.c | ||
| moxtet.c | ||
| mvebu-mbus.c | ||
| omap_l3_noc.c | ||
| omap_l3_noc.h | ||
| omap_l3_smx.c | ||
| omap_l3_smx.h | ||
| omap-ocp2scp.c | ||
| qcom-ebi2.c | ||
| qcom-ssc-block-bus.c | ||
| simple-pm-bus.c | ||
| sun50i-de2.c | ||
| sunxi-rsb.c | ||
| tegra-aconnect.c | ||
| tegra-gmi.c | ||
| ti-pwmss.c | ||
| ti-sysc.c | ||
| ts-nbus.c | ||
| uniphier-system-bus.c | ||
| vexpress-config.c | ||