ipsec: be careful of non existing mac headers
Niccolo Belli reported ipsec crashes in case we handle a frame without mac header (atm in his case) Before copying mac header, better make sure it is present. Bugzilla reference: https://bugzilla.kernel.org/show_bug.cgi?id=42809 Reported-by: Niccolò Belli <darkbasic@linuxsystems.it> Tested-by: Niccolò Belli <darkbasic@linuxsystems.it> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -110,10 +110,7 @@ static int xfrm4_beet_input(struct xfrm_state *x, struct sk_buff *skb)
|
||||
|
||||
skb_push(skb, sizeof(*iph));
|
||||
skb_reset_network_header(skb);
|
||||
|
||||
memmove(skb->data - skb->mac_len, skb_mac_header(skb),
|
||||
skb->mac_len);
|
||||
skb_set_mac_header(skb, -skb->mac_len);
|
||||
skb_mac_header_rebuild(skb);
|
||||
|
||||
xfrm4_beet_make_header(skb);
|
||||
|
||||
|
Reference in New Issue
Block a user