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 BB288C54EE9 for ; Sun, 11 Sep 2022 17:33:32 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5F36C849AA; Sun, 11 Sep 2022 19:33:30 +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="QnnZRT5j"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B00D6849AA; Sun, 11 Sep 2022 19:33:28 +0200 (CEST) Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) (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 411538455E for ; Sun, 11 Sep 2022 19:33:25 +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-x831.google.com with SMTP id cb8so4771253qtb.0 for ; Sun, 11 Sep 2022 10:33:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=+CJCu+JeKXvoBKJP97lC0WH4w+xkCDpVxvmneM/jUDY=; b=QnnZRT5jGdz370X+Q9vdxTn2/PRVHK6weFpeFlvyG5ueJ1yZJT9ESAlFHa74IpvC8s h+emEqyjXnvBA4vnswMZP3rN5oJER5f4FfTWJzKawvvzbSLo6i+608X60K+6r5BAVOZ4 f1ldTRGv62Brozee094kJb3J70NnftLAw8xyo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=+CJCu+JeKXvoBKJP97lC0WH4w+xkCDpVxvmneM/jUDY=; b=zOpVlzyywMFiVx56zKhFf8zAi6nsOpDPqdy8IuE7ha7bK6+gbSsnraG9+iJXVw/i22 cvvcHCT4v6Rf9lpGEsNAFzBVsowpTw83HLAOnql1I0G+nOhz6BH5PP/Brar+BH/M5zBl e+swinAAGCC23vtoAG/w3sYWQVFR+/pZFMf/XBD9OTYn/wTN5XtlOs1OspwGIC3uNj0H ku7tPkogPYkzVN829WL6D5Gf017o8sFVJnZ3bhNvgXZ3qsHDhMKPj6qIQRn3QXI1eM6v Jon7GqcrwZ66JAAtL2MBInm119ITCUG834uFOIjSq5LoW+HS52P546c6vfL5MBNsGLnZ ZIug== X-Gm-Message-State: ACgBeo3JH6ZK6o6qHyg3r+ECrkDxU/Pk6eZ25mCT2amQws5RUYJTygTx mcu3SEB4octrv05rsw1KCHtTPA== X-Google-Smtp-Source: AA6agR75a9MYXbJd2cv8X10damUTx3I/bpTmHO4dFExDpt0npqYcjmBmJTPXoMsCb4iN6bjuuxh0Cw== X-Received: by 2002:a05:622a:547:b0:344:4f17:dd5 with SMTP id m7-20020a05622a054700b003444f170dd5mr20496293qtx.501.1662917603988; Sun, 11 Sep 2022 10:33:23 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b00-6400-65f7-52f5-9172-704b.res6.spectrum.com. [2603:6081:7b00:6400:65f7:52f5:9172:704b]) by smtp.gmail.com with ESMTPSA id s11-20020a05620a29cb00b006b929a56a2bsm5618085qkp.3.2022.09.11.10.33.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Sep 2022 10:33:23 -0700 (PDT) Date: Sun, 11 Sep 2022 13:33:20 -0400 From: Tom Rini To: Sergei Antonov Cc: Jit Loon Lim , u-boot@lists.denx.de, Jagan Teki , Vignesh R , Marek , Simon , Kris , Tien Fong , Kok Kiang , Siew Chin , Sin Hui , Raaj , Dinesh , Boon Khai , Alif , Teik Heng , Hazim , Sieu Mun Tang , Chin Liang See , Mark Adler Subject: Re: [PATCH] lib: zlib: Use post-increment only in inffast.c. Message-ID: <20220911173320.GK1522024@bill-the-cat> References: <20220911084637.21513-1-jit.loon.lim@intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="yZnyZsPjQYjG7xG7" Content-Disposition: inline In-Reply-To: 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 --yZnyZsPjQYjG7xG7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Sep 11, 2022 at 04:16:12PM +0300, Sergei Antonov wrote: > On Sun, 11 Sept 2022 at 11:47, Jit Loon Lim wrot= e: > > > > From: Chin Liang See > > > > An old inffast.c optimization turns out to not be optimal anymore > > with modern compilers, and furthermore was not compliant with the > > C standard, for which decrementing a pointer before its allocated > > memory is undefined. Per the recommendation of a security audit of > > the zlib code by Trail of Bits and TrustInSoft, in support of the > > Mozilla Foundation, this "optimization" was removed, in order to > > avoid the possibility of undefined behavior. >=20 > A similar change was merged into an official zlib in 2016: > https://github.com/madler/zlib/commit/9aaec95e82117 As this commit message is copy/pasted from zlib, we need to better reflect that this is a port of the above mentioned commit to U-Boot. We should also mention that this is a fix for CVE-2016-9841 which I assume is why someone within Intel found and made this change. Given 2e2e784de060 ("zlib: Port fix for CVE-2018-25032 to U-Boot") I wonder if there are any other fixes that need to be posted / addressed? > It makes me wonder can zlib be used as an external project in U-Boot? > To be up to date with zlib development. Given the work to port the code to our codebase, no, not directly. It's an infrequently changing enough code base that it would make more sense I think to either re-sync (and compare our changes vs 1.2.5, which is when we last did this) or check over the commit log between then and now for any relevant changes to pick up. --=20 Tom --yZnyZsPjQYjG7xG7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmMeG90ACgkQFHw5/5Y0 tyyzzQv+LtjTKifV1Bv7F6g2+lO7e0THGU852p9OWUmv3iuzGT1K47aue+LdESuf TEBI+J+MA2yGv0EpJDgGOxqunuzmhfGQz541EKTQknx9k+3ZG1k3rKS8edh2jcEO Lrk1CGUnXT0cVjFh2UrweB8SME36ea1V3kDlvC/QrPLO0SQm+IiHSmTgkuV7TgMH JTJGuPipIAogPKSqcdsNXy0JNatHoc/OO1XiicyfyblnX3vWI9WwxcuXRD+V+V6v g6Wj+Wo37y/T0E7nxCoGYSqrtTPcNxgeK/jd3xSYsJAo4Kh5Hj37Q0BBiN9WT2op wp9FAVAePvTR3k4/mYYH65p+NGpY+2BsE9PAG0yOE/MzibqHrdkGoZTua2RfwwZ2 qD8B8IbHWKiYqNWgTiuuHUy3BWf7ulb15GKFxw/J0RQdQxVetq/TqN12t+qsdKAt YSayfMJkpueH0AvzyvkyZ/NdxMCu/IG8jPsHY78yc/LUCLeEHCSZ0gvpZjX7uvgL dJRgYD6M =q5Qd -----END PGP SIGNATURE----- --yZnyZsPjQYjG7xG7--