Re: [PATCH] w1: fix NULL pointer dereference in probe
From: Krzysztof Kozlowski
Date: Mon Feb 03 2025 - 06:54:14 EST
On Sat, 11 Jan 2025 12:18:03 -0600, Chenyuan Yang wrote:
> The w1_uart_probe() function calls w1_uart_serdev_open() (which includes
> devm_serdev_device_open()) before setting the client ops via
> serdev_device_set_client_ops(). This ordering can trigger a NULL pointer
> dereference in the serdev controller's receive_buf handler, as it assumes
> serdev->ops is valid when SERPORT_ACTIVE is set.
>
> This is similar to the issue fixed in commit 5e700b384ec1
> ("platform/chrome: cros_ec_uart: properly fix race condition") where
> devm_serdev_device_open() was called before fully initializing the
> device.
>
> [...]
Applied, thanks!
[1/1] w1: fix NULL pointer dereference in probe
https://git.kernel.org/krzk/linux-w1/c/0dd6770a72f138dabea9eae87f3da6ffa68f0d06
Best regards,
--
Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx>