U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de, Ilias Apalodimas <ilias.apalodimas@linaro.org>
Subject: [scan-admin@coverity.com: New Defects reported by Coverity Scan for Das U-Boot]
Date: Tue, 6 Sep 2022 11:50:31 -0400	[thread overview]
Message-ID: <20220906155031.GA4152193@bill-the-cat> (raw)

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

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

Date: Tue, 06 Sep 2022 01:07:45 +0000 (UTC)
From: scan-admin@coverity.com
To: tom.rini@gmail.com
Subject: New Defects reported by Coverity Scan for Das U-Boot

Hi,

Please find the latest report on new defect(s) introduced to Das U-Boot found with Coverity Scan.

2 new defect(s) introduced to Das U-Boot found with Coverity Scan.
2 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 2 of 2 defect(s)


** CID 356664:  API usage errors  (BUFFER_SIZE)
/lib/tpm-v2.c: 703 in tpm2_report_state()


________________________________________________________________________________________________________
*** CID 356664:  API usage errors  (BUFFER_SIZE)
/lib/tpm-v2.c: 703 in tpm2_report_state()
697     	log_debug("ret=%s, %x\n", dev->name, ret);
698     	if (ret)
699     		return ret;
700     	if (*recv_size < 12)
701     		return -ENODATA;
702     	*recv_size -= 12;
>>>     CID 356664:  API usage errors  (BUFFER_SIZE)
>>>     The source buffer "recvbuf + 12" potentially overlaps with the destination buffer "recvbuf", which results in undefined behavior for "memcpy".
703     	memcpy(recvbuf, recvbuf + 12, *recv_size);
704     
705     	return 0;
706     }
707     
708     u32 tpm2_enable_nvcommits(struct udevice *dev, uint vendor_cmd,

** CID 183377:    (TAINTED_SCALAR)
/drivers/tpm/tpm2_tis_sandbox.c: 735 in sandbox_tpm2_xfer()
/drivers/tpm/tpm2_tis_sandbox.c: 586 in sandbox_tpm2_xfer()


________________________________________________________________________________________________________
*** CID 183377:    (TAINTED_SCALAR)
/drivers/tpm/tpm2_tis_sandbox.c: 735 in sandbox_tpm2_xfer()
729     		seq = sb_tpm_index_to_seq(index);
730     		if (seq < 0)
731     			return log_msg_ret("index", -EINVAL);
732     		printf("tpm: nvread index=%#02x, len=%#02x, seq=%#02x\n", index,
733     		       length, seq);
734     		*recv_len = TPM2_HDR_LEN + 6 + length;
>>>     CID 183377:    (TAINTED_SCALAR)
>>>     Passing tainted expression "*recv_len" to "memset", which uses it as an offset. [Note: The source code implementation of the function has been overridden by a builtin model.]
735     		memset(recvbuf, '\0', *recv_len);
736     		put_unaligned_be32(length, recvbuf + 2);
737     		sb_tpm_read_data(tpm->nvdata, seq, recvbuf,
738     				 TPM2_HDR_LEN + 4 + 2, length);
739     		break;
740     	}
/drivers/tpm/tpm2_tis_sandbox.c: 586 in sandbox_tpm2_xfer()
580     
581     		/* Give the number of properties that follow */
582     		put_unaligned_be32(property_count, recv);
583     		recv += sizeof(property_count);
584     
585     		/* Fill with the properties */
>>>     CID 183377:    (TAINTED_SCALAR)
>>>     Using tainted variable "property_count" as a loop boundary.
586     		for (i = 0; i < property_count; i++) {
587     			put_unaligned_be32(TPM2_PROPERTIES_OFFSET + property +
588     					   i, recv);
589     			recv += sizeof(property);
590     			put_unaligned_be32(tpm->properties[property + i],
591     					   recv);


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50yoA22WlOQ-2By3ieUvdbKmOyw68TMVT4Kip-2BBzfOGWXJ5yIiYplmPF9KAnKIja4Zd7tU-3D4Xh0_EEm8SbLgSDsaDZif-2Bv7ch8WqhKpLoKErHi4nXpwDNTtsqJ39YESEW2nKPYCMHF70wsixkMVibSCjQ-2FGaGw5huIkg7-2FWaEDzqOUGcMyrbAAtsYzFGNDW0J6oj0eM4yvinWio8GHNygWR2n19gx10LjZwDEeBkQkwqkhNLGzEBh5ka4haIShtRdBfXm97-2BH2LxChYnqy6cvN-2BxDI2jW9HZJA-3D-3D

  To manage Coverity Scan email notifications for "tom.rini@gmail.com", click https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50yped04pjJnmXOsUBtKYNIXxWeIHzDeopm-2BEWQ6S6K-2FtUHv9ZTk8qZbuzkkz9sa-2BJFzf226DuRd-2B2ygQlLnerl-2BA3jN1AOYejXZ-2FNZ62waJHedPFGpqqjTx8fawy9KPJBno-3DsyQ2_EEm8SbLgSDsaDZif-2Bv7ch8WqhKpLoKErHi4nXpwDNTtsqJ39YESEW2nKPYCMHF700mhadf4YcMAqAcj9oPFjTlJ2s4EcIQU2bFVkOb10WKv-2FZ2t9vT4MUzH6ZOeXZ7qzOdr4JI8cQEPg4D8Tf3kLp0qolYqirx5tuUYCJh6JJ8ik6zvle859z9fd8Tb07Eb4SVxS10DXjSaXXriNevOzvQ-3D-3D


----- End forwarded message -----

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

             reply	other threads:[~2022-09-06 15:50 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-06 15:50 Tom Rini [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-05-09 17:22 [scan-admin@coverity.com: New Defects reported by Coverity Scan for Das U-Boot] Tom Rini
2022-04-25 23:41 Tom Rini
2022-03-05 18:27 Tom Rini
2022-02-15 19:29 Tom Rini
2022-02-01  0:33 Tom Rini
2021-11-15 18:02 Tom Rini
2021-11-02 16:22 Tom Rini
2021-11-01 20:06 Tom Rini
2021-09-15 14:11 Tom Rini
2021-08-30 17:39 Tom Rini
2021-08-31 15:18 ` Oleh Kravchenko
2021-09-06 14:05 ` Oleh Kravchenko
2021-09-06 15:23   ` Tom Rini
2021-08-16 19:57 Tom Rini
2021-08-16 20:15 ` Pali Rohár
2021-08-16 20:20   ` Tom Rini
2021-07-27  2:52 Tom Rini
2021-07-27  3:26 ` Sean Anderson
2021-07-27 15:04   ` Tom Rini
2021-05-26 16:58 Tom Rini
2021-05-12 22:30 Tom Rini
2021-04-19 12:20 Tom Rini
2021-04-20  0:58 ` Asherah Connor
2021-04-20  1:17   ` Tom Rini
2021-04-20  6:13 ` Dario Binacchi
2021-03-30 19:55 Tom Rini
2021-03-02 14:42 Tom Rini
2021-02-23 16:15 Tom Rini
2021-02-01 19:51 Tom Rini
2021-01-26 16:41 Tom Rini
2021-01-20 19:04 Tom Rini
2021-01-20 20:43 ` Heinrich Schuchardt
2021-01-20 22:33   ` Heinrich Schuchardt
2021-01-21  2:09   ` AKASHI Takahiro
2021-01-26 17:02     ` Tom Rini
2021-01-20 21:03 ` Andre Przywara
2021-01-20 21:34   ` Tom Rini
2021-01-21 11:36 ` Sughosh Ganu
2021-01-21 13:44   ` Heinrich Schuchardt
2021-01-22  8:54     ` Sughosh Ganu
2021-01-22 11:37       ` Heinrich Schuchardt
2020-12-03 17:28 Tom Rini
2020-11-10 21:18 Tom Rini
2020-10-30 19:16 Tom Rini
2020-11-02 11:54 ` Pratyush Yadav

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=20220906155031.GA4152193@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=u-boot@lists.denx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox