Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp202490pxh; Thu, 7 Apr 2022 18:52:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqufI6p1UUGxDAwnBS6kr2cy9b7tI7Ke9Zw8MSCn6SUqodhidsdsShwpn1sBMCf8UJUrIJ X-Received: by 2002:a63:d64d:0:b0:374:6edc:989c with SMTP id d13-20020a63d64d000000b003746edc989cmr13575542pgj.434.1649382720202; Thu, 07 Apr 2022 18:52:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649382720; cv=none; d=google.com; s=arc-20160816; b=gu5GmV8rZ2L9CMmXJRvosfmLF769D+0YDt8FMk9JuRIwFMiVvfEFEheNDDjZApmuHp 6pr7KW33Gm8CgUwBX+xixUdxgAnNZI7H/TaIPE0MU/CC3in40VCHf8kj7elOyrInW84+ kT+c5wpIUGF5wfA4W64tcWv+LxQymiZ4bO/uPOPv26XJ9JjUM7JTlI3a5+/B5ckS+wZG 2Iofc9wBiWJ6rz6T/ZrLkKJjpDAoiw/xSaw7CaMeCI8+7/OZr7QQlkFHDTHX6pxFQXTu zGSML4PBAXBAGZSXBere4AezFtF6IigCS/JD+jdadXRSiyR4Xlca1W9AWl6JdQPOqaaL n7VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=q6GIjfl38828TDx/Er/l1ydNAbsDZX6DyamisKv9xlI=; b=OiE++YKitnM3FOy4AQLOfxJqMHr1mw4JWcFXLMAPuJK7JUIIM4wQEzegnp1L9Ywutm 41NHaEaYYe2uXbVzxxliGkcdqYJDvDUjrGaZI6wwFdDQ5+Odx0E2mzd/135kuj2Gpuwb Me8anEHrtaz4nSSzy7sTEzOPaDj+4GD0sM8OyZYVEqC0A+AgB7rYEJmixhRt2KHfw07s IkWZiVqzBU0p7DTxI+d5DFLfcur2DSs5VGtGORtaKiB3gMekBAqcSf+McSFcOX9YaiX5 EiO/9Z28jpO5IiMBmBivqAkQJT4Hwk7phn6H3gBxU+ZSHgCQDDjW/gtkdE/bvUJSKESk 5DqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=O8z6RVsD; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id k69-20020a638448000000b003816043ee35si19469875pgd.42.2022.04.07.18.51.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 18:52:00 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=O8z6RVsD; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3F1ED1575A6; Thu, 7 Apr 2022 18:23:31 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233391AbiDHBZU (ORCPT + 99 others); Thu, 7 Apr 2022 21:25:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233384AbiDHBZT (ORCPT ); Thu, 7 Apr 2022 21:25:19 -0400 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A29BB1560B4; Thu, 7 Apr 2022 18:23:17 -0700 (PDT) Received: by mail-ed1-x52b.google.com with SMTP id g20so8396185edw.6; Thu, 07 Apr 2022 18:23:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=q6GIjfl38828TDx/Er/l1ydNAbsDZX6DyamisKv9xlI=; b=O8z6RVsDroCjPfHv/rRZ7ILks4hW8GgdUuvtwRzcLa7aaepbm3bE6m+mpb2Tik4RCh b/0ka341wHE+Mpxj72S95ZIxb7gnMPbKDSVercfbkn6nKVJ3QnSzXuiZ45s4C9/AraOA YFrDlA0bUoxTRDAVDZ38CkhO7TD8ROjmnFYTVT5y7ur8q+49njhBxooxb29brEqcVjrH zM45MKYK+MTJ41h0BznFCDIpl74lZ4qqVaB3iSLoDr6CT18gNXWMTA+f9WzZhRaiVXv2 0JdvTHfmtLcxifq6sBUpXFdo97AkszWt2pTn/8ITXzulkiogiZLj8Rq+PLZg/6uy+vDG ZFMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=q6GIjfl38828TDx/Er/l1ydNAbsDZX6DyamisKv9xlI=; b=yjI1JglrfmrXrTl5aeNIxS62oEjLK6ZaZbg4j1Ydyi+iGuqseY8nTJpjGdIG/9OFR7 BxaLB4iIri4sR+zknApqzSfnlLIIS/gy4OLUxr+4mEP4+mUobsX+KjkDSzJkRB86QSuE GZmS0aOzMi3pdXxlUupkvK6zfdaOCWnEzM42MGWnDJQwqVvaeESKws4XQ3jc1iXaKMbp QNqBXGkuG95QImCRpVD7UggbkNIlFfLvrjC8BdTKcbdN65HaT2khF2Yabjjmqgp6jKxu pwUge+RoM2tJZxF1pz2/zQniGCgWRi1iAW3GrTGM2L2faJuzK4La/qj2tv1rVEIMH098 eE5A== X-Gm-Message-State: AOAM533jd9R4mAII6p0yyP+e1jnXgtMcKs+hNYMK0KbFGsD614FqDacf aWfVw6Wr6Uol13ZEO9FrY1Y6tqQMrSylwodHOSw= X-Received: by 2002:a05:6402:190d:b0:41b:a70d:1367 with SMTP id e13-20020a056402190d00b0041ba70d1367mr16907289edz.155.1649380996125; Thu, 07 Apr 2022 18:23:16 -0700 (PDT) MIME-Version: 1.0 References: <20220406224809.29197-1-kgroeneveld@lenbrook.com> In-Reply-To: <20220406224809.29197-1-kgroeneveld@lenbrook.com> From: Fabio Estevam Date: Thu, 7 Apr 2022 22:23:03 -0300 Message-ID: Subject: Re: [PATCH] dmaengine: imx-sdma: fix regression with uart scripts To: Kevin Groeneveld Cc: Vinod Koul , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , NXP Linux Team , Lucas Stach , Robin Gong , dmaengine@vger.kernel.org, "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , linux-kernel Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Kevin, On Wed, Apr 6, 2022 at 7:48 PM Kevin Groeneveld wrote: > > Commit b98ce2f4e32b ("dmaengine: imx-sdma: add uart rom script") broke > uart rx on imx5 when using sdma firmware from older Freescale 2.6.35 > kernel. In this case reading addr->uartXX_2_mcu_addr was going out of > bounds of the firmware memory and corrupting the uart script addresses. > > Simply adding a bounds check before accessing addr->uartXX_2_mcu_addr > does not work as the uartXX_2_mcu_addr members are now beyond the size > of the older firmware and the uart addresses would never be populated > in that case. There are other ways to fix this but overall the logic > seems clearer to me to revert the uartXX_2_mcu_ram_addr structure > entries back to uartXX_2_mcu_addr, change the newer entries to > uartXX_2_mcu_rom_addr and update the logic accordingly. > > Fixes: b98ce2f4e32b ("dmaengine: imx-sdma: add uart rom script") > Signed-off-by: Kevin Groeneveld Thanks for the fix: Reviewed-by: Fabio Estevam