aboutsummaryrefslogtreecommitdiff
path: root/scripts/gdb/linux/lists.py
diff options
context:
space:
mode:
authorOleksij Rempel <[email protected]>2023-04-04 09:31:28 +0200
committerMarc Kleine-Budde <[email protected]>2023-04-05 10:51:57 +0200
commitb45193cb4df556fe6251b285a5ce44046dd36b4a (patch)
tree45c547190ebdc0541abdd3b769e35b1c694923a2 /scripts/gdb/linux/lists.py
parent3ce9345580974863c060fa32971537996a7b2d57 (diff)
can: j1939: j1939_tp_tx_dat_new(): fix out-of-bounds memory access
In the j1939_tp_tx_dat_new() function, an out-of-bounds memory access could occur during the memcpy() operation if the size of skb->cb is larger than the size of struct j1939_sk_buff_cb. This is because the memcpy() operation uses the size of skb->cb, leading to a read beyond the struct j1939_sk_buff_cb. Updated the memcpy() operation to use the size of struct j1939_sk_buff_cb instead of the size of skb->cb. This ensures that the memcpy() operation only reads the memory within the bounds of struct j1939_sk_buff_cb, preventing out-of-bounds memory access. Additionally, add a BUILD_BUG_ON() to check that the size of skb->cb is greater than or equal to the size of struct j1939_sk_buff_cb. This ensures that the skb->cb buffer is large enough to hold the j1939_sk_buff_cb structure. Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol") Reported-by: Shuangpeng Bai <[email protected]> Tested-by: Shuangpeng Bai <[email protected]> Signed-off-by: Oleksij Rempel <[email protected]> Link: https://groups.google.com/g/syzkaller/c/G_LL-C3plRs/m/-8xCi6dCAgAJ Link: https://lore.kernel.org/all/[email protected] Cc: [email protected] [mkl: rephrase commit message] Signed-off-by: Marc Kleine-Budde <[email protected]>
Diffstat (limited to 'scripts/gdb/linux/lists.py')
0 files changed, 0 insertions, 0 deletions