• Michael Scott's avatar
    6lowpan: iphc: reset mac_header after decompress to fix panic · 03bc05e1
    Michael Scott authored
    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's avatarMichael Scott <michael@opensourcefoundries.com>
    Acked-by: Alexander Aring's avatarAlexander Aring <aring@mojatatu.com>
    Acked-by: 's avatarJukka Rissanen <jukka.rissanen@linux.intel.com>
    Signed-off-by: Marcel Holtmann's avatarMarcel Holtmann <marcel@holtmann.org>
    03bc05e1
Name
Last commit
Last update
..
6lowpan_i.h Loading commit data...
Kconfig Loading commit data...
Makefile Loading commit data...
core.c Loading commit data...
debugfs.c Loading commit data...
iphc.c Loading commit data...
ndisc.c Loading commit data...
nhc.c Loading commit data...
nhc.h Loading commit data...
nhc_dest.c Loading commit data...
nhc_fragment.c Loading commit data...
nhc_ghc_ext_dest.c Loading commit data...
nhc_ghc_ext_frag.c Loading commit data...
nhc_ghc_ext_hop.c Loading commit data...
nhc_ghc_ext_route.c Loading commit data...
nhc_ghc_icmpv6.c Loading commit data...
nhc_ghc_udp.c Loading commit data...
nhc_hop.c Loading commit data...
nhc_ipv6.c Loading commit data...
nhc_mobility.c Loading commit data...
nhc_routing.c Loading commit data...
nhc_udp.c Loading commit data...