]> www.infradead.org Git - users/dwmw2/linux.git/commit
bonding: validate ip header before check IPPROTO_IGMP
authorCong Wang <xiyou.wangcong@gmail.com>
Tue, 2 Jul 2019 03:40:24 +0000 (20:40 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Jul 2019 05:28:46 +0000 (07:28 +0200)
commit1148831a79d7796f18b7762c2fe9d8389636f68e
tree9250ff5f2f1648ee2301779a22309eadbc8ef78f
parentf14b4a6267532a2fda6cd30c3af1fe8c89caad93
bonding: validate ip header before check IPPROTO_IGMP

[ Upstream commit 9d1bc24b52fb8c5d859f9a47084bf1179470e04c ]

bond_xmit_roundrobin() checks for IGMP packets but it parses
the IP header even before checking skb->protocol.

We should validate the IP header with pskb_may_pull() before
using iph->protocol.

Reported-and-tested-by: syzbot+e5be16aa39ad6e755391@syzkaller.appspotmail.com
Fixes: a2fd940f4cff ("bonding: fix broken multicast with round-robin mode")
Cc: Jay Vosburgh <j.vosburgh@gmail.com>
Cc: Veaceslav Falico <vfalico@gmail.com>
Cc: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/bonding/bond_main.c