This is a note to let you know that I've just added the patch titled ASoC: codecs: wcd938x-sdw: fix use after free on driver unbind to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: asoc-codecs-wcd938x-sdw-fix-use-after-free-on-driver-unbind.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From f0dfdcbe706462495d47982eecd13a61aabd644d Mon Sep 17 00:00:00 2001 From: Johan Hovold <johan+linaro@xxxxxxxxxx> Date: Tue, 3 Oct 2023 17:55:57 +0200 Subject: ASoC: codecs: wcd938x-sdw: fix use after free on driver unbind From: Johan Hovold <johan+linaro@xxxxxxxxxx> commit f0dfdcbe706462495d47982eecd13a61aabd644d upstream. Make sure to deregister the component when the driver is being unbound and before the underlying device-managed resources are freed. Fixes: 16572522aece ("ASoC: codecs: wcd938x-sdw: add SoundWire driver") Cc: stable@xxxxxxxxxxxxxxx # 5.14 Cc: Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxx> Signed-off-by: Johan Hovold <johan+linaro@xxxxxxxxxx> Link: https://lore.kernel.org/r/20231003155558.27079-7-johan+linaro@xxxxxxxxxx Signed-off-by: Mark Brown <broonie@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- sound/soc/codecs/wcd938x-sdw.c | 10 ++++++++++ 1 file changed, 10 insertions(+) --- a/sound/soc/codecs/wcd938x-sdw.c +++ b/sound/soc/codecs/wcd938x-sdw.c @@ -269,6 +269,15 @@ static int wcd9380_probe(struct sdw_slav return component_add(dev, &wcd938x_sdw_component_ops); } +static int wcd9380_remove(struct sdw_slave *pdev) +{ + struct device *dev = &pdev->dev; + + component_del(dev, &wcd938x_sdw_component_ops); + + return 0; +} + static const struct sdw_device_id wcd9380_slave_id[] = { SDW_SLAVE_ENTRY(0x0217, 0x10d, 0), {}, @@ -307,6 +316,7 @@ static const struct dev_pm_ops wcd938x_s static struct sdw_driver wcd9380_codec_driver = { .probe = wcd9380_probe, + .remove = wcd9380_remove, .ops = &wcd9380_slave_ops, .id_table = wcd9380_slave_id, .driver = { Patches currently in stable-queue which might be from johan+linaro@xxxxxxxxxx are queue-5.15/asoc-codecs-wcd938x-fix-unbind-tear-down-order.patch queue-5.15/asoc-codecs-wcd938x-sdw-fix-use-after-free-on-driver-unbind.patch queue-5.15/asoc-codecs-wcd938x-drop-bogus-bind-error-handling.patch queue-5.15/asoc-codecs-wcd938x-sdw-fix-runtime-pm-imbalance-on-probe-errors.patch queue-5.15/regmap-fix-null-deref-on-lookup.patch