All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/bluetooth/btqca.c:134 qca_read_fw_build_info() warn: potential spectre issue 'build_label' [w] (local cap)
@ 2021-06-15 21:33 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-06-15 21:33 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 5285 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Venkata Lakshmi Narayana Gubba <gubbaven@codeaurora.org>
CC: Marcel Holtmann <marcel@holtmann.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   94f0b2d4a1d0c52035aef425da5e022bd2cb1c71
commit: c0187b0bd3e94c48050687d87b2c3c9fbae98ae9 Bluetooth: btqca: Add support to read FW build version for WCN3991 BTSoC
date:   6 months ago
:::::: branch date: 4 hours ago
:::::: commit date: 6 months ago
config: x86_64-randconfig-m001-20210615 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/bluetooth/btqca.c:134 qca_read_fw_build_info() warn: potential spectre issue 'build_label' [w] (local cap)

vim +/build_label +134 drivers/bluetooth/btqca.c

83e81961ff7ef7 Ben Young Tae Kim              2015-08-10   96  
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08   97  static int qca_read_fw_build_info(struct hci_dev *hdev)
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08   98  {
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08   99  	struct sk_buff *skb;
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  100  	struct edl_event_hdr *edl;
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  101  	char cmd, build_label[QCA_FW_BUILD_VER_LEN];
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  102  	int build_lbl_len, err = 0;
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  103  
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  104  	bt_dev_dbg(hdev, "QCA read fw build info");
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  105  
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  106  	cmd = EDL_GET_BUILD_INFO_CMD;
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  107  	skb = __hci_cmd_sync_ev(hdev, EDL_PATCH_CMD_OPCODE, EDL_PATCH_CMD_LEN,
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  108  				&cmd, 0, HCI_INIT_TIMEOUT);
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  109  	if (IS_ERR(skb)) {
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  110  		err = PTR_ERR(skb);
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  111  		bt_dev_err(hdev, "Reading QCA fw build info failed (%d)",
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  112  			   err);
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  113  		return err;
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  114  	}
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  115  
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  116  	edl = (struct edl_event_hdr *)(skb->data);
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  117  	if (!edl) {
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  118  		bt_dev_err(hdev, "QCA read fw build info with no header");
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  119  		err = -EILSEQ;
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  120  		goto out;
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  121  	}
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  122  
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  123  	if (edl->cresp != EDL_CMD_REQ_RES_EVT ||
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  124  	    edl->rtype != EDL_GET_BUILD_INFO_CMD) {
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  125  		bt_dev_err(hdev, "QCA Wrong packet received %d %d", edl->cresp,
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  126  			   edl->rtype);
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  127  		err = -EIO;
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  128  		goto out;
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  129  	}
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  130  
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  131  	build_lbl_len = edl->data[0];
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  132  	if (build_lbl_len <= QCA_FW_BUILD_VER_LEN - 1) {
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  133  		memcpy(build_label, edl->data + 1, build_lbl_len);
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08 @134  		*(build_label + build_lbl_len) = '\0';
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  135  	}
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  136  
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  137  	hci_set_fw_info(hdev, "%s", build_label);
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  138  
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  139  out:
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  140  	kfree_skb(skb);
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  141  	return err;
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  142  }
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  143  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 36283 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* drivers/bluetooth/btqca.c:134 qca_read_fw_build_info() warn: potential spectre issue 'build_label' [w] (local cap)
@ 2021-12-12 10:36 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-12-12 10:36 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 5358 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Venkata Lakshmi Narayana Gubba <gubbaven@codeaurora.org>
CC: Marcel Holtmann <marcel@holtmann.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   a763d5a5abd65797aec3dd1bf01fe2ccbec32967
commit: c0187b0bd3e94c48050687d87b2c3c9fbae98ae9 Bluetooth: btqca: Add support to read FW build version for WCN3991 BTSoC
date:   12 months ago
:::::: branch date: 10 hours ago
:::::: commit date: 12 months ago
config: i386-randconfig-m021-20211207 (https://download.01.org/0day-ci/archive/20211212/202112121846.bqkWvNCh-lkp(a)intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/bluetooth/btqca.c:134 qca_read_fw_build_info() warn: potential spectre issue 'build_label' [w] (local cap)

vim +/build_label +134 drivers/bluetooth/btqca.c

83e81961ff7ef7 Ben Young Tae Kim              2015-08-10   96  
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08   97  static int qca_read_fw_build_info(struct hci_dev *hdev)
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08   98  {
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08   99  	struct sk_buff *skb;
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  100  	struct edl_event_hdr *edl;
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  101  	char cmd, build_label[QCA_FW_BUILD_VER_LEN];
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  102  	int build_lbl_len, err = 0;
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  103  
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  104  	bt_dev_dbg(hdev, "QCA read fw build info");
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  105  
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  106  	cmd = EDL_GET_BUILD_INFO_CMD;
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  107  	skb = __hci_cmd_sync_ev(hdev, EDL_PATCH_CMD_OPCODE, EDL_PATCH_CMD_LEN,
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  108  				&cmd, 0, HCI_INIT_TIMEOUT);
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  109  	if (IS_ERR(skb)) {
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  110  		err = PTR_ERR(skb);
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  111  		bt_dev_err(hdev, "Reading QCA fw build info failed (%d)",
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  112  			   err);
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  113  		return err;
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  114  	}
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  115  
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  116  	edl = (struct edl_event_hdr *)(skb->data);
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  117  	if (!edl) {
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  118  		bt_dev_err(hdev, "QCA read fw build info with no header");
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  119  		err = -EILSEQ;
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  120  		goto out;
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  121  	}
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  122  
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  123  	if (edl->cresp != EDL_CMD_REQ_RES_EVT ||
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  124  	    edl->rtype != EDL_GET_BUILD_INFO_CMD) {
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  125  		bt_dev_err(hdev, "QCA Wrong packet received %d %d", edl->cresp,
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  126  			   edl->rtype);
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  127  		err = -EIO;
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  128  		goto out;
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  129  	}
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  130  
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  131  	build_lbl_len = edl->data[0];
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  132  	if (build_lbl_len <= QCA_FW_BUILD_VER_LEN - 1) {
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  133  		memcpy(build_label, edl->data + 1, build_lbl_len);
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08 @134  		*(build_label + build_lbl_len) = '\0';
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  135  	}
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  136  
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  137  	hci_set_fw_info(hdev, "%s", build_label);
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  138  
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  139  out:
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  140  	kfree_skb(skb);
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  141  	return err;
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  142  }
c0187b0bd3e94c Venkata Lakshmi Narayana Gubba 2020-12-08  143  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-12 10:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-15 21:33 drivers/bluetooth/btqca.c:134 qca_read_fw_build_info() warn: potential spectre issue 'build_label' [w] (local cap) kernel test robot
2021-12-12 10:36 kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.