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=-12.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 EE930C433F5 for ; Fri, 3 Sep 2021 21:29:20 +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 2411C60E93 for ; Fri, 3 Sep 2021 21:29:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2411C60E93 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 63BF280397; Fri, 3 Sep 2021 23:29:17 +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="XMCkCzrP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E1C018331E; Fri, 3 Sep 2021 23:29:14 +0200 (CEST) Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) (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 E287783167 for ; Fri, 3 Sep 2021 23:29:07 +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-qk1-x731.google.com with SMTP id b64so546491qkg.0 for ; Fri, 03 Sep 2021 14:29:07 -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=kqva9F2ogzPNFMOZOcq+iFE4UOnllxK7X9D+WZwA1Pc=; b=XMCkCzrPV6mJ8/jhH9R7CecQVV5Js5xllRf2IVwIJrVmzNDUolrwt6YG4PoXDz6ePK 5oO8vhsAqejBA9FY9T625wDemSbUpnAsZirtiiICFuHRgINOspHEGNG2AAQKxzbAeHq3 Xv/EZrzmH6izuo1YwgjYSoOHUKUolgqKaW3wU= 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=kqva9F2ogzPNFMOZOcq+iFE4UOnllxK7X9D+WZwA1Pc=; b=YSBlFF6DeNllDabqakajclT7Lfmbbm4Y/TznhXUat9aM7DvkTO0Kag336aKd4Gi01+ vfhXUURfgvQ7OYHRfHzKDAv3kAlkd49fmHri2rJ3ChEn3UBfdMH42rgharbB73Px7oUo fkOZXWLe/cUOWJMBw5XCtSYy8o0pDaTFsHTOjFaQDyc1UH2BADtcFDyB29xlcF9Dn9QD H1htKEPE6fzQo4T9tr+iVhHDUc4MfQR4oMgSvjvW2UdonToWbtChxUy60dR5/ff07Rvp emRNq1W5BtbsislkW4fKJiocLymRRbbYJVIGDqX6kb3hNF/CU+sLscmbnU6PCfYA+WRe J4pg== X-Gm-Message-State: AOAM532w/XRUEdC1AkF4vH+erOogH2iTZ2Rd0QCAzp/TqbaxSeR4m6P+ lBixztOgjmDv66HOxROObVp7qg== X-Google-Smtp-Source: ABdhPJzazkJimbpUVsctsxXzDmNlMOZhEzluvUA40kwSLkUvjJvYywuwFibmE8l9L5fZj37fuZnyUg== X-Received: by 2002:ae9:ea19:: with SMTP id f25mr863171qkg.341.1630704546512; Fri, 03 Sep 2021 14:29:06 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-e598-7a50-554e-ee54.res6.spectrum.com. [2603:6081:7b01:cbda:e598:7a50:554e:ee54]) by smtp.gmail.com with ESMTPSA id m68sm281857qkb.105.2021.09.03.14.29.05 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Sep 2021 14:29:06 -0700 (PDT) Date: Fri, 3 Sep 2021 17:29:04 -0400 From: Tom Rini To: Pali =?iso-8859-1?Q?Roh=E1r?= Cc: Simon Glass , Heinrich Schuchardt , Michal Simek , Marek =?iso-8859-1?Q?Beh=FAn?= , u-boot@lists.denx.de Subject: Re: [PATCH 1/7] xyz-modem: Fix crash after cancelling transfer Message-ID: <20210903212904.GO858@bill-the-cat> References: <20210803142844.19455-1-pali@kernel.org> <20210803142844.19455-2-pali@kernel.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="r4ztDlTOqhT7Ppg9" Content-Disposition: inline In-Reply-To: <20210803142844.19455-2-pali@kernel.org> 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 --r4ztDlTOqhT7Ppg9 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 03, 2021 at 04:28:38PM +0200, Pali Roh=E1r wrote: > Variable xyz.len is set to -1 on error. At the end xyzModem_stream_read() > function calls memcpy() with length from variable xyz.len. If this variab= le > is set to -1 then value passed to memcpy is casted to unsigned value, whi= ch > means to copy whole address space. Which then cause U-Boot crash. E.g. on > arm64 it cause CPU crash: "Synchronous Abort" handler, esr 0x96000006 >=20 > Fix this issue by checking that value stored in xyz.len is valid prior > trying to use it. >=20 > Signed-off-by: Pali Roh=E1r > Acked-by: Heinrich Schuchardt With a quick X/Y modem test boot on am335x_evm: For the series, applied to u-boot/next, thanks! --=20 Tom --r4ztDlTOqhT7Ppg9 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmEyk5kACgkQFHw5/5Y0 tywKogwAtPu2vDum6CpmSgZMcJ6Rmv4OLyCZ3gHBnQSy5zOLW9fcOg2ArcBgDYO+ pbfuADxVFXvDNQObJV9jJ52F0gPA2zyrh3MJ5FZleTDnR9qL9TODR1NdOM4g1rZu /mPiv0K+5BBxEo3rxaE2hfWK6Gc2CDl8QaQ5DPSCLRPeqVrDDVr0cs+eILlm+FkL th6fsNE4vhTE2ZrPO/Q89K6MPrOqzgywNOMMEMi3/FRcMuM5mL9fMO5Ab7w8oedr r/XO7jOZ8Y3QBWvNKDZ8kXCd7XRgcgwaSQPwSAB2NYBrqovbS12yCZkXRbC6pZU7 5TpaXG6k4oslhn0m/vgd2+MuH2t4bLpbHGlPvLymwAYkT1mTPdwLJaizL7ZwfF5n SoXzA1nGfNwzhm1RYJRMWohwTm3myRVDmZsLR2+wkeWMNn+BurnajJO5KLIwaUnV VDEdnZq5xLAU94YomtieV1nzep3abx/spa2Q+NobSUgdN3c6+MQ6gZIzwbgOsv2o EOu2RhOD =qxme -----END PGP SIGNATURE----- --r4ztDlTOqhT7Ppg9--