lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200528161627.GK4525@google.com>
Date:   Thu, 28 May 2020 09:16:27 -0700
From:   Matthias Kaehlcke <mka@...omium.org>
To:     Zijun Hu <zijuhu@...eaurora.org>
Cc:     marcel@...tmann.org, johan.hedberg@...il.com,
        linux-kernel@...r.kernel.org, linux-bluetooth@...r.kernel.org,
        linux-arm-msm@...r.kernel.org, bgodavar@...eaurora.org,
        c-hbandi@...eaurora.org, hemantg@...eaurora.org,
        rjliao@...eaurora.org
Subject: Re: [PATCH v1] bluetooth: hci_qca: Fix suspend/resume functionality
 failure

Hi Zijun,

On Thu, May 28, 2020 at 06:38:22PM +0800, Zijun Hu wrote:
> @dev parameter of qca_suspend()/qca_resume() represents
> serdev_device, but it is mistook for hci_dev and causes
> succedent unexpected memory access.
> 
> Fix by taking @dev as serdev_device.
> 
> Signed-off-by: Zijun Hu <zijuhu@...eaurora.org>

Please add:

Fixes: 41d5b25fed0 ("Bluetooth: hci_qca: add PM support")

and add stable@...nel.org to cc:

> ---
>  drivers/bluetooth/hci_qca.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
> index e4a6823..c159161 100644
> --- a/drivers/bluetooth/hci_qca.c
> +++ b/drivers/bluetooth/hci_qca.c
> @@ -1977,8 +1977,10 @@ static void qca_serdev_remove(struct serdev_device *serdev)
>  
>  static int __maybe_unused qca_suspend(struct device *dev)
>  {
> -	struct hci_dev *hdev = container_of(dev, struct hci_dev, dev);
> -	struct hci_uart *hu = hci_get_drvdata(hdev);
> +	struct serdev_device *serdev = to_serdev_device(dev);
> +	struct qca_serdev *qcadev = serdev_device_get_drvdata(serdev);
> +	struct hci_uart *hu = &qcadev->serdev_hu;
> +	struct hci_dev *hdev __maybe_unused = hu->hdev;

hdev is not used, please remove

>  	struct qca_data *qca = hu->priv;
>  	unsigned long flags;
>  	int ret = 0;
> @@ -2057,8 +2059,10 @@ static int __maybe_unused qca_suspend(struct device *dev)
>  
>  static int __maybe_unused qca_resume(struct device *dev)
>  {
> -	struct hci_dev *hdev = container_of(dev, struct hci_dev, dev);
> -	struct hci_uart *hu = hci_get_drvdata(hdev);
> +	struct serdev_device *serdev = to_serdev_device(dev);
> +	struct qca_serdev *qcadev = serdev_device_get_drvdata(serdev);
> +	struct hci_uart *hu = &qcadev->serdev_hu;
> +	struct hci_dev *hdev __maybe_unused = hu->hdev;

hdev is not used, please remove

>  	struct qca_data *qca = hu->priv;
>  
>  	clear_bit(QCA_SUSPENDING, &qca->flags);
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ