[intel-linux-intel-lts:5.4/yocto 15/1142] drivers/crypto/keembay/keembay-ocs-hcu-core.c:218:31: sparse: sparse: Using plain integer as NULL pointer
by kernel test robot
tree: https://github.com/intel/linux-intel-lts.git 5.4/yocto
head: eeb611e5394c56d45c5cc8f7dc484c9f19e93143
commit: 9b07a958f2eb496c88faf0bd749eb600357f4190 [15/1142] crypto: keembay: Add Keem Bay OCS HCU
config: x86_64-randconfig-s022-20210618 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-341-g8af24329-dirty
# https://github.com/intel/linux-intel-lts/commit/9b07a958f2eb496c88faf0bd7...
git remote add intel-linux-intel-lts https://github.com/intel/linux-intel-lts.git
git fetch --no-tags intel-linux-intel-lts 5.4/yocto
git checkout 9b07a958f2eb496c88faf0bd749eb600357f4190
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/crypto/keembay/keembay-ocs-hcu-core.c:218:31: sparse: sparse: Using plain integer as NULL pointer
drivers/crypto/keembay/keembay-ocs-hcu-core.c:219:31: sparse: sparse: Using plain integer as NULL pointer
drivers/crypto/keembay/keembay-ocs-hcu-core.c:749:31: sparse: sparse: Using plain integer as NULL pointer
drivers/crypto/keembay/keembay-ocs-hcu-core.c:750:31: sparse: sparse: Using plain integer as NULL pointer
vim +218 drivers/crypto/keembay/keembay-ocs-hcu-core.c
202
203 static void kmb_ocs_free_dma_list(struct ocs_hcu_rctx *rctx)
204 {
205 struct ocs_hcu_dev *hcu_dev = rctx->hcu_dev;
206 struct device *dev = hcu_dev->dev;
207
208 if (!rctx->dma_list_head || !rctx->dma_list_tail)
209 return;
210
211 if (rctx->sg_dma_nents > 0)
212 dma_unmap_sg(dev, hcu_dev->req->src, rctx->sg_dma_nents,
213 DMA_TO_DEVICE);
214
215 dma_free_coherent(dev, rctx->dma_list_size, rctx->dma_list_head,
216 rctx->ll_dma_addr);
217
> 218 rctx->dma_list_head = 0;
219 rctx->dma_list_tail = 0;
220 rctx->ll_dma_addr = 0;
221 }
222
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
[uml:linux-next 13/19] arch/um/kernel/skas/uaccess.c:378:9: sparse: sparse: incorrect type in argument 1 (different address spaces)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rw/uml.git linux-next
head: 1aee020155f364ef538370d3392969f1077b9bae
commit: dd3035a21ba7ccaa883d7107d357ad06320d78fc [13/19] um: add a UML specific futex implementation
config: um-i386_defconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-341-g8af24329-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/rw/uml.git/commit/?id=dd3...
git remote add uml https://git.kernel.org/pub/scm/linux/kernel/git/rw/uml.git
git fetch --no-tags uml linux-next
git checkout dd3035a21ba7ccaa883d7107d357ad06320d78fc
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=um SUBARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
arch/um/kernel/skas/uaccess.c:292:15: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] [usertype] __user *uaddr @@ got unsigned int [usertype] * @@
arch/um/kernel/skas/uaccess.c:292:15: sparse: expected unsigned int [noderef] [usertype] __user *uaddr
arch/um/kernel/skas/uaccess.c:292:15: sparse: got unsigned int [usertype] *
arch/um/kernel/skas/uaccess.c:368:15: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected unsigned int [noderef] [usertype] __user *uaddr @@ got void * @@
arch/um/kernel/skas/uaccess.c:368:15: sparse: expected unsigned int [noderef] [usertype] __user *uaddr
arch/um/kernel/skas/uaccess.c:368:15: sparse: got void *
arch/um/kernel/skas/uaccess.c:373:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile *v @@ got unsigned int [noderef] [usertype] __user *__ai_ptr @@
arch/um/kernel/skas/uaccess.c:373:15: sparse: expected void const volatile *v
arch/um/kernel/skas/uaccess.c:373:15: sparse: got unsigned int [noderef] [usertype] __user *__ai_ptr
arch/um/kernel/skas/uaccess.c:373:15: sparse: sparse: cast removes address space '__user' of expression
arch/um/kernel/skas/uaccess.c:373:15: sparse: sparse: cast removes address space '__user' of expression
arch/um/kernel/skas/uaccess.c:373:15: sparse: sparse: cast removes address space '__user' of expression
arch/um/kernel/skas/uaccess.c:373:15: sparse: sparse: cast removes address space '__user' of expression
>> arch/um/kernel/skas/uaccess.c:378:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *addr @@ got unsigned int [noderef] [usertype] __user *uaddr @@
arch/um/kernel/skas/uaccess.c:378:9: sparse: expected void *addr
arch/um/kernel/skas/uaccess.c:378:9: sparse: got unsigned int [noderef] [usertype] __user *uaddr
arch/um/kernel/skas/uaccess.c:293:19: sparse: sparse: dereference of noderef expression
arch/um/kernel/skas/uaccess.c:299:18: sparse: sparse: dereference of noderef expression
arch/um/kernel/skas/uaccess.c:302:18: sparse: sparse: dereference of noderef expression
arch/um/kernel/skas/uaccess.c:305:18: sparse: sparse: dereference of noderef expression
arch/um/kernel/skas/uaccess.c:308:18: sparse: sparse: dereference of noderef expression
arch/um/kernel/skas/uaccess.c:311:18: sparse: sparse: dereference of noderef expression
arch/um/kernel/skas/uaccess.c:371:18: sparse: sparse: dereference of noderef expression
vim +378 arch/um/kernel/skas/uaccess.c
370
371 *uval = *uaddr;
372
373 ret = cmpxchg(uaddr, oldval, newval);
374
375 #ifdef CONFIG_64BIT
376 pagefault_enable();
377 #else
> 378 kunmap_atomic(uaddr);
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
fs/cifs/cifs_swn.c:468 cifs_swn_store_swn_addr() error: uninitialized symbol 'port'.
by Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 9ed13a17e38e0537e24d9b507645002bf8d0201f
commit: 121d947d4fe15bcec90bcfc1249ee9b739cb9258 cifs: Handle witness client move notification
config: h8300-randconfig-m031-20210618 (attached as .config)
compiler: h8300-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
fs/cifs/cifs_swn.c:468 cifs_swn_store_swn_addr() error: uninitialized symbol 'port'.
vim +/port +468 fs/cifs/cifs_swn.c
121d947d4fe15b Samuel Cabrero 2020-11-30 447 static int cifs_swn_store_swn_addr(const struct sockaddr_storage *new,
121d947d4fe15b Samuel Cabrero 2020-11-30 448 const struct sockaddr_storage *old,
121d947d4fe15b Samuel Cabrero 2020-11-30 449 struct sockaddr_storage *dst)
121d947d4fe15b Samuel Cabrero 2020-11-30 450 {
121d947d4fe15b Samuel Cabrero 2020-11-30 451 __be16 port;
121d947d4fe15b Samuel Cabrero 2020-11-30 452
121d947d4fe15b Samuel Cabrero 2020-11-30 453 if (old->ss_family == AF_INET) {
121d947d4fe15b Samuel Cabrero 2020-11-30 454 struct sockaddr_in *ipv4 = (struct sockaddr_in *)old;
121d947d4fe15b Samuel Cabrero 2020-11-30 455
121d947d4fe15b Samuel Cabrero 2020-11-30 456 port = ipv4->sin_port;
121d947d4fe15b Samuel Cabrero 2020-11-30 457 }
121d947d4fe15b Samuel Cabrero 2020-11-30 458
121d947d4fe15b Samuel Cabrero 2020-11-30 459 if (old->ss_family == AF_INET6) {
121d947d4fe15b Samuel Cabrero 2020-11-30 460 struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)old;
121d947d4fe15b Samuel Cabrero 2020-11-30 461
121d947d4fe15b Samuel Cabrero 2020-11-30 462 port = ipv6->sin6_port;
121d947d4fe15b Samuel Cabrero 2020-11-30 463 }
121d947d4fe15b Samuel Cabrero 2020-11-30 464
121d947d4fe15b Samuel Cabrero 2020-11-30 465 if (new->ss_family == AF_INET) {
121d947d4fe15b Samuel Cabrero 2020-11-30 466 struct sockaddr_in *ipv4 = (struct sockaddr_in *)new;
121d947d4fe15b Samuel Cabrero 2020-11-30 467
121d947d4fe15b Samuel Cabrero 2020-11-30 @468 ipv4->sin_port = port;
Apparently Smatch is not smart enough to know that AF_INET and AF_INET6
are the only possible values for old->ss_family. I hope that eventually
we will be able to enable GCC's uninitialized variable checking and GCC
is certainly not able to figure this out either.
121d947d4fe15b Samuel Cabrero 2020-11-30 469 }
121d947d4fe15b Samuel Cabrero 2020-11-30 470
121d947d4fe15b Samuel Cabrero 2020-11-30 471 if (new->ss_family == AF_INET6) {
121d947d4fe15b Samuel Cabrero 2020-11-30 472 struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)new;
121d947d4fe15b Samuel Cabrero 2020-11-30 473
121d947d4fe15b Samuel Cabrero 2020-11-30 474 ipv6->sin6_port = port;
121d947d4fe15b Samuel Cabrero 2020-11-30 475 }
121d947d4fe15b Samuel Cabrero 2020-11-30 476
121d947d4fe15b Samuel Cabrero 2020-11-30 477 *dst = *new;
121d947d4fe15b Samuel Cabrero 2020-11-30 478
121d947d4fe15b Samuel Cabrero 2020-11-30 479 return 0;
121d947d4fe15b Samuel Cabrero 2020-11-30 480 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
[chrome-os:chromeos-5.10 98/107] net/bluetooth/smp.c:1634 smp_user_confirm_reply() warn: variable dereferenced before check 'conn' (see line 1632)
by Dan Carpenter
tree: https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-5.10
head: a14daa5347bacafd6b416560b38bc48a3e80cc67
commit: ad25b27bf35f7dcf7f3c87bfc7852599e6242111 [98/107] UPSTREAM: Bluetooth: SMP: Convert BT_ERR/BT_DBG to bt_dev_err/bt_dev_dbg
config: h8300-randconfig-m031-20210618 (attached as .config)
compiler: h8300-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
net/bluetooth/smp.c:1634 smp_user_confirm_reply() warn: variable dereferenced before check 'conn' (see line 1632)
vim +/conn +1634 net/bluetooth/smp.c
2b64d153a0cc9d Brian Gix 2011-12-21 1624 int smp_user_confirm_reply(struct hci_conn *hcon, u16 mgmt_op, __le32 passkey)
2b64d153a0cc9d Brian Gix 2011-12-21 1625 {
b10e8017bd9d02 Johan Hedberg 2014-06-27 1626 struct l2cap_conn *conn = hcon->l2cap_data;
5d88cc73dded31 Johan Hedberg 2014-08-08 1627 struct l2cap_chan *chan;
2b64d153a0cc9d Brian Gix 2011-12-21 1628 struct smp_chan *smp;
2b64d153a0cc9d Brian Gix 2011-12-21 1629 u32 value;
fc75cc8684d21d Johan Hedberg 2014-09-05 1630 int err;
2b64d153a0cc9d Brian Gix 2011-12-21 1631
ad25b27bf35f7d Luiz Augusto von Dentz 2021-03-15 @1632 bt_dev_dbg(conn->hcon->hdev, "");
^^^^^^^^^^^^^^^^
Dereference
2b64d153a0cc9d Brian Gix 2011-12-21 1633
fc75cc8684d21d Johan Hedberg 2014-09-05 @1634 if (!conn)
^^^^^
Checked too late.
2b64d153a0cc9d Brian Gix 2011-12-21 1635 return -ENOTCONN;
2b64d153a0cc9d Brian Gix 2011-12-21 1636
5d88cc73dded31 Johan Hedberg 2014-08-08 1637 chan = conn->smp;
5d88cc73dded31 Johan Hedberg 2014-08-08 1638 if (!chan)
5d88cc73dded31 Johan Hedberg 2014-08-08 1639 return -ENOTCONN;
5d88cc73dded31 Johan Hedberg 2014-08-08 1640
fc75cc8684d21d Johan Hedberg 2014-09-05 1641 l2cap_chan_lock(chan);
fc75cc8684d21d Johan Hedberg 2014-09-05 1642 if (!chan->data) {
fc75cc8684d21d Johan Hedberg 2014-09-05 1643 err = -ENOTCONN;
fc75cc8684d21d Johan Hedberg 2014-09-05 1644 goto unlock;
fc75cc8684d21d Johan Hedberg 2014-09-05 1645 }
fc75cc8684d21d Johan Hedberg 2014-09-05 1646
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months