batman-adv: check return value of pskb_trim_rcsum()
PATCH 1/1 batman-adv: check return value of pskb_trim_rcsum()
Reported-by Sven Eckelmann <[email protected]>
Signed-off-by Marek Lindner <[email protected]>
--- network-coding.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
network-coding.c +6 -2
@@ -1514,6 +1514,7 @@ batadv_nc_skb_decode_packet(struct batadv_priv *bat_priv, struct sk_buff *skb,struct ethhdr *ethhdr, ethhdr_tmp;uint8_t *orig_dest, ttl, ttvn;unsigned int coding_len; +int err;/* Save headers temporarily */ memcpy (&coded_packet_tmp, skb->data,sizeof (coded_packet_tmp));
@@ -1568,8 +1569,11 @@ batadv_nc_skb_decode_packet(struct batadv_priv *bat_priv, struct sk_buff *skb, coding_len);/* Resize decoded skb if decoded with larger packet */ -if (nc_packet->skb->len > coding_len + h_size) -pskb_trim_rcsum (skb, coding_len + h_size); +if (nc_packet->skb->len > coding_len + h_size) { + err =pskb_trim_rcsum (skb, coding_len + h_size); +if (err) +return NULL ; + }/* Create decoded unicast packet */ unicast_packet = (struct batadv_unicast_packet *)skb->data;
Signature · 1 line
1.7.10.4
Quoted 2 lines · Marek Lindner
Reported-by Sven Eckelmann <[email protected]>Signed-off-by Marek Lindner <[email protected]>
Acked-by Martin Hundebøll <[email protected]>
Quoted 31 lines
--- network-coding.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)network-coding.c +6
-2@@ -1514,6 +1514,7 @@ batadv_nc_skb_decode_packet(struct batadv_priv *bat_priv, struct sk_buff *skb,struct ethhdr *ethhdr, ethhdr_tmp;uint8_t *orig_dest, ttl, ttvn;unsigned int coding_len; +int err;/* Save headers temporarily */ memcpy (&coded_packet_tmp, skb->data,sizeof (coded_packet_tmp));@@ -1568,8 +1569,11 @@ batadv_nc_skb_decode_packet(struct batadv_priv *bat_priv, struct sk_buff *skb, coding_len);/* Resize decoded skb if decoded with larger packet */ -if (nc_packet->skb->len > coding_len + h_size) -pskb_trim_rcsum (skb, coding_len + h_size); +if (nc_packet->skb->len > coding_len + h_size) { + err =pskb_trim_rcsum (skb, coding_len + h_size); +if (err) +return NULL ; + }/* Create decoded unicast packet */ unicast_packet = (struct batadv_unicast_packet *)skb->data;
Signature · 8 lines
Kind Regards Martin Hundebøll Frederiks Allé 99, 1.th 8000 Aarhus C Denmark +45 61 65 54 61 [email protected]
Marek Lindner
AppliedQuoted 5 lines · On Wednesday, May 08, 2013 12:46:53 Martin Hundebøll wrote:
Quoted 2 lines · Marek Lindner
Reported-by Sven Eckelmann <[email protected]>Signed-off-by Marek Lindner <[email protected]>Acked-by Martin Hundebøll <[email protected]>
Applied in revision d22ebef.
Regards,
Marek