From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9A0C2ECAAD5 for ; Tue, 6 Sep 2022 15:50:42 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5EC56848C2; Tue, 6 Sep 2022 17:50:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="mezjGWAX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B34368498E; Tue, 6 Sep 2022 17:50:38 +0200 (CEST) Received: from mail-qv1-xf31.google.com (mail-qv1-xf31.google.com [IPv6:2607:f8b0:4864:20::f31]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C1E3184873 for ; Tue, 6 Sep 2022 17:50:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qv1-xf31.google.com with SMTP id l5so8590184qvs.13 for ; Tue, 06 Sep 2022 08:50:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=content-disposition:mime-version:message-id:subject:to:from:date :from:to:cc:subject:date; bh=U5gdRsOpRVbahlsGYMUIeX4gHH07qZcezYh3Y+cGWzg=; b=mezjGWAXzPtMxXur9//KJER9rx+Cj58+avBxbe+sigVGnQqhPeXOxkDQyB7GtMaRyJ d4EaXTurDBW3cuT0KtN1rwvpCaAt++Jmc2WeDJ+E5ncnOMXLKuMQ3nDLrmWeAah5M11w WIeoXcB3/TCGcxODUldo9huyNnNuIhmcv442k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date; bh=U5gdRsOpRVbahlsGYMUIeX4gHH07qZcezYh3Y+cGWzg=; b=1Ei3yUwIUcQ/oE/QhF1UDzB1lH1GtbMkVk2TSfvGMQSHNm2NNEJZgKr6I6hfyLxWJm ade3bZAjeuqjaaVFNw9b+BvnIRBPJtmTQrjNYtzhM3O8v0G3umiJRlJV//M2PQFvG7mv MABK9XRrF6DmBjehqPMO0B3at4hrOLYawmFmLhLIyiLjGBAL778qhTM1Lr3g++urSy7x DWaOZpKoaYZI7ekIUGuD8OYPvqFGmDmDtFiDPSAtyKmtdMfZqHbLf7QM2VCMagVWc3lt 4FAcskAgzM/YyIsjMODoR1Ir/Cx99grhQ0HuwSPQSH4JcWtKDpbLV04drluvZ7wnpsLp mK4g== X-Gm-Message-State: ACgBeo38chWgQsVMNjwz13xqAiD4c8ViLk9uXrTDOOlXXYQHsqrMQgNQ EGm2eH6V+kHKhHFq6nry4eIs6zXZ5PhBmQ== X-Google-Smtp-Source: AA6agR64/pzMojubU8NNQJn5Djab3gBXKmlLTPvIROJgdw/6zSTxx/dv7S7Og0x9JwTcU2giiUoK0w== X-Received: by 2002:a05:6214:1c0f:b0:499:9b8:fc1b with SMTP id u15-20020a0562141c0f00b0049909b8fc1bmr35219183qvc.54.1662479434213; Tue, 06 Sep 2022 08:50:34 -0700 (PDT) Received: from bill-the-cat (cpe-65-184-195-139.ec.res.rr.com. [65.184.195.139]) by smtp.gmail.com with ESMTPSA id 15-20020ac84e8f000000b0031f0b43629dsm10293429qtp.23.2022.09.06.08.50.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 08:50:33 -0700 (PDT) Date: Tue, 6 Sep 2022 11:50:31 -0400 From: Tom Rini To: u-boot@lists.denx.de, Ilias Apalodimas Subject: [scan-admin@coverity.com: New Defects reported by Coverity Scan for Das U-Boot] Message-ID: <20220906155031.GA4152193@bill-the-cat> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="AhhlLboLdkugWU4S" Content-Disposition: inline X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean --AhhlLboLdkugWU4S Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable ----- Forwarded message from scan-admin@coverity.com ----- Date: Tue, 06 Sep 2022 01:07:45 +0000 (UTC) =46rom: 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 fou= nd 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 re= cent 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=3D%s, %x\n", dev->name, ret); 698 if (ret) 699 return ret; 700 if (*recv_size < 12) 701 return -ENODATA; 702 *recv_size -=3D 12; >>> CID 356664: API usage errors (BUFFER_SIZE) >>> The source buffer "recvbuf + 12" potentially overlaps with the dest= ination buffer "recvbuf", which results in undefined behavior for "memcpy". 703 memcpy(recvbuf, recvbuf + 12, *recv_size); 704 =20 705 return 0; 706 } 707 =20 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 =3D sb_tpm_index_to_seq(index); 730 if (seq < 0) 731 return log_msg_ret("index", -EINVAL); 732 printf("tpm: nvread index=3D%#02x, len=3D%#02x, seq=3D%#02x\n", i= ndex, 733 length, seq); 734 *recv_len =3D TPM2_HDR_LEN + 6 + length; >>> CID 183377: (TAINTED_SCALAR) >>> Passing tainted expression "*recv_len" to "memset", which uses it a= s 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 =20 581 /* Give the number of properties that follow */ 582 put_unaligned_be32(property_count, recv); 583 recv +=3D sizeof(property_count); 584 =20 585 /* Fill with the properties */ >>> CID 183377: (TAINTED_SCALAR) >>> Using tainted variable "property_count" as a loop boundary. 586 for (i =3D 0; i < property_count; i++) { 587 put_unaligned_be32(TPM2_PROPERTIES_OFFSET + property + 588 i, recv); 589 recv +=3D sizeof(property); 590 put_unaligned_be32(tpm->properties[property + i], 591 recv); ___________________________________________________________________________= _____________________________ To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.n= et/ls/click?upn=3DHRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50yoA22WlOQ-2By3= ieUvdbKmOyw68TMVT4Kip-2BBzfOGWXJ5yIiYplmPF9KAnKIja4Zd7tU-3D4Xh0_EEm8SbLgSDs= aDZif-2Bv7ch8WqhKpLoKErHi4nXpwDNTtsqJ39YESEW2nKPYCMHF70wsixkMVibSCjQ-2FGaGw= 5huIkg7-2FWaEDzqOUGcMyrbAAtsYzFGNDW0J6oj0eM4yvinWio8GHNygWR2n19gx10LjZwDEeB= kQkwqkhNLGzEBh5ka4haIShtRdBfXm97-2BH2LxChYnqy6cvN-2BxDI2jW9HZJA-3D-3D To manage Coverity Scan email notifications for "tom.rini@gmail.com", cli= ck https://u15810271.ct.sendgrid.net/ls/click?upn=3DHRESupC-2F2Czv4BOaCWWCy= 7my0P0qcxCbhZ31OYv50yped04pjJnmXOsUBtKYNIXxWeIHzDeopm-2BEWQ6S6K-2FtUHv9ZTk8= qZbuzkkz9sa-2BJFzf226DuRd-2B2ygQlLnerl-2BA3jN1AOYejXZ-2FNZ62waJHedPFGpqqjTx= 8fawy9KPJBno-3DsyQ2_EEm8SbLgSDsaDZif-2Bv7ch8WqhKpLoKErHi4nXpwDNTtsqJ39YESEW= 2nKPYCMHF700mhadf4YcMAqAcj9oPFjTlJ2s4EcIQU2bFVkOb10WKv-2FZ2t9vT4MUzH6ZOeXZ7= qzOdr4JI8cQEPg4D8Tf3kLp0qolYqirx5tuUYCJh6JJ8ik6zvle859z9fd8Tb07Eb4SVxS10DXj= SaXXriNevOzvQ-3D-3D ----- End forwarded message ----- --=20 Tom --AhhlLboLdkugWU4S Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmMXbEQACgkQFHw5/5Y0 tyxFswv/SO0Kh12M7k1TBKArHbpWPQ35Azz/NVVH0gJdDmDHwwEvwQ8CkNl/HAKV 5lqDerN46eEfTtoGh0oNoMlSf1PBDro/ZSIsWG1DqTX5T9Hib8OKENwqQn+GCGht 53KU9J3A+G2tZCxKQnbz+OLuDlvRflniqoMiRNk5h0JLyyPIt+faMt+SbSNk/3FJ 78ihsliciTzXBOTroS3EppEzr9jy+xWL6uf/LcQ34KZZFdIn2X5ePHcJt3ZVyke9 Vu+WtX/pDK0nCojIzn6oTeMUFMMPgPXpDoxbhKI7YSw2tBkvtfUZcDo49b+4dM+E 4SZsVfOoZSoGnaoC7AaqVGAhatC0pkb5yZh1ov2+dxu0YvzIHOCFQ1rySMW7GkPj dIQlBBMUS6Urg/tuB3o6VFxm1wSXXHAJmCFuTvtug3T4EaNs9EQ35+e36nCqiOHk j3UzwQ36vMRV8Ww6AwaCimjqJy+SN8AktxvGgG1CLXHHazJi6ir2LHNSrLoOA9RS hNlpSknw =z1Ju -----END PGP SIGNATURE----- --AhhlLboLdkugWU4S--