]> git.baikalelectronics.ru Git - kernel.git/commit
Revert "usb: dwc3: dwc3-qcom: Enable tx-fifo-resize property by default"
authorDouglas Anderson <dianders@chromium.org>
Tue, 7 Dec 2021 17:43:41 +0000 (09:43 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Dec 2021 19:03:09 +0000 (20:03 +0100)
commit28f1f5e476d165f2922134925d93cf5d63baa37c
treecc8510c6814c70285c180c17b9a9d12b0c193232
parenta2200a1a728925ec7975c22ebe5470181f223449
Revert "usb: dwc3: dwc3-qcom: Enable tx-fifo-resize property by default"

This reverts commit 0f67b86e73e881a1a154b4bda0cfca0b32a3cdc3.

On sc7180-trogdor class devices with 'fw_devlink=permissive' and KASAN
enabled, you'll see a Use-After-Free reported at bootup.

The root of the problem is that dwc3_qcom_of_register_core() is adding
a devm-allocated "tx-fifo-resize" property to its device tree node
using of_add_property().

The issue is that of_add_property() makes a _permanent_ addition to
the device tree that lasts until reboot. That means allocating memory
for the property using "devm" managed memory is a terrible idea since
that memory will be freed upon probe deferral or device unbinding.

Let's revert the patch since the system is still functional without
it. The fact that of_add_property() makes a permanent change is extra
fodder for those folks who were aruging that the device tree isn't
really the right way to pass information between parts of the
driver. It is an exercise left to the reader to submit a patch
re-adding the new feature in a way that makes everyone happier.

Fixes: 0f67b86e73e8 ("usb: dwc3: dwc3-qcom: Enable tx-fifo-resize property by default")
Cc: stable <stable@vger.kernel.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20211207094327.1.Ie3cde3443039342e2963262a4c3ac36dc2c08b30@changeid
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/dwc3-qcom.c