[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181002132459.567372463@linuxfoundation.org>
Date: Tue, 2 Oct 2018 06:23:36 -0700
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org,
Michael Scott <michael@...nsourcefoundries.com>,
Alexander Aring <aring@...atatu.com>,
Jukka Rissanen <jukka.rissanen@...ux.intel.com>,
Marcel Holtmann <marcel@...tmann.org>,
Sasha Levin <alexander.levin@...rosoft.com>
Subject: [PATCH 4.14 015/137] 6lowpan: iphc: reset mac_header after decompress to fix panic
4.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Scott <michael@...nsourcefoundries.com>
[ Upstream commit 03bc05e1a4972f73b4eb8907aa373369e825c252 ]
After decompression of 6lowpan socket data, an IPv6 header is inserted
before the existing socket payload. After this, we reset the
network_header value of the skb to account for the difference in payload
size from prior to decompression + the addition of the IPv6 header.
However, we fail to reset the mac_header value.
Leaving the mac_header value untouched here, can cause a calculation
error in net/packet/af_packet.c packet_rcv() function when an
AF_PACKET socket is opened in SOCK_RAW mode for use on a 6lowpan
interface.
On line 2088, the data pointer is moved backward by the value returned
from skb_mac_header(). If skb->data is adjusted so that it is before
the skb->head pointer (which can happen when an old value of mac_header
is left in place) the kernel generates a panic in net/core/skbuff.c
line 1717.
This panic can be generated by BLE 6lowpan interfaces (such as bt0) and
802.15.4 interfaces (such as lowpan0) as they both use the same 6lowpan
sources for compression and decompression.
Signed-off-by: Michael Scott <michael@...nsourcefoundries.com>
Acked-by: Alexander Aring <aring@...atatu.com>
Acked-by: Jukka Rissanen <jukka.rissanen@...ux.intel.com>
Signed-off-by: Marcel Holtmann <marcel@...tmann.org>
Signed-off-by: Sasha Levin <alexander.levin@...rosoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
net/6lowpan/iphc.c | 1 +
1 file changed, 1 insertion(+)
--- a/net/6lowpan/iphc.c
+++ b/net/6lowpan/iphc.c
@@ -770,6 +770,7 @@ int lowpan_header_decompress(struct sk_b
hdr.hop_limit, &hdr.daddr);
skb_push(skb, sizeof(hdr));
+ skb_reset_mac_header(skb);
skb_reset_network_header(skb);
skb_copy_to_linear_data(skb, &hdr, sizeof(hdr));
Powered by blists - more mailing lists