Skip to content

rpmsg: glink: smem: robustness and debuggability fixes

Chunkai Deng linux-arm-msm linux-remoteproc lkml stable 3 versions – In review

Get series with b4
b4 am [email protected] change-id 20260601-rpmsg-improvements-643a6e133f66

Versions newest first

  1. v3 Latest2 patches 1 replyIn review
  2. v22 patches 1 replySuperseded
  3. v13 patches 6 repliesSuperseded

Changes in v3 from the cover letter

- Rework the FIFO-index patch per review: validate the raw head/tail
values (not a derived length or post-normalized index), use
dev_warn_ratelimited() for remote-written indices and WARN_ON_ONCE()
for local ones, and bounds-check offset/count and hlen/dlen.
Retitled to "rpmsg: glink: smem: Validate FIFO indices before use".
- No changes to the IRQ-name patch; carrying Dmitry's Reviewed-by.
- Link to v2: https://patch.msgid.link/[email protected]

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2rpmsg: glink: smem: Use device name as IRQ namedrivers/rpmsg/qcom_glink_smem.c+1 -11 reply
2/2rpmsg: glink: smem: Validate FIFO indices before usedrivers/rpmsg/qcom_glink_smem.c+39 -00 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchDmitry BaryshkovKonrad Dybcio
1/2R-b R-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/2] rpmsg: glink: smem: robustness and debuggability fixes

This series makes two small improvements to the SMEM GLINK transport:

1. Validate the raw FIFO head/tail indices (and caller-supplied offset/count) against the FIFO length in the read/write helpers, so a broken index is rejected before it turns into an out-of-bounds access into the FIFO.

2. Pass dev_name(&smem->dev) as the IRQ name instead of the static string "glink-smem". On platforms with multiple remoteprocs each SMEM GLINK instance registers its own IRQ, and the unique device name makes each entry in /proc/interrupts identifiable without adding a new struct field.

---
Changes in v3:
- Rework the FIFO-index patch per review: validate the raw head/tail
values (not a derived length or post-normalized index), use
dev_warn_ratelimited() for remote-written indices and WARN_ON_ONCE()
for local ones, and bounds-check offset/count and hlen/dlen.
Retitled to "rpmsg: glink: smem: Validate FIFO indices before use".
- No changes to the IRQ-name patch; carrying Dmitry's Reviewed-by.
- Link to v2: https://patch.msgid.link/[email protected]

Changes in v2:
- Drop the modulo patch ("rpmsg: glink: smem: Use modulo for FIFO
tail wrap-around in rx_advance"); per review, it papers over an
unreachable scenario without restoring a valid protocol state.
Proper RX-side validation of chunk_size against rx_pipe->length
will be sent as a separate patch.
- "rpmsg: glink: smem: Add WARN_ON_ONCE for FIFO index invariants":
- Drop the trailing comma after "skipped" in the commit message
body (per review).
- Add Fixes: caf989c350e8 ("rpmsg: glink: Introduce glink smem
based transport") and Cc: [email protected] (per review).
- Carry Dmitry's Reviewed-by on "rpmsg: glink: smem: Use device
name as IRQ name" (no code changes since v1).
- Link to v1: https://patch.msgid.link/[email protected]

---
Chunkai Deng (2):
rpmsg: glink: smem: Use device name as IRQ name
rpmsg: glink: smem: Validate FIFO indices before use

 drivers/rpmsg/qcom_glink_smem.c | 41 ++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 40 insertions(+), 1 deletion(-)

---
base-commit: f7af91adc230aa99e23330ecf85bc9badd9780ad
change-id: 20260601-rpmsg-improvements-643a6e133f66

Best regards,

Signature · 1 line
Chunkai Deng <[email protected]>