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: <SN4PR0201MB87254F7D357675346E138AF7E3769@SN4PR0201MB8725.namprd02.prod.outlook.com>
Date:   Wed, 15 Dec 2021 11:28:16 +0000
From:   "Sai Teja Aluvala (Temp) (QUIC)" <quic_saluvala@...cinc.com>
To:     Marcel Holtmann <marcel@...tmann.org>,
        "Sai Teja Aluvala (Temp) (QUIC)" <quic_saluvala@...cinc.com>
CC:     Johan Hedberg <johan.hedberg@...il.com>,
        Matthias Kaehlcke <mka@...omium.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-bluetooth <linux-bluetooth@...r.kernel.org>,
        "Hemant Gupta (QUIC)" <quic_hemantg@...cinc.com>,
        MSM <linux-arm-msm@...r.kernel.org>,
        quic_bgodavar <quic_bgodavar@...cinc.com>,
        Rocky Liao <rjliao@...eaurora.org>,
        "hbandi@...eaurora.org" <hbandi@...eaurora.org>,
        Abhishek Pandit-Subedi <abhishekpandit@...omium.org>,
        Miao-chen Chou <mcchou@...omium.org>,
        "PANICKER HARISH (Temp) (QUIC)" <quic_pharish@...cinc.com>
Subject: RE: [PATCH v2] Bluetooth: btqca: sequential validation



-----Original Message-----
From: Marcel Holtmann <marcel@...tmann.org> 
Sent: Thursday, December 9, 2021 4:15 PM
To: Sai Teja Aluvala (Temp) (QUIC) <quic_saluvala@...cinc.com>
Cc: Johan Hedberg <johan.hedberg@...il.com>; Matthias Kaehlcke <mka@...omium.org>; Linux Kernel Mailing List <linux-kernel@...r.kernel.org>; linux-bluetooth <linux-bluetooth@...r.kernel.org>; Hemant Gupta (QUIC) <quic_hemantg@...cinc.com>; MSM <linux-arm-msm@...r.kernel.org>; quic_bgodavar <quic_bgodavar@...cinc.com>; Rocky Liao <rjliao@...eaurora.org>; hbandi@...eaurora.org; Abhishek Pandit-Subedi <abhishekpandit@...omium.org>; Miao-chen Chou <mcchou@...omium.org>; PANICKER HARISH (Temp) (QUIC) <quic_pharish@...cinc.com>
Subject: Re: [PATCH v2] Bluetooth: btqca: sequential validation

Hi Sai,

> This change will have sequential validation support & patch config 
> command is added
> 
> Signed-off-by: Sai Teja Aluvala <quic_saluvala@...cinc.com>
> ---
> drivers/bluetooth/btqca.c | 50 
> +++++++++++++++++++++++++++++++++++++++++++++++
> drivers/bluetooth/btqca.h |  2 ++
> 2 files changed, 52 insertions(+)
> 
> diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c 
> index be04d74..633a24c 100644
> --- a/drivers/bluetooth/btqca.c
> +++ b/drivers/bluetooth/btqca.c
> @@ -141,6 +141,53 @@ static int qca_read_fw_build_info(struct hci_dev *hdev)
> 	return err;
> }
> 
> +static int qca_send_patch_config_cmd(struct hci_dev *hdev) {
> +	struct sk_buff *skb;
> +	int err = 0;
> +	u8 cmd[] = {EDL_PATCH_CONFIG_CMD, 0x01, 0, 0, 0};

is there are reason not to address review comments?
[Sai] : I will address in next patch

	const u8 cmd[] = { EDL_PATCH_CONFIG_CMD, 0x01, 0, 0, 0 };

> +	u8 rlen = 0x02;
> +	struct edl_event_hdr *edl;
> +	u8 rtype = EDL_PATCH_CONFIG_CMD;

I missed these two and must have assumed there are used somewhere, rlen and rtype are a waste to be declared.
[Sai] : I will delete rlen in next patch.

> +
> +	bt_dev_dbg(hdev, "QCA Patch config");
> +
> +	skb = __hci_cmd_sync_ev(hdev, EDL_PATCH_CMD_OPCODE, sizeof(cmd),
> +				cmd, HCI_EV_VENDOR, HCI_INIT_TIMEOUT);
> +	if (IS_ERR(skb)) {
> +		err = PTR_ERR(skb);
> +		bt_dev_err(hdev, "Sending QCA Patch config failed (%d)", err);
> +		return err;
> +	}
> +
> +	if (skb->len != rlen) {

	if (skb->len != 2) {

> +		bt_dev_err(hdev, "QCA Patch config cmd size mismatch len %d", skb->len);
> +		err = -EILSEQ;
> +		goto out;
> +	}
> +
> +	edl = (struct edl_event_hdr *)(skb->data);
> +	if (!edl) {
> +		bt_dev_err(hdev, "QCA Patch config with no header");
> +		err = -EILSEQ;
> +		goto out;
> +	}
> +
> +	if (edl->cresp != EDL_PATCH_CONFIG_RES_EVT || edl->rtype != rtype) {

	     edl->rtype != EDL_PATCH_CONFIG_CMD) {

[Sai] : I will update in next patch.


> +		bt_dev_err(hdev, "QCA Wrong packet received %d %d", edl->cresp,
> +			   edl->rtype);
> +		err = -EIO;
> +		goto out;
> +	}
> +
> +out:
> +	kfree(skb);
> +	if (err)
> +		bt_dev_err(hdev, "QCA Patch config cmd failed (%d)", err);
> +
> +	return err;
> +}
> +

Regards

Marcel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ