All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: drivers/net/wwan/qcom_bam_dmux.c:507 bam_dmux_cmd_data() warn: potential spectre issue 'dmux->netdevs' [r]
Date: Tue, 15 Feb 2022 06:36:14 +0800	[thread overview]
Message-ID: <202202150600.4Sde40jv-lkp@intel.com> (raw)

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Stephan Gerhold <stephan@gerhold.net>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   d567f5db412ed52de0b3b3efca4a451263de6108
commit: 21a0ffd9b38c61d79b5ade54893b0f59f2e8c2c3 net: wwan: Add Qualcomm BAM-DMUX WWAN network driver
date:   3 months ago
:::::: branch date: 5 hours ago
:::::: commit date: 3 months ago
config: s390-randconfig-m031-20220214 (https://download.01.org/0day-ci/archive/20220215/202202150600.4Sde40jv-lkp(a)intel.com/config)
compiler: s390-linux-gcc (GCC) 11.2.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/net/wwan/qcom_bam_dmux.c:507 bam_dmux_cmd_data() warn: potential spectre issue 'dmux->netdevs' [r]
drivers/net/wwan/qcom_bam_dmux.c:509 bam_dmux_cmd_data() warn: possible spectre second half.  'netdev'

vim +507 drivers/net/wwan/qcom_bam_dmux.c

21a0ffd9b38c61 Stephan Gerhold 2021-11-27  501  
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  502  static void bam_dmux_cmd_data(struct bam_dmux_skb_dma *skb_dma)
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  503  {
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  504  	struct bam_dmux *dmux = skb_dma->dmux;
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  505  	struct sk_buff *skb = skb_dma->skb;
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  506  	struct bam_dmux_hdr *hdr = (struct bam_dmux_hdr *)skb->data;
21a0ffd9b38c61 Stephan Gerhold 2021-11-27 @507  	struct net_device *netdev = dmux->netdevs[hdr->ch];
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  508  
21a0ffd9b38c61 Stephan Gerhold 2021-11-27 @509  	if (!netdev || !netif_running(netdev)) {
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  510  		dev_warn(dmux->dev, "Data for inactive channel %u\n", hdr->ch);
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  511  		return;
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  512  	}
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  513  
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  514  	if (hdr->len > BAM_DMUX_MAX_DATA_SIZE) {
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  515  		dev_err(dmux->dev, "Data larger than buffer? (%u > %u)\n",
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  516  			hdr->len, (u16)BAM_DMUX_MAX_DATA_SIZE);
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  517  		return;
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  518  	}
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  519  
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  520  	skb_dma->skb = NULL; /* Hand over to network stack */
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  521  
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  522  	skb_pull(skb, sizeof(*hdr));
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  523  	skb_trim(skb, hdr->len);
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  524  	skb->dev = netdev;
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  525  
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  526  	/* Only Raw-IP/QMAP is supported by this driver */
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  527  	switch (skb->data[0] & 0xf0) {
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  528  	case 0x40:
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  529  		skb->protocol = htons(ETH_P_IP);
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  530  		break;
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  531  	case 0x60:
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  532  		skb->protocol = htons(ETH_P_IPV6);
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  533  		break;
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  534  	default:
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  535  		skb->protocol = htons(ETH_P_MAP);
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  536  		break;
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  537  	}
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  538  
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  539  	netif_receive_skb(skb);
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  540  }
21a0ffd9b38c61 Stephan Gerhold 2021-11-27  541  

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

             reply	other threads:[~2022-02-14 22:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-14 22:36 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-05-12  0:08 drivers/net/wwan/qcom_bam_dmux.c:507 bam_dmux_cmd_data() warn: potential spectre issue 'dmux->netdevs' [r] kernel test robot
2022-06-12 10:43 kernel test robot
2022-08-06 19:58 kernel test robot
2022-10-09 22:39 kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202202150600.4Sde40jv-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.