From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 765B3377EDC for ; Fri, 4 Sep 2026 19:12:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788549131; cv=none; b=OxLeNy1kapoy7M/kP2EEiUYn3Hs/SHRGdZ0KEN5yAZD//Osa/v1iO2WN+XgTfBSb+o5baSO9i6hQrJwA6+wrytbH/id5voKd7emHJ0Xjs0TNUdFgf6gi4a4oqW115ToUbS6UFfrJbDEsyMJUOIQSR3iqvU9WwXWHzkp/YJ8y5Jw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788549131; c=relaxed/simple; bh=ZOaRv+ozQi0YBXWLi8zsbpCBh2H8RMSfbYtlbKbXi4Q=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uahkzoxAHnwYjDkzyyu6o/zNlDxBOqFZ/MpN6tmwo1L+rXarDAc/Yp6lGltSBR0lWkGlW5kL0qc0mTM4Ge/Y00ZsqKo36kWqTRhk4muOqZlCwOygYF3JhSoTyVZXV8a5AYgW0l/KYwrEMvwMNbVbHlFuBjOly8ABM9NVexjLlP4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=o8KnIo+I; arc=none smtp.client-ip=209.85.210.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="o8KnIo+I" Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-85590c5aeabso995826b3a.3 for ; Fri, 04 Sep 2026 12:12:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1788549126; x=1789153926; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=4HJBZzHdO6P6nJOdbBqlWJWT1PzSbfwvCowjEuATTwM=; b=o8KnIo+IMD9p5IduEgDSL5oG8GLoD04niQT1Cw86IpMXvYzMBCC+z4d6ReywCZt3Q8 UTcWnMBcq74z7AfvLKlnXRpEj1jLSnpOirkdPC56AzctE2tTHe56ttxj98f52Nfrcvei RnwFqCNTB27ggDEOYRNZpTYvOS+PNYX9YhSErdJfC7ezBhzIXvcCML7HDDj8kZvcOY5q ML1NVBFsqbjMTf41qPyjSI9sYhOJ4uAgzeuxc5nPPL945xF8hYjVgBgjiHgyk0hx1qRI +KWAcL1Cq+wSKOjS0iSVMRVq0ILWqz2V5PGPEEFNntKg3+LbH90Au+wQQUUZrK07y/s/ xNcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788549126; x=1789153926; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=4HJBZzHdO6P6nJOdbBqlWJWT1PzSbfwvCowjEuATTwM=; b=Sd/tPVHoN7LryaaV8vKjE4sKzOEBAiCITmtSDVugqqoOMDXneI89JtixD5ur8XPXFH knoQP602QZHR8AzsBOfOGhSjDOWfVYCD11Mj/7CSOhlCsguJqilbY1WUGVt9TSTCGQOa tkcPQ3cHxzvcpoezUpvK/MjVQqfxhB6J14Pwhgd3nhTR4N7NVgOPibFomA7ashBAzvNi d+Rja51qXvFIKzhyBGF5PPWDraFLjt0lSq0z/EriUVkHa7cC15QjnIsPHCnGWLIDX+Wi 5ex3zJTQVWmwQkie2+HRGPdFggspGNoKTEaT9Y83yzti6XPhfvoOzAfiaMKxRw7ZsTDm +Wrg== X-Forwarded-Encrypted: i=1; AKwUvBwst/crb8Hra7ynPDvlEAiglXJxbjsHo2EiDI7J7NtHAyKMcPf1FqF9C/K1OU613DweFlA684DBJ+DEndw=@vger.kernel.org X-Gm-Message-State: AFuF++mwMOCypZmsqhLxOUFMVOUOWcKul52GcihHRZj/a4j1940eN/CY IooUUI0CX3JMMOTmDclI5bGPOGjCEHp5Ux+jjDP2XEWJdyLBeEMpnfJEaVPKtjs1GR8= X-Gm-Gg: AYBFou3Umt87s7O3qye398EzqOpfDV98EluPLAWw1pj03oPV+qajH3RkDKCAeC0K+Kd 764//xNhSZFXEsWXGdayCYD5SgrSSBmcJ1b6LNB5EfLF+4Sfv8DJ31NezWfFq6lWA/gsvUk4o9V d4XiFQzRaMcOJWu/Q81gTnZYXiRD96aOKptbKdNWbCOhCnETdNtQvsJ+jUxxFChV9IClS7+uCHj 1bW22Qr8YUr0bOqQyULnV5SYsuYw8pu9Ct2qvscMfMA/ce37P+9IQxSrXWqq3n+UcvsMWKRlE4p FxXL1RUncMY+2wy9fXGR4rhrgumysFIVO5i27wlVpclCVDUqK1dOF24YcCAzS2lCQUCsiYyRT1i rot3SqjRse4ZDdt+3w7l6v0QyH/qkvfeI9lRSZmsoUMdbip/jWS5l+BTxDG45PGlVYN4LI2nB2t rOk5vmf4pjBll1opuu0pIZWWkIdg065C8TbEUTPzGDce1wsSl3O/Lkjgt1+NeBLYDg X-Received: by 2002:a05:6a21:1392:b0:3d7:dfbf:7435 with SMTP id adf61e73a8af0-3da3a13d20dmr12237083637.25.1788549125532; Fri, 04 Sep 2026 12:12:05 -0700 (PDT) Received: from p14s ([2604:3d09:148c:c800:f95f:75de:b3f0:3bf5]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cc45542bd2asm1217812a12.12.2026.09.04.12.12.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Sep 2026 12:12:04 -0700 (PDT) Date: Fri, 4 Sep 2026 13:12:02 -0600 From: Mathieu Poirier To: "Peng Fan (OSS)" Cc: Marcel Hofmann , Bjorn Andersson , Frank Li , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Oleksij Rempel , "linux-remoteproc@vger.kernel.org" , "imx@lists.linux.dev" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Marcel Hofmann Subject: Re: [PATCH v2] remoteproc: imx_rproc: allow mappings ending at region boundary Message-ID: References: <20260827123136.438798-1-marcel@hofmania.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Sep 04, 2026 at 03:32:08AM +0000, Peng Fan (OSS) wrote: > > Subject: [PATCH v2] remoteproc: imx_rproc: allow mappings ending at > > region boundary > > > > From: Marcel Hofmann > > > > The address range checks in imx_rproc_da_to_sys() and > > imx_rproc_da_to_va() use a strict comparison for the exclusive end > > address of the requested range. > > > > As a result, a valid request that ends exactly at the end of an address > > translation or mapped memory region is rejected. For a region [start, > > start + size), a request [addr, addr + len) is contained when: > > > > addr >= start && addr + len <= start + size > > > > This occurs when a loadable ELF segment fills an entire mapped > > memory region. This can be produced by a linker script that extends > > the resource table section to the end of its designated region: > > > > .resource_table : > > { > > . = ALIGN(8); > > KEEP(*(.resource_table)) /* Resource table */ > > . = ALIGN(8); > > . = ORIGIN(m_rsc_tbl) + LENGTH(m_rsc_tbl); > > } > m_rsc_tbl =0x00 > > > > This produces a ELF program header like: > > > > LOAD 0x010000 0xa4220000 0xa4220000 0x01000 0x01000 R > > 0x1000 > > > > In this case, the segment size matches the mapped region size exactly, > > causing the address translation to fail with: > > > > bad phdr da 0xa4220000 mem 0x1000 > > > > Rework the upper-bound checks to allow ranges ending exactly at the > > region boundary while guarding against integer overflow. > > > > Fixes: a0ff4aa6f010 ("remoteproc: imx_rproc: add a NXP/Freescale > > imx_rproc driver") > > Signed-off-by: Marcel Hofmann > digital.com> > > Tested-by: Peng Fan #i.MX95-19x19-EVK > Applied. > Thanks, > Peng. >