Re: [PATCH net v7 4/4] can: j1939: reject a CTS that names more packets than the message has

From: Chaosheng Qu

Date: Thu Nov 12 2026 - 22:34:07 EST


Hi,

The Medium is right and the changelog was wrong about the existing code.

An oversized ETP.CM_CTS already ends in J1939_XTP_ABORT_ECTS_TOO_BIG before
this patch: j1939_xtp_rx_cts_one() stores pkt - 1 in pkt.tx_acked,
j1939_session_tx_dpo() copies it into the DPO, and the local echo reaches
the transmitter branch of j1939_xtp_rx_dpo_one() with
session->transmission set. What changes is that the out-of-range DPO is no
longer sent on the bus.

The TP half I missed. There pkt = dat[2] and there is no DPO, so an
oversized CTS made pkt.tx at least pkt.total, j1939_session_tx_dat() found
nothing at pkt.tx * 7 and returned -ENOBUFS, and the session ran until the
1250ms rxtimer aborted with J1939_XTP_ABORT_TIMEOUT or the retry limit ended
it with -ENETUNREACH. Now it aborts immediately with code 15. That is the
visible change for the peer and the socket user, so it leads the changelog
instead of the ETP case.

The Low is the same correction: with this check in, pkt.tx_acked is at most
pkt.total - 1, so a DPO this host built cannot be out of range. Only a frame
carrying our SA that we did not send reaches the transmitter branch, and
BAD_EDPO_OFFSET is the right reason for it. The role split and the comment
around it go away in the next version.

Thanks,
Chaosheng