Skip to content

Commit aca701c

Browse files
committed
Merge tag 'batadv-net-pullrequest-20250901' of https://git.open-mesh.org/linux-merge
Simon Wunderlich says: ==================== Here is a batman-adv bugfix: - fix OOB read/write in network-coding decode, by Stanislav Fort * tag 'batadv-net-pullrequest-20250901' of https://git.open-mesh.org/linux-merge: batman-adv: fix OOB read/write in network-coding decode ==================== Link: https://patch.msgid.link/ Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 030e1c4 + d77b6ff commit aca701c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

net/batman-adv/network-coding.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1687,7 +1687,12 @@ batadv_nc_skb_decode_packet(struct batadv_priv *bat_priv, struct sk_buff *skb,
16871687

16881688
coding_len = ntohs(coded_packet_tmp.coded_len);
16891689

1690-
if (coding_len > skb->len)
1690+
/* ensure dst buffer is large enough (payload only) */
1691+
if (coding_len + h_size > skb->len)
1692+
return NULL;
1693+
1694+
/* ensure src buffer is large enough (payload only) */
1695+
if (coding_len + h_size > nc_packet->skb->len)
16911696
return NULL;
16921697

16931698
/* Here the magic is reversed:

0 commit comments

Comments
 (0)