summaryrefslogtreecommitdiff
path: root/net/802
diff options
context:
space:
mode:
authorOleksij Rempel <o.rempel@pengutronix.de>2020-08-07 12:51:57 +0200
committerMarc Kleine-Budde <mkl@pengutronix.de>2020-08-14 12:38:47 +0200
commitcd3b3636c99fcac52c598b64061f3fe4413c6a12 (patch)
treee598117bc6fe4880710f7272c6faa6aa1bac2a64 /net/802
parentb43e3a82bc432c1caaed8950e7662c143470c54c (diff)
can: j1939: transport: j1939_session_tx_dat(): fix use-after-free read in j1939_tp_txtimer()
The current stack implementation do not support ECTS requests of not aligned TP sized blocks. If ECTS will request a block with size and offset spanning two TP blocks, this will cause memcpy() to read beyond the queued skb (which does only contain one TP sized block). Sometimes KASAN will detect this read if the memory region beyond the skb was previously allocated and freed. In other situations it will stay undetected. The ETP transfer in any case will be corrupted. This patch adds a sanity check to avoid this kind of read and abort the session with error J1939_XTP_ABORT_ECTS_TOO_BIG. Reported-by: syzbot+5322482fe520b02aea30@syzkaller.appspotmail.com Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol") Cc: linux-stable <stable@vger.kernel.org> # >= v5.4 Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.kernel.org/r/20200807105200.26441-3-o.rempel@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'net/802')
0 files changed, 0 insertions, 0 deletions