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 3D1A7C00140 for ; Wed, 24 Aug 2022 11:40:16 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 299BD844F4; Wed, 24 Aug 2022 13:40:14 +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="rNzP7hlr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6DAD8844F4; Wed, 24 Aug 2022 13:40:12 +0200 (CEST) Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) (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 A8B9F84314 for ; Wed, 24 Aug 2022 13:40:08 +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-qt1-x82d.google.com with SMTP id g14so2909396qto.11 for ; Wed, 24 Aug 2022 04:40:08 -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; bh=Cn6Y6xopeFl9NUm/n/L+S8pNfILGppyw6BJhKgC0++A=; b=rNzP7hlrTcoZqcnK+7AxYtusB2PjtiBPQgZINwlFU86PDvJlXbyILs3rSrJi98Hcwv 1mOupNhYxv79k9H1ysEJlqkRDl+mAg4FOZRwi7SALc1AiX1kBRep0vmfSssxkz/2CzJe QM/IOFWUZy8AeQBcNnblwsN5kZXCauX1QSiOw= 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; bh=Cn6Y6xopeFl9NUm/n/L+S8pNfILGppyw6BJhKgC0++A=; b=lzGx48/xUu07HzuP6Jtjc3CKgJhkdFgi7NSp+22/rLd/c0CutrB01k1SzEfGtyUbhv XQ1kllkgazfoK3j641TDhkfCcgv1eCO6MPiYN7cIfeeACBCs/YaivxtbFaqtSlEQsTjJ 7Kk9YHKCrNLhlZdtAKs2hf+o293IWXFoIiN1PPCAIRrM10u3SL4knlYXZLaU/byc+g6B 3B3x9m6fUMq13pi6+W6IjUV9Nlbk0nnZWBxzPd2uPXZEH+73FqZtnUry9PoMkXS6Fw71 swPQ61avWC61Pe3ic9WRwlkOMQ8/yoE2SUWnUiDBqoL93SFbk04p5VyJMnfJRz2wVcVQ Z0mw== X-Gm-Message-State: ACgBeo35isMXGzGYK445V+lqGn5V4xGhzBoLhW1Vf3zp4dqhennBqUMg 74n8nlbaHO3IcRMUX1N0iwvWRTnxy6MDrkB+ X-Google-Smtp-Source: AA6agR540gmKrLwx9/fEzmw56HpQMaQoJXsa+aidInfnoJovZ84JkxX2vrE/3iSm/MHKjytR+49VEg== X-Received: by 2002:ac8:5fcc:0:b0:343:4dd6:b388 with SMTP id k12-20020ac85fcc000000b003434dd6b388mr23412530qta.586.1661341206565; Wed, 24 Aug 2022 04:40:06 -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 u7-20020a37ab07000000b006b9bf03d9c6sm14064962qke.104.2022.08.24.04.40.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 04:40:02 -0700 (PDT) Date: Wed, 24 Aug 2022 07:40:00 -0400 From: Tom Rini To: u-boot@lists.denx.de, Simon Glass Subject: [tom.rini@gmail.com: Fwd: New Defects reported by Coverity Scan for Das U-Boot] Message-ID: <20220824114000.GH1146598@bill-the-cat> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="WnFraOmh4XwCvy81" 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 --WnFraOmh4XwCvy81 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable A bit behind on forwarding these along. ----- Forwarded message from Tom Rini ----- Date: Wed, 24 Aug 2022 07:38:46 -0400 =46rom: Tom Rini To: trini@konsulko.com Subject: Fwd: New Defects reported by Coverity Scan for Das U-Boot ---------- Forwarded message --------- =46rom: Date: Mon, Aug 8, 2022 at 8:51 PM Subject: New Defects reported by Coverity Scan for Das U-Boot To: Hi, Please find the latest report on new defect(s) introduced to Das U-Boot found with Coverity Scan. 6 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 6 of 6 defect(s) ** CID 355771: (PRINTF_ARGS) ___________________________________________________________________________= _____________________________ *** CID 355771: (PRINTF_ARGS) /test/cmd/fdt.c: 72 in fdt_test_addr() 66 ut_assertok(run_command("fdt addr", 0)); 67 ut_assert_nextline("Working fdt: %08lx", (ulong)map_to_sysmem(fdt)); 68 ut_assertok(ut_check_console_end(uts)); 69 70 /* Set the working FDT */ 71 set_working_fdt_addr(0); >>> CID 355771: (PRINTF_ARGS) >>> Argument "addr" to format specifier "%08x" was expected to have typ= e "unsigned int" but has type "unsigned long". 72 ut_assertok(run_commandf("fdt addr %08x", addr)); 73 ut_asserteq(addr, map_to_sysmem(working_fdt)); 74 ut_assertok(ut_check_console_end(uts)); 75 set_working_fdt_addr(0); 76 77 /* Set the working FDT */ /test/cmd/fdt.c: 89 in fdt_test_addr() 83 ut_assertok(ret); 84 ut_asserteq(addr, map_to_sysmem(new_fdt)); 85 ut_assertok(ut_check_console_end(uts)); 86 87 /* Test setting an invalid FDT */ 88 fdt[0] =3D 123; >>> CID 355771: (PRINTF_ARGS) >>> Argument "addr" to format specifier "%08x" was expected to have typ= e "unsigned int" but has type "unsigned long". 89 ut_asserteq(1, run_commandf("fdt addr %08x", addr)); 90 ut_assert_nextline("libfdt fdt_check_header(): FDT_ERR_BADMAGIC"); 91 ut_assertok(ut_check_console_end(uts)); 92 93 /* Test detecting an invalid FDT */ 94 fdt[0] =3D 123; /test/cmd/fdt.c: 80 in fdt_test_addr() 74 ut_assertok(ut_check_console_end(uts)); 75 set_working_fdt_addr(0); 76 77 /* Set the working FDT */ 78 fdt_blob =3D gd->fdt_blob; 79 gd->fdt_blob =3D NULL; >>> CID 355771: (PRINTF_ARGS) >>> Argument "addr" to format specifier "%08x" was expected to have typ= e "unsigned int" but has type "unsigned long". 80 ret =3D run_commandf("fdt addr -c %08x", addr); 81 new_fdt =3D gd->fdt_blob; 82 gd->fdt_blob =3D fdt_blob; 83 ut_assertok(ret); 84 ut_asserteq(addr, map_to_sysmem(new_fdt)); 85 ut_assertok(ut_check_console_end(uts)); ** CID 355770: Insecure data handling (TAINTED_SCALAR) ___________________________________________________________________________= _____________________________ *** CID 355770: Insecure data handling (TAINTED_SCALAR) /test/cmd/fdt.c: 37 in make_test_fdt() 31 static int make_test_fdt(struct unit_test_state *uts, void *fdt, int size) 32 { 33 ut_assertok(fdt_create(fdt, size)); 34 ut_assertok(fdt_finish_reservemap(fdt)); 35 ut_assert(fdt_begin_node(fdt, "") >=3D 0); 36 ut_assertok(fdt_end_node(fdt)); >>> CID 355770: Insecure data handling (TAINTED_SCALAR) >>> Passing tainted expression "fdt->size_dt_strings" to "fdt_finish", = which uses it as an offset. 37 ut_assertok(fdt_finish(fdt)); 38 39 return 0; 40 } 41 42 /* Test 'fdt addr' getting/setting address */ ** CID 355769: (PRINTF_ARGS) ___________________________________________________________________________= _____________________________ *** CID 355769: (PRINTF_ARGS) /test/cmd/fdt.c: 121 in fdt_test_resize() 115 /* Test setting and resizing the working FDT to a larger si= ze */ 116 ut_assertok(console_record_reset_enable()); 117 ut_assertok(run_commandf("fdt addr %08x %x", addr, newsize)= ); 118 ut_assertok(ut_check_console_end(uts)); 119 120 /* Try shrinking it */ >>> CID 355769: (PRINTF_ARGS) >>> Argument "addr" to format specifier "%08x" was expected to have typ= e "unsigned int" but has type "unsigned long". 121 ut_assertok(run_commandf("fdt addr %08x %x", addr, sizeof(fdt) / 4)); 122 ut_assert_nextline("New length %d < existing length %d, ignoring", 123 (int)sizeof(fdt) / 4, newsize); 124 ut_assertok(ut_check_console_end(uts)); 125 126 /* ...quietly */ /test/cmd/fdt.c: 127 in fdt_test_resize() 121 ut_assertok(run_commandf("fdt addr %08x %x", addr, sizeof(fdt) / 4)); 122 ut_assert_nextline("New length %d < existing length %d, ignoring", 123 (int)sizeof(fdt) / 4, newsize); 124 ut_assertok(ut_check_console_end(uts)); 125 126 /* ...quietly */ >>> CID 355769: (PRINTF_ARGS) >>> Argument "addr" to format specifier "%08x" was expected to have typ= e "unsigned int" but has type "unsigned long". 127 ut_assertok(run_commandf("fdt addr -q %08x %x", addr, sizeof(fdt) / 4)); 128 ut_assertok(ut_check_console_end(uts)); 129 130 /* We cannot easily provoke errors in fdt_open_into(), so ignore that */ 131 132 return 0; /test/cmd/fdt.c: 117 in fdt_test_resize() 111 ut_assertok(make_test_fdt(uts, fdt, sizeof(fdt))); 112 addr =3D map_to_sysmem(fdt); 113 set_working_fdt_addr(addr); 114 115 /* Test setting and resizing the working FDT to a larger si= ze */ 116 ut_assertok(console_record_reset_enable()); >>> CID 355769: (PRINTF_ARGS) >>> Argument "addr" to format specifier "%08x" was expected to have typ= e "unsigned int" but has type "unsigned long". 117 ut_assertok(run_commandf("fdt addr %08x %x", addr, newsize)= ); 118 ut_assertok(ut_check_console_end(uts)); 119 120 /* Try shrinking it */ 121 ut_assertok(run_commandf("fdt addr %08x %x", addr, sizeof(fdt) / 4)); 122 ut_assert_nextline("New length %d < existing length %d, ignoring", ** CID 355768: Memory - illegal accesses (UNINIT) /drivers/core/lists.c: 252 in lists_bind_fdt() ___________________________________________________________________________= _____________________________ *** CID 355768: Memory - illegal accesses (UNINIT) /drivers/core/lists.c: 252 in lists_bind_fdt() 246 } 247 248 if (entry->of_match) 249 log_debug(" - found match at '%s': '%s' matches '%s'\n", 250 entry->name, entry->of_match->compatible, 251 id->compatible); >>> CID 355768: Memory - illegal accesses (UNINIT) >>> Using uninitialized value "id". 252 ret =3D device_bind_with_driver_data(parent, entry,= name, 253 id->data, node, &dev); 254 if (ret =3D=3D -ENODEV) { 255 log_debug("Driver '%s' refuses to bind\n", entry->name); 256 continue; 257 } ** CID 355767: (OVERRUN) /lib/addr_map.c: 66 in addrmap_set_entry() /lib/addr_map.c: 67 in addrmap_set_entry() /lib/addr_map.c: 65 in addrmap_set_entry() ___________________________________________________________________________= _____________________________ *** CID 355767: (OVERRUN) /lib/addr_map.c: 66 in addrmap_set_entry() 60 phys_size_t size, int idx) 61 { 62 if (idx > CONFIG_SYS_NUM_ADDR_MAP) 63 return; 64 65 address_map[idx].vaddr =3D vaddr; >>> CID 355767: (OVERRUN) >>> Overrunning array "address_map" of 16 16-byte elements at element i= ndex 16 (byte offset 271) using index "idx" (which evaluates to 16). 66 address_map[idx].paddr =3D paddr; 67 address_map[idx].size =3D size; /lib/addr_map.c: 67 in addrmap_set_entry() 61 { 62 if (idx > CONFIG_SYS_NUM_ADDR_MAP) 63 return; 64 65 address_map[idx].vaddr =3D vaddr; 66 address_map[idx].paddr =3D paddr; >>> CID 355767: (OVERRUN) >>> Overrunning array "address_map" of 16 16-byte elements at element i= ndex 16 (byte offset 271) using index "idx" (which evaluates to 16). 67 address_map[idx].size =3D size; /lib/addr_map.c: 65 in addrmap_set_entry() 59 void addrmap_set_entry(unsigned long vaddr, phys_addr_t paddr, 60 phys_size_t size, int idx) 61 { 62 if (idx > CONFIG_SYS_NUM_ADDR_MAP) 63 return; 64 >>> CID 355767: (OVERRUN) >>> Overrunning array "address_map" of 16 16-byte elements at element i= ndex 16 (byte offset 271) using index "idx" (which evaluates to 16). 65 address_map[idx].vaddr =3D vaddr; 66 address_map[idx].paddr =3D paddr; 67 address_map[idx].size =3D size; ** CID 355766: (PRINTF_ARGS) ___________________________________________________________________________= _____________________________ *** CID 355766: (PRINTF_ARGS) /test/cmd/fdt.c: 121 in fdt_test_resize() 115 /* Test setting and resizing the working FDT to a larger si= ze */ 116 ut_assertok(console_record_reset_enable()); 117 ut_assertok(run_commandf("fdt addr %08x %x", addr, newsize)= ); 118 ut_assertok(ut_check_console_end(uts)); 119 120 /* Try shrinking it */ >>> CID 355766: (PRINTF_ARGS) >>> Argument "64UL" to format specifier "%x" was expected to have type = "unsigned int" but has type "unsigned long". 121 ut_assertok(run_commandf("fdt addr %08x %x", addr, sizeof(fdt) / 4)); 122 ut_assert_nextline("New length %d < existing length %d, ignoring", 123 (int)sizeof(fdt) / 4, newsize); 124 ut_assertok(ut_check_console_end(uts)); 125 126 /* ...quietly */ /test/cmd/fdt.c: 127 in fdt_test_resize() 121 ut_assertok(run_commandf("fdt addr %08x %x", addr, sizeof(fdt) / 4)); 122 ut_assert_nextline("New length %d < existing length %d, ignoring", 123 (int)sizeof(fdt) / 4, newsize); 124 ut_assertok(ut_check_console_end(uts)); 125 126 /* ...quietly */ >>> CID 355766: (PRINTF_ARGS) >>> Argument "64UL" to format specifier "%x" was expected to have type = "unsigned int" but has type "unsigned long". 127 ut_assertok(run_commandf("fdt addr -q %08x %x", addr, sizeof(fdt) / 4)); 128 ut_assertok(ut_check_console_end(uts)); 129 130 /* We cannot easily provoke errors in fdt_open_into(), so ignore that */ 131 132 return 0; ___________________________________________________________________________= _____________________________ To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=3DHRESupC-2F2Czv4BOaCWWCy7my= 0P0qcxCbhZ31OYv50yoA22WlOQ-2By3ieUvdbKmOyw68TMVT4Kip-2BBzfOGWXJ5yIiYplmPF9K= AnKIja4Zd7tU-3DqIQf_EEm8SbLgSDsaDZif-2Bv7ch8WqhKpLoKErHi4nXpwDNTsut95EuJ1dF= 4QhvWDPMPg-2FzMzS9KRhGAV1f-2FUmmbNbALbLgedwSxyHFzv40zBZbQ-2BXdxVQrhyzuPqo1U= 5lwMDREo6ylUvUQ2f0J7eVecTS1Gig-2FQwwd7N1OvprpUa-2BpHy38-2BCNKgrt9q-2Fn03k8f= 5ttSRxORtyDMKSuD38GNNRlqw-3D-3D To manage Coverity Scan email notifications for "tom.rini@gmail.com", click https://u15810271.ct.sendgrid.net/ls/click?upn=3DHRESupC-2F2Czv4BOaCWWCy7my= 0P0qcxCbhZ31OYv50yped04pjJnmXOsUBtKYNIXxWeIHzDeopm-2BEWQ6S6K-2FtUHv9ZTk8qZb= uzkkz9sa-2BJFzf226DuRd-2B2ygQlLnerl-2BA3jN1AOYejXZ-2FNZ62waJHedPFGpqqjTx8fa= wy9KPJBno-3DnIoA_EEm8SbLgSDsaDZif-2Bv7ch8WqhKpLoKErHi4nXpwDNTsut95EuJ1dF4Qh= vWDPMPg-2FMDA5j8o4o-2Bl7QSWv-2Fdquz5Ay0IUrCqd-2B1tBatlmw-2Bk6r7mDQmU6vjrCms= I0TrpSErVm17PM3p-2FVCVAk8-2FYnP-2B4Nf-2F0gam9xYjGZmoklMOMo7wgiMoo2HKgeyxJ3k= 66OEFYIC-2BDgf2IdTUhB-2FuHnR4A-3D-3D --=20 Tom ----- End forwarded message ----- --=20 Tom --WnFraOmh4XwCvy81 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmMGDgwACgkQFHw5/5Y0 tyzdcQv9GSVvbNN9BSVF/D52gdZislbaX/wehvzUjMen3nD9i+E572xQLmspGb62 3d+mldQ8siY767kMk4JJ/Pf4fKV/PDbLVtjjJYyjsuX+/7oxu0I5LMClkvxIVseg 2PNpKjizFl6ePCvAmR0Jyjxc4W5jyaKfWyFjE5MFqjKGdtH/Mv6m2EijTlg09M9F Z9W/JoiN0YxZ9iGu3dwj0loGZR5ARwxFN1Ep42fedrb2tUo+jE0bHUFDvVq/engD 9Lc1rLzoN7h8DXR4yMo1dyBwZVd5uy7soYojo9H9v0OtLHs34hO8sCO2tBtCBM+8 G8UsE5fw56pNNBTfwtnCiAnMMRXYpr4e+0eZRy1FaRsEXwQBcw4BRjM4OlM3EGR2 LtISMDvREGYJ0H6N+RudXUoM7zK3bBvWsBHnb60RoXnE57KeeWEBn/uyK42KMrZc IhKf5ksX4GVbtJrx4K50uyKwOxEfd6140NlNAnemb6YFFvbLQ3fI8YYSqJ/iwxsx LOgO7RgK =zkmc -----END PGP SIGNATURE----- --WnFraOmh4XwCvy81--