mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/4] remoteproc: qcom: Fix DA-to-VA bounds checks
@ 2026-11-06 18:43 Atul Akella
  2026-11-06 18:43 ` [PATCH 1/4] remoteproc: qcom: Fix bounds check in adsp_da_to_va() Atul Akella
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Atul Akella @ 2026-11-06 18:43 UTC (permalink / raw)
  To: andersson, mathieu.poirier, sibi.sankar, quic_srichara
  Cc: linux-remoteproc, linux-arm-msm, linux-kernel, Atul Akella

This series fixes the same bounds check bug in da_to_va() across four
Qualcomm remoteproc PIL drivers: qcom_q6v5_adsp, qcom_q6v5_pas,
qcom_q6v5_wcss, and qcom_wcnss.

In each driver, offset is a signed 32bit integer assigned from
the 64 bit difference da - <base>, where both operands are u64.
If da is smaller than <base>, the subtraction underflows before
the result is truncated on assignment. This can produce a small
positive offset and bypass the existing underflow check.
Separately, the offset + len bounds check can overflow.

da and len originate from firmware ELF program headers
(p_paddr and p_memsz) via rproc_da_to_va(). The returned
address is used by the ELF loader to write firmware segments, so a
malformed firmware image can cause writes outside the carveout.

Each patch keeps offset in u64, rejects addresses below the
relocation base before subtraction, and uses a subtraction based
bounds check to avoid overflow.

Atul Akella (4):
  remoteproc: qcom: Fix bounds check in adsp_da_to_va()
  remoteproc: qcom: Fix bounds check in qcom_pas_da_to_va()
  remoteproc: qcom: Fix bounds check in q6v5_wcss_da_to_va()
  remoteproc: qcom: Fix bounds check in wcnss_da_to_va()

 drivers/remoteproc/qcom_q6v5_adsp.c | 6 ++++--
 drivers/remoteproc/qcom_q6v5_pas.c  | 6 ++++--
 drivers/remoteproc/qcom_q6v5_wcss.c | 6 ++++--
 drivers/remoteproc/qcom_wcnss.c     | 6 ++++--
 4 files changed, 16 insertions(+), 8 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-06 18:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-06 18:43 [PATCH 0/4] remoteproc: qcom: Fix DA-to-VA bounds checks Atul Akella
2026-11-06 18:43 ` [PATCH 1/4] remoteproc: qcom: Fix bounds check in adsp_da_to_va() Atul Akella
2026-11-06 18:43 ` [PATCH 2/4] remoteproc: qcom: Fix bounds check in qcom_pas_da_to_va() Atul Akella
2026-11-06 18:43 ` [PATCH 3/4] remoteproc: qcom: Fix bounds check in q6v5_wcss_da_to_va() Atul Akella
2026-11-06 18:43 ` [PATCH 4/4] remoteproc: qcom: Fix bounds check in wcnss_da_to_va() Atul Akella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®