All of lore.kernel.org
 help / color / mirror / Atom feed
[parent not found: <60d0439a1c15c_16db9f2ab48dcf79b875634@prd-scan-dashboard-0.mail>]
* New Defects reported by Coverity Scan for Linux
@ 2020-11-10 17:16 Bjorn Helgaas
  2020-11-10 23:36 ` Gustavo Pimentel
  0 siblings, 1 reply; 13+ messages in thread
From: Bjorn Helgaas @ 2020-11-10 17:16 UTC (permalink / raw)
  To: Rob Herring; +Cc: linux-pci, Jingoo Han, Gustavo Pimentel

New Coverity complaint about v5.10-rc3, resulting from 9fff3256f93d
("PCI: dwc: Restore ATU memory resource setup to use last entry").

I didn't try to figure out if this is real or a false positive, so
just FYI.

----- Forwarded message from scan-admin@coverity.com -----

Date: Mon, 09 Nov 2020 11:13:37 +0000 (UTC)
From: scan-admin@coverity.com
To: bjorn@helgaas.com
Subject: New Defects reported by Coverity Scan for Linux
Message-ID: <5fa924618fb3b_a62932acac7322f5033088@prd-scan-dashboard-0.mail>


** CID 1469110:  Null pointer dereferences  (FORWARD_NULL)
/drivers/pci/controller/dwc/pcie-designware-host.c: 596 in dw_pcie_setup_rc()


________________________________________________________________________________________________________
*** CID 1469110:  Null pointer dereferences  (FORWARD_NULL)
/drivers/pci/controller/dwc/pcie-designware-host.c: 596 in dw_pcie_setup_rc()
590     
591     		/* Get last memory resource entry */
592     		resource_list_for_each_entry(tmp, &pp->bridge->windows)
593     			if (resource_type(tmp->res) == IORESOURCE_MEM)
594     				entry = tmp;
595     
>>>     CID 1469110:  Null pointer dereferences  (FORWARD_NULL)
>>>     Dereferencing null pointer "entry".
596     		dw_pcie_prog_outbound_atu(pci, PCIE_ATU_REGION_INDEX0,
597     					  PCIE_ATU_TYPE_MEM, entry->res->start,
598     					  entry->res->start - entry->offset,
599     					  resource_size(entry->res));
600     		if (pci->num_viewport > 2)
601     			dw_pcie_prog_outbound_atu(pci, PCIE_ATU_REGION_INDEX2,

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Fwd: New Defects reported by Coverity Scan for Linux
@ 2017-11-27 13:22 Richard Weinberger
  2017-11-27 14:19 ` Andrea Adami
  0 siblings, 1 reply; 13+ messages in thread
From: Richard Weinberger @ 2017-11-27 13:22 UTC (permalink / raw)
  To: andrea.adami; +Cc: linux-mtd

Andrea,

please check. The same pattern seems to be used more than once in this driver.

Thanks,
//richard

----------  Weitergeleitete Nachricht  ----------

Betreff: New Defects reported by Coverity Scan for Linux
Datum: Montag, 27. November 2017, 08:49:21 CET
Von: scan-admin@coverity.com
An: richard@nod.at



Hi,

Please find the latest report on new defect(s) introduced to Linux, under 
component 'Drivers-MTD',  found with Coverity Scan.

1 new defect(s) introduced to Linux, under component 'Drivers-MTD',  found 
with Coverity Scan.
344 defect(s), reported by Coverity Scan earlier, were marked fixed in the 
recent build analyzed by Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 1 of 1 defect(s)


** CID 1424016:  Integer handling issues  (OVERFLOW_BEFORE_WIDEN)
/drivers/mtd/parsers/sharpslpart.c: 195 in sharpsl_nand_init_ftl()


________________________________________________________________________________________________________
*** CID 1424016:  Integer handling issues  (OVERFLOW_BEFORE_WIDEN)
/drivers/mtd/parsers/sharpslpart.c: 195 in sharpsl_nand_init_ftl()
189     	/* initialize ftl->log2phy */
190     	for (i = 0; i < ftl->logmax; i++)
191     		ftl->log2phy[i] = UINT_MAX;
192     
193     	/* create physical-logical table */
194     	for (block_num = 0; block_num < phymax; block_num++) {
>>>     CID 1424016:  Integer handling issues  (OVERFLOW_BEFORE_WIDEN)
>>>     Potentially overflowing expression "block_num * mtd->erasesize" with 
type "unsigned int" (32 bits, unsigned) is evaluated using 32-bit arithmetic, 
and then used in a context that expects an expression of type "loff_t" (64 
bits, signed).
195     		block_adr = block_num * mtd->erasesize;
196     
197     		if (mtd_block_isbad(mtd, block_adr))
198     			continue;
199     
200     		if (sharpsl_nand_read_oob(mtd, block_adr, oob))


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u2389337.ct.sendgrid.net/
wf/click?
upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRZILrCyVW9WQLwr7wR5iGubla-2BOU6Se2Euumsa1bPpOJg-3D-3D_p9c2Pq5BRWXelYclnUuZY8l3SYc-2FPJtx2STX-2BpF5A6td-2FPvSZFHfZnIH7Pkuotsj40dgSYlEHnY3fa8hwUfXcZx2zIMi9ygf9fvrncbz9LZ035WDZixEDGKJm-2BkA-2FlNNw4vjG8qChO-2Fsn3KGwsVc2B46OlL-2BawwYWOieMWWWlm44I8px-2BoB-2BuIPoEApB2C1WKE6DZ0qI9OL3nk2Lf6cdMA-3D-3D

To manage Coverity Scan email notifications for "richard@nod.at", click 
https://u2389337.ct.sendgrid.net/wf/click?
upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRbVDbis712qZDP-2FA8y06Nq4PW1q5HE7hT0R7FQopI50uMi-2FXxBV9hqQbIHwUk8i5vtfR-2BsAt7Vmc5VhhK-2BFpW3LXtshV-2BNRMG6fEVAWxE0JubBijVgPqNmrGAZeWjyxZKc-3D_p9c2Pq5BRWXelYclnUuZY8l3SYc-2FPJtx2STX-2BpF5A6td-2FPvSZFHfZnIH7PkuotsjtjhWtoA3IVRL5bV1R9qiwG4cqA-2FKu4HHy-2FY11gvyLcPSbxHkMq75abGzuiZVVK-2BoMEddCyVJkKCXyuwR33GIGAu-2F-2BxMohkiXZLfEkTEF4Cq4rSxCKccF8nqIWYFGjwP7kzyOHAH5cWC2z4YWNyegGg-3D-3D


-------------------------------------------------------------

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Fw: New Defects reported by Coverity Scan for Linux
@ 2015-11-03 16:18 Stephen Hemminger
  2015-11-03 19:32 ` Jon Maloy
  0 siblings, 1 reply; 13+ messages in thread
From: Stephen Hemminger @ 2015-11-03 16:18 UTC (permalink / raw)
  To: Jon Maloy, Ying Xue; +Cc: netdev

The TIPC case is a missing check for memory allocation failure.


Begin forwarded message:

Date: Mon, 02 Nov 2015 23:45:55 -0800
From: scan-admin@coverity.com
To: stephen@networkplumber.org
Subject: New Defects reported by Coverity Scan for Linux



Hi,

Please find the latest report on new defect(s) introduced to Linux found with Coverity Scan.

4 new defect(s) introduced to Linux found with Coverity Scan.
9 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 4 of 4 defect(s)


** CID 1338065:  Error handling issues  (CHECKED_RETURN)
/net/tipc/udp_media.c: 162 in tipc_udp_send_msg()


________________________________________________________________________________________________________
*** CID 1338065:  Error handling issues  (CHECKED_RETURN)
/net/tipc/udp_media.c: 162 in tipc_udp_send_msg()
156     	struct udp_media_addr *dst = (struct udp_media_addr *)&dest->value;
157     	struct udp_media_addr *src = (struct udp_media_addr *)&b->addr.value;
158     	struct sk_buff *clone;
159     	struct rtable *rt;
160     
161     	if (skb_headroom(skb) < UDP_MIN_HEADROOM)
>>>     CID 1338065:  Error handling issues  (CHECKED_RETURN)
>>>     Calling "pskb_expand_head" without checking return value (as is done elsewhere 51 out of 56 times).
162     		pskb_expand_head(skb, UDP_MIN_HEADROOM, 0, GFP_ATOMIC);
163     
164     	clone = skb_clone(skb, GFP_ATOMIC);
165     	skb_set_inner_protocol(clone, htons(ETH_P_TIPC));
166     	ub = rcu_dereference_rtnl(b->media_ptr);
167     	if (!ub) {

** CID 1338066:  Null pointer dereferences  (FORWARD_NULL)
/net/openvswitch/flow_netlink.c: 1379 in __ovs_nla_put_key()


________________________________________________________________________________________________________
*** CID 1338066:  Null pointer dereferences  (FORWARD_NULL)
/net/openvswitch/flow_netlink.c: 1379 in __ovs_nla_put_key()
1373     		goto nla_put_failure;
1374     
1375     	if (nla_put_u32(skb, OVS_KEY_ATTR_PRIORITY, output->phy.priority))
1376     		goto nla_put_failure;
1377     
1378     	if ((swkey->tun_key.u.ipv4.dst || is_mask)) {
>>>     CID 1338066:  Null pointer dereferences  (FORWARD_NULL)
>>>     Assigning: "opts" = "NULL".
1379     		const void *opts = NULL;
1380     
1381     		if (output->tun_key.tun_flags & TUNNEL_OPTIONS_PRESENT)
1382     			opts = TUN_METADATA_OPTS(output, swkey->tun_opts_len);
1383     
1384     		if (ipv4_tun_to_nlattr(skb, &output->tun_key, opts,

** CID 1338067:  Integer handling issues  (OVERFLOW_BEFORE_WIDEN)
/drivers/net/ethernet/cavium/thunder/nic_main.c: 407 in nic_config_cpi()


________________________________________________________________________________________________________
*** CID 1338067:  Integer handling issues  (OVERFLOW_BEFORE_WIDEN)
/drivers/net/ethernet/cavium/thunder/nic_main.c: 407 in nic_config_cpi()
401     			nic_reg_write(nic, NIC_PF_CPI_0_2047_CFG | (cpi << 3),
402     				      (vnic << 24) | (padd << 16) |
403     				      (rssi_base + rssi));
404     		} else {
405     			/* Set MPI_ALG to '0' to disable MCAM parsing */
406     			nic_reg_write(nic, NIC_PF_CPI_0_2047_CFG | (cpi << 3),
>>>     CID 1338067:  Integer handling issues  (OVERFLOW_BEFORE_WIDEN)
>>>     Potentially overflowing expression "padd << 16" with type "u32" (32 bits, unsigned) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type "u64" (64 bits, unsigned).
407     				      (padd << 16));
408     			/* MPI index is same as CPI if MPI_ALG is not enabled */
409     			nic_reg_write(nic, NIC_PF_MPI_0_2047_CFG | (cpi << 3),
410     				      (vnic << 24) | (rssi_base + rssi));
411     		}
412     

** CID 1338068:  Null pointer dereferences  (REVERSE_INULL)
/include/net/dst_metadata.h: 69 in tun_dst_unclone()


________________________________________________________________________________________________________
*** CID 1338068:  Null pointer dereferences  (REVERSE_INULL)
/include/net/dst_metadata.h: 69 in tun_dst_unclone()
63     static inline struct metadata_dst *tun_dst_unclone(struct sk_buff *skb)
64     {
65     	struct metadata_dst *md_dst = skb_metadata_dst(skb);
66     	int md_size = md_dst->u.tun_info.options_len;
67     	struct metadata_dst *new_md;
68     
>>>     CID 1338068:  Null pointer dereferences  (REVERSE_INULL)
>>>     Null-checking "md_dst" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
69     	if (!md_dst)
70     		return ERR_PTR(-EINVAL);
71     
72     	new_md = metadata_dst_alloc(md_size, GFP_ATOMIC);
73     	if (!new_md)
74     		return ERR_PTR(-ENOMEM);


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://scan.coverity.com/projects/linux?tab=overview

To manage Coverity Scan email notifications for "stephen@networkplumber.org", click https://scan.coverity.com/subscriptions/edit?email=stephen%40networkplumber.org&token=41b352b884ef3fc73426635eebc294c3

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

end of thread, other threads:[~2021-06-21 14:14 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <6020c2368a549_2dfbcf2b02da5acf501000c7@prd-scan-dashboard-0.mail>
2021-02-08 16:26 ` New Defects reported by Coverity Scan for Linux Bjorn Helgaas
2021-02-08 22:19   ` Krzysztof Wilczyński
     [not found] <60d0439a1c15c_16db9f2ab48dcf79b875634@prd-scan-dashboard-0.mail>
2021-06-21 12:44 ` Bjorn Helgaas
2021-06-21 13:05   ` Bjorn Helgaas
2021-06-21 14:14     ` Om Prakash Singh
2020-11-10 17:16 Bjorn Helgaas
2020-11-10 23:36 ` Gustavo Pimentel
2020-11-11 15:34   ` Rob Herring
2020-11-11 21:06     ` Bjorn Helgaas
2020-11-11 22:10       ` Rob Herring
  -- strict thread matches above, loose matches on Subject: below --
2017-11-27 13:22 Fwd: " Richard Weinberger
2017-11-27 14:19 ` Andrea Adami
2017-11-27 14:23   ` Richard Weinberger
2015-11-03 16:18 Fw: " Stephen Hemminger
2015-11-03 19:32 ` Jon Maloy

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.