linux/drivers/rpmsg
Danilo Krummrich 55ced13c42 rpmsg: use generic driver_override infrastructure
When a driver is probed through __driver_attach(), the bus' match()
callback is called without the device lock held, thus accessing the
driver_override field without a lock, which can cause a UAF.

Fix this by using the driver-core driver_override infrastructure taking
care of proper locking internally.

Note that calling match() from __driver_attach() without the device lock
held is intentional. [1]

Link: https://lore.kernel.org/driver-core/DGRGTIRHA62X.3RY09D9SOK77P@kernel.org/ [1]
Reported-by: Gui-Dong Han <hanguidong02@gmail.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220789
Fixes: e950604782 ("rpmsg: Introduce a driver override mechanism")
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/20260505133935.3772495-5-dakr@kernel.org
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2026-05-30 22:25:45 +02:00
..
Kconfig rpmsg: Move the rpmsg control device from rpmsg_char to rpmsg_ctrl 2022-03-13 11:49:53 -05:00
Makefile rpmsg: glink: Introduce packet tracepoints 2024-08-12 15:26:28 -07:00
mtk_rpmsg.c rpmsg: Constify buffer passed to send API 2026-04-06 09:37:51 -05:00
qcom_glink_native.c rpmsg: use generic driver_override infrastructure 2026-05-30 22:25:45 +02:00
qcom_glink_native.h rpmsg: glink: Fix spelling of peek 2023-02-14 20:28:48 -08:00
qcom_glink_rpm.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
qcom_glink_smem.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
qcom_glink_ssr.c rpmsg: qcom_glink_ssr: fix module autoloading 2024-05-06 19:26:28 -07:00
qcom_glink_trace.h rpmsg: glink: Introduce packet tracepoints 2024-08-12 15:26:28 -07:00
qcom_smd.c rpmsg: Constify buffer passed to send API 2026-04-06 09:37:51 -05:00
rpmsg_char.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
rpmsg_char.h rpmsg: char: Export eptdev create and destroy functions 2022-03-13 11:49:53 -05:00
rpmsg_core.c rpmsg: use generic driver_override infrastructure 2026-05-30 22:25:45 +02:00
rpmsg_ctrl.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
rpmsg_internal.h rpmsg: Constify buffer passed to send API 2026-04-06 09:37:51 -05:00
rpmsg_ns.c rpmsg: Replace deprecated strncpy with strscpy_pad 2023-10-23 11:57:57 -06:00
virtio_rpmsg_bus.c rpmsg: use generic driver_override infrastructure 2026-05-30 22:25:45 +02:00