[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <37416e93-5ccc-79c9-b340-356fcac0ec51@linaro.org>
Date: Mon, 11 Apr 2022 08:51:11 +0200
From: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
To: Duoming Zhou <duoming@....edu.cn>, linux-kernel@...r.kernel.org
Cc: netdev@...r.kernel.org, akpm@...ux-foundation.org,
davem@...emloft.net, gregkh@...uxfoundation.org,
alexander.deucher@....com, broonie@...nel.org
Subject: Re: [PATCH V2] drivers: nfc: nfcmrvl: fix double free bug in
nfcmrvl_nci_unregister_dev()
On 10/04/2022 15:52, Duoming Zhou wrote:
> There is a potential double bug in nfcmrvl usb driver between
> unregister and resume operation.
>
> The race that cause that double free bug can be shown as below:
>
> (FREE) | (USE)
> | nfcmrvl_resume
> | nfcmrvl_submit_bulk_urb
> | nfcmrvl_bulk_complete
> | nfcmrvl_nci_recv_frame
> | nfcmrvl_fw_dnld_recv_frame
> | queue_work
> | fw_dnld_rx_work
> | fw_dnld_over
> | release_firmware
> | kfree(fw); //(1)
> nfcmrvl_disconnect |
> nfcmrvl_nci_unregister_dev |
> nfcmrvl_fw_dnld_abort |
> fw_dnld_over | ...
> if (priv->fw_dnld.fw) |
> release_firmware |
> kfree(fw); //(2) |
> ... | priv->fw_dnld.fw = NULL;
>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Best regards,
Krzysztof
Powered by blists - more mailing lists