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 X-Spam-Level: X-Spam-Status: No, score=-7.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0947C433F5 for ; Mon, 6 Sep 2021 15:24:00 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 3114D6054F for ; Mon, 6 Sep 2021 15:23:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3114D6054F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 61320831F5; Mon, 6 Sep 2021 17:23:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (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="QFKr/Pow"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B1E4F831F5; Mon, 6 Sep 2021 17:23:55 +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 C60C482DF6 for ; Mon, 6 Sep 2021 17:23:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (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 d11so5677522qtw.3 for ; Mon, 06 Sep 2021 08:23:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=pmgKWth5GdE6mWgU6ftKBBjbStImgity52SqElulNiI=; b=QFKr/PowsQdDi8keqcLpBphAkTB+C9kJ8jTauxP45/i7iC2pVWzNvHXq2iJlPZH6Nk xYr2hYFoxcf8VwhUMURx8m+ZC6d8rlx4kureLvOZnw4RRi/0dLLdqSryILkhUEdKf0sJ cJTn1XOyV/iLyNaYQ/w9BaxmxBSWlh2nwhgbI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=pmgKWth5GdE6mWgU6ftKBBjbStImgity52SqElulNiI=; b=MWd1vH8k6tvzNacqpiJ6iTQF7PQ74p+ig5QEr22J71C77GWFZG9Ri7SFiqakrM6zw3 fkqWvJezGwry9MsXmlmszffzPJSgfwVLKrY0rl0S/P5OarLLEstCo7DD5MuwgmGBMwfo rHvE4bPESmJKzZtIqjgt/9YRMYiNf1NCpLVyEY+HYUdb/NjnbiP5l59o+cZtLCw6pEak +mKP7dYciR+boZ8JTbsm/CKypdZsuMBvFIlsU5N/NLM7+LYDmuhBc7HkKdYd/PAwujiw zMzGqMyuBDV3LPgSlcWyxEtKo9AczS2Dd7ZdRd9ZOVZ6EQXv6aD6Z5aj+eN+QC5FmJOd mgXQ== X-Gm-Message-State: AOAM531nMpEeFxlk51yPDownxnCal04wR5AEJw1RA1EMNWsPEvV4yRUu O+HPm5nKX4vwvkB9UVfwBoXmVlhvBxusqaMC X-Google-Smtp-Source: ABdhPJwVgDddTdAwCOLZyKavk2NT6mxkM2C5v/2Kz4tFWyfRtaYPmfRZPGzHAFrXixGGdb7IYYHSiA== X-Received: by 2002:ac8:4b6c:: with SMTP id g12mr11415194qts.170.1630941830475; Mon, 06 Sep 2021 08:23:50 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-f0af-7dea-fd8a-f044.res6.spectrum.com. [2603:6081:7b01:cbda:f0af:7dea:fd8a:f044]) by smtp.gmail.com with ESMTPSA id y29sm5722959qtm.4.2021.09.06.08.23.48 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Sep 2021 08:23:49 -0700 (PDT) Date: Mon, 6 Sep 2021 11:23:47 -0400 From: Tom Rini To: Oleh Kravchenko Cc: u-boot@lists.denx.de Subject: Re: [scan-admin@coverity.com: New Defects reported by Coverity Scan for Das U-Boot] Message-ID: <20210906152347.GN12964@bill-the-cat> References: <20210830173900.GE858@bill-the-cat> <3a339966-4823-0b4b-1e7b-b65d0c1049cf@kaa.org.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="E0h0CbphJD8hN+Gf" Content-Disposition: inline In-Reply-To: <3a339966-4823-0b4b-1e7b-b65d0c1049cf@kaa.org.ua> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean --E0h0CbphJD8hN+Gf Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 06, 2021 at 05:05:40PM +0300, Oleh Kravchenko wrote: > Hello Tom! >=20 > Looks like it a false positive detection. > info and dev_desc are validated in few lines above: >=20 > 609 |=C2=A0=C2=A0=C2=A0 if (!info.name[0] && > 610 |=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 fastboot_mmc_get_part_info(cmd= , &dev_desc, &info, response) > < 0) > 611 |=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 return; Thanks for reviewing! I've updated the CIDs. >=20 > 30.08.21 20:39, Tom Rini =D0=BF=D0=B8=D1=88=D0=B5: >=20 > > Hey all, > > > > Here's the latest report. > > > > ----- Forwarded message from scan-admin@coverity.com ----- > > > > Date: Mon, 30 Aug 2021 16:58:54 +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. > > > > > > New defect(s) Reported-by: Coverity Scan > > Showing 2 of 2 defect(s) > > > > > > ** CID 338648: Memory - illegal accesses (UNINIT) > > /drivers/fastboot/fb_mmc.c: 618 in fastboot_mmc_flash_write() > > > > > > _______________________________________________________________________= _________________________________ > > *** CID 338648: Memory - illegal accesses (UNINIT) > > /drivers/fastboot/fb_mmc.c: 618 in fastboot_mmc_flash_write() > > 612 =20 > > 613 if (is_sparse_image(download_buffer)) { > > 614 struct fb_mmc_sparse sparse_priv; > > 615 struct sparse_storage sparse; > > 616 int err; > > 617 =20 > >>>> CID 338648: Memory - illegal accesses (UNINIT) > >>>> Using uninitialized value "dev_desc". > > 618 sparse_priv.dev_desc =3D dev_desc; > > 619 =20 > > 620 sparse.blksz =3D info.blksz; > > 621 sparse.start =3D info.start; > > 622 sparse.size =3D info.size; > > 623 sparse.write =3D fb_mmc_sparse_write; > > > > ** CID 338647: Integer handling issues (DIVIDE_BY_ZERO) > > > > > > _______________________________________________________________________= _________________________________ > > *** CID 338647: Integer handling issues (DIVIDE_BY_ZERO) > > /drivers/fastboot/fb_mmc.c: 631 in fastboot_mmc_flash_write() > > 625 sparse.mssg =3D fastboot_fail; > > 626 =20 > > 627 printf("Flashing sparse image at offset " LBAFU "\n", > > 628 sparse.start); > > 629 =20 > > 630 sparse.priv =3D &sparse_priv; > >>>> CID 338647: Integer handling issues (DIVIDE_BY_ZERO) > >>>> In function call "write_sparse_image", division by expression "s= parse.blksz" which may be zero has undefined behavior. > > 631 err =3D write_sparse_image(&sparse, cmd, download_buffer, > > 632 response); > > 633 if (!err) > > 634 fastboot_okay(NULL, response); > > 635 } else { > > 636 write_raw_image(dev_desc, &info, cmd, download_buffer, > > > > > > _______________________________________________________________________= _________________________________ > > To view the defects in Coverity Scan visit, https://u15810271.ct.sendgr= id.net/ls/click?upn=3DHRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50yoA22WlOQ-= 2By3ieUvdbKmOyw68TMVT4Kip-2BBzfOGWXJ5yIiYplmPF9KAnKIja4Zd7tU-3DB0R5_EEm8SbL= gSDsaDZif-2Bv7ch8WqhKpLoKErHi4nXpwDNTsWpxO-2FB72i0SdTN3-2BHFJyiYovM6CPwd6hE= 024NqoJv2G1PZTeHMVC9jxFLJgI9alL1SVy-2FumNUJ7wQLM0LhmayO628LnXGSp6-2BQxL8eWM= nX8DfYwdG1iiYjTCUb6p6N4KZqayMpDRL0dNo-2FZrxTT-2FAz2SR1H1kktB9lp0iaajH-2BQ-3= D-3D > > > > To manage Coverity Scan email notifications for "tom.rini@gmail.com",= click https://u15810271.ct.sendgrid.net/ls/click?upn=3DHRESupC-2F2Czv4BOaC= WWCy7my0P0qcxCbhZ31OYv50yped04pjJnmXOsUBtKYNIXxWeIHzDeopm-2BEWQ6S6K-2FtUHv9= ZTk8qZbuzkkz9sa-2BJFw4elYDyedRVZOC-2ButxjBZdouVmTGuWB6Aj6G7lm7t25-2Biv1B-2B= 9082pHzCCex2kqMs-3DiOdo_EEm8SbLgSDsaDZif-2Bv7ch8WqhKpLoKErHi4nXpwDNTsWpxO-2= FB72i0SdTN3-2BHFJyiTVHAVBb1e5w6-2BMjbd4JHjfrBraKGFtJ28aslex2Dq-2BGKoKqFa9LX= DqSXKh1T4x2FIG8bOrMBw8qOG48BL8SGCU5Fh4Mz3heVvRktq2Dv-2Bu-2Fb8WoqCxYHUiUWEtr= XPETG439ARsKn2eC80b78pwPIaQ-3D-3D > > > > > > ----- End forwarded message ----- > > --=20 Tom --E0h0CbphJD8hN+Gf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmE2MoAACgkQFHw5/5Y0 tyw1JgwAoCceacYuzh5v/uc8Uzfyce6GfXVcL3L3mjMTOm1xacabkekgbcywcJ3D EOBHvqPTpqGjbxEXlyegEpdBbySIX3IL+01WPY++PGc76Wah29rZYODGtXTTP1O6 9EwkthEz21RK4qgSPVoNZPYPGrqRNZ8SH68HZSYGotSk9aDFd9k1i5yGhjff35JZ eNQUk5r6UXVJq/U2+BjjsbEhl75gOU7K/ypMv997Xui9oOVLkhvVcYvZ3jiBaC5x ChH38UMY5uFrhwiySjgK2Rrs+lApBLgyqEYFjmzGKQ0nNICUpmBxrYtvEPxK72Fv pSKt81WcUOoqg6bBRSmTJMtgQTofO4mbppUHupKRyr46Al3hnDL6HtaqNy2k5DvW nrLYy7IpNvMUCad3G9CB/52xjtfh/lZ4h2nY7HubPTVzJ2jSN9mv2T+uhgoE9WZC uz7AhFST27pj1w+Q1d2Ox0stUE4u5/jW0QzwKfVsIg+M/pD8Yn23eC0zTMCqmQMZ jsJ22S1g =Y5G4 -----END PGP SIGNATURE----- --E0h0CbphJD8hN+Gf--