From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: drivers/net/hamradio/scc.c:1748 scc_net_siocdevprivate() warn: potential spectre issue 'Ivec' [w] (local cap)
Date: Thu, 11 Nov 2021 04:52:26 +0800 [thread overview]
Message-ID: <202111110408.ewAaMjb6-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 6665 bytes --]
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Arnd Bergmann <arnd@arndb.de>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 89d714ab6043bca7356b5c823f5335f5dce1f930
commit: 25ec92fbdd23a0a2bfd2bdf489e60ea4f0ae46d1 hamradio: use ndo_siocdevprivate
date: 4 months ago
:::::: branch date: 3 hours ago
:::::: commit date: 4 months ago
config: mips-randconfig-m031-20211012 (attached as .config)
compiler: mips64el-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/hamradio/scc.c:1748 scc_net_siocdevprivate() warn: potential spectre issue 'Ivec' [w] (local cap)
vim +/Ivec +1748 drivers/net/hamradio/scc.c
^1da177e4c3f41 Linus Torvalds 2005-04-16 1695
^1da177e4c3f41 Linus Torvalds 2005-04-16 1696 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 1697 * SIOCSCCCFG - configure driver arg: (struct scc_hw_config *) arg
^1da177e4c3f41 Linus Torvalds 2005-04-16 1698 * SIOCSCCINI - initialize driver arg: ---
^1da177e4c3f41 Linus Torvalds 2005-04-16 1699 * SIOCSCCCHANINI - initialize channel arg: (struct scc_modem *) arg
^1da177e4c3f41 Linus Torvalds 2005-04-16 1700 * SIOCSCCSMEM - set memory arg: (struct scc_mem_config *) arg
^1da177e4c3f41 Linus Torvalds 2005-04-16 1701 * SIOCSCCGKISS - get level 1 parameter arg: (struct scc_kiss_cmd *) arg
^1da177e4c3f41 Linus Torvalds 2005-04-16 1702 * SIOCSCCSKISS - set level 1 parameter arg: (struct scc_kiss_cmd *) arg
^1da177e4c3f41 Linus Torvalds 2005-04-16 1703 * SIOCSCCGSTAT - get driver status arg: (struct scc_stat *) arg
^1da177e4c3f41 Linus Torvalds 2005-04-16 1704 * SIOCSCCCAL - send calib. pattern arg: (struct scc_calibrate *) arg
^1da177e4c3f41 Linus Torvalds 2005-04-16 1705 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 1706
25ec92fbdd23a0 Arnd Bergmann 2021-07-27 1707 static int scc_net_siocdevprivate(struct net_device *dev,
25ec92fbdd23a0 Arnd Bergmann 2021-07-27 1708 struct ifreq *ifr, void __user *arg, int cmd)
^1da177e4c3f41 Linus Torvalds 2005-04-16 1709 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 1710 struct scc_kiss_cmd kiss_cmd;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1711 struct scc_mem_config memcfg;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1712 struct scc_hw_config hwcfg;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1713 struct scc_calibrate cal;
f4bdd264b43cc6 Wang Chen 2008-11-20 1714 struct scc_channel *scc = (struct scc_channel *) dev->ml_priv;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1715 int chan;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1716 unsigned char device_name[IFNAMSIZ];
^1da177e4c3f41 Linus Torvalds 2005-04-16 1717
^1da177e4c3f41 Linus Torvalds 2005-04-16 1718 if (!Driver_Initialized)
^1da177e4c3f41 Linus Torvalds 2005-04-16 1719 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 1720 if (cmd == SIOCSCCCFG)
^1da177e4c3f41 Linus Torvalds 2005-04-16 1721 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 1722 int found = 1;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1723
^1da177e4c3f41 Linus Torvalds 2005-04-16 1724 if (!capable(CAP_SYS_RAWIO)) return -EPERM;
25ec92fbdd23a0 Arnd Bergmann 2021-07-27 1725 if (in_compat_syscall())
25ec92fbdd23a0 Arnd Bergmann 2021-07-27 1726 return -EOPNOTSUPP;
25ec92fbdd23a0 Arnd Bergmann 2021-07-27 1727
^1da177e4c3f41 Linus Torvalds 2005-04-16 1728 if (!arg) return -EFAULT;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1729
^1da177e4c3f41 Linus Torvalds 2005-04-16 1730 if (Nchips >= SCC_MAXCHIPS)
^1da177e4c3f41 Linus Torvalds 2005-04-16 1731 return -EINVAL;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1732
^1da177e4c3f41 Linus Torvalds 2005-04-16 1733 if (copy_from_user(&hwcfg, arg, sizeof(hwcfg)))
^1da177e4c3f41 Linus Torvalds 2005-04-16 1734 return -EFAULT;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1735
^1da177e4c3f41 Linus Torvalds 2005-04-16 1736 if (hwcfg.irq == 2) hwcfg.irq = 9;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1737
60e4ad7a72fd7c Yinghai Lu 2008-08-19 1738 if (hwcfg.irq < 0 || hwcfg.irq >= nr_irqs)
^1da177e4c3f41 Linus Torvalds 2005-04-16 1739 return -EINVAL;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1740
^1da177e4c3f41 Linus Torvalds 2005-04-16 1741 if (!Ivec[hwcfg.irq].used && hwcfg.irq)
^1da177e4c3f41 Linus Torvalds 2005-04-16 1742 {
1b36efe07f83ec Jeff Garzik 2007-10-29 1743 if (request_irq(hwcfg.irq, scc_isr,
9714481e677562 Michael Opdenacker 2013-10-05 1744 0, "AX.25 SCC",
1b36efe07f83ec Jeff Garzik 2007-10-29 1745 (void *)(long) hwcfg.irq))
^1da177e4c3f41 Linus Torvalds 2005-04-16 1746 printk(KERN_WARNING "z8530drv: warning, cannot get IRQ %d\n", hwcfg.irq);
^1da177e4c3f41 Linus Torvalds 2005-04-16 1747 else
^1da177e4c3f41 Linus Torvalds 2005-04-16 @1748 Ivec[hwcfg.irq].used = 1;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1749 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 1750
^1da177e4c3f41 Linus Torvalds 2005-04-16 1751 if (hwcfg.vector_latch && !Vector_Latch) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 1752 if (!request_region(hwcfg.vector_latch, 1, "scc vector latch"))
^1da177e4c3f41 Linus Torvalds 2005-04-16 1753 printk(KERN_WARNING "z8530drv: warning, cannot reserve vector latch port 0x%lx\n, disabled.", hwcfg.vector_latch);
^1da177e4c3f41 Linus Torvalds 2005-04-16 1754 else
^1da177e4c3f41 Linus Torvalds 2005-04-16 1755 Vector_Latch = hwcfg.vector_latch;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1756 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 1757
^1da177e4c3f41 Linus Torvalds 2005-04-16 1758 if (hwcfg.clock == 0)
^1da177e4c3f41 Linus Torvalds 2005-04-16 1759 hwcfg.clock = SCC_DEFAULT_CLOCK;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1760
:::::: The code at line 1748 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2
:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>
---
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: 32243 bytes --]
next reply other threads:[~2021-11-10 20:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-10 20:52 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-04-18 7:54 drivers/net/hamradio/scc.c:1748 scc_net_siocdevprivate() warn: potential spectre issue 'Ivec' [w] (local cap) kernel test robot
2022-04-17 21:25 kernel test robot
2021-12-06 12:53 kernel test robot
2021-11-08 9:54 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=202111110408.ewAaMjb6-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.