• Sven Eckelmann's avatar
    batman-adv: Force mac header to start of data on xmit · b005b2fd
    Sven Eckelmann authored
    commit 9114daa8 upstream.
    
    The caller of ndo_start_xmit may not already have called
    skb_reset_mac_header. The returned value of skb_mac_header/eth_hdr
    therefore can be in the wrong position and even outside the current skbuff.
    This for example happens when the user binds to the device using a
    PF_PACKET-SOCK_RAW with enabled qdisc-bypass:
    
      int opt = 4;
      setsockopt(sock, SOL_PACKET, PACKET_QDISC_BYPASS, &opt, sizeof(opt));
    
    Since eth_hdr is used all over the codebase, the batadv_interface_tx
    function must always take care of resetting it.
    
    Fixes: c6c8fea2 ("net: Add batman-adv meshing protocol")
    Reported-by: syzbot+9d7405c7faa390e60b4e@syzkaller.appspotmail.com
    Reported-by: syzbot+7d20bc3f1ddddc0f9079@syzkaller.appspotmail.com
    Signed-off-by: Sven Eckelmann's avatarSven Eckelmann <sven@narfation.org>
    Signed-off-by: Simon Wunderlich's avatarSimon Wunderlich <sw@simonwunderlich.de>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    b005b2fd
Name
Last commit
Last update
..
6lowpan Loading commit data...
802 Loading commit data...
8021q Loading commit data...
9p Loading commit data...
appletalk Loading commit data...
atm Loading commit data...
ax25 Loading commit data...
batman-adv Loading commit data...
bluetooth Loading commit data...
bpf Loading commit data...
bpfilter Loading commit data...
bridge Loading commit data...
caif Loading commit data...
can Loading commit data...
ceph Loading commit data...
core Loading commit data...
dcb Loading commit data...
dccp Loading commit data...
decnet Loading commit data...
dns_resolver Loading commit data...
dsa Loading commit data...
ethernet Loading commit data...
hsr Loading commit data...
ieee802154 Loading commit data...
ife Loading commit data...
ipv4 Loading commit data...
ipv6 Loading commit data...
iucv Loading commit data...
kcm Loading commit data...
key Loading commit data...
l2tp Loading commit data...
l3mdev Loading commit data...
lapb Loading commit data...
llc Loading commit data...
mac80211 Loading commit data...
mac802154 Loading commit data...
mpls Loading commit data...
ncsi Loading commit data...
netfilter Loading commit data...
netlabel Loading commit data...
netlink Loading commit data...
netrom Loading commit data...
nfc Loading commit data...
nsh Loading commit data...
openvswitch Loading commit data...
packet Loading commit data...
phonet Loading commit data...
psample Loading commit data...
qrtr Loading commit data...
rds Loading commit data...
rfkill Loading commit data...
rose Loading commit data...
rxrpc Loading commit data...
sched Loading commit data...
sctp Loading commit data...
smc Loading commit data...
strparser Loading commit data...
sunrpc Loading commit data...
switchdev Loading commit data...
tipc Loading commit data...
tls Loading commit data...
unix Loading commit data...
vmw_vsock Loading commit data...
wimax Loading commit data...
wireless Loading commit data...
x25 Loading commit data...
xdp Loading commit data...
xfrm Loading commit data...
Kconfig Loading commit data...
Makefile Loading commit data...
compat.c Loading commit data...
socket.c Loading commit data...
sysctl_net.c Loading commit data...