linux/drivers/net
Marcelo Leitner 19ca9fc144 vxlan: Do not reuse sockets for a different address family
Currently, we only match against local port number in order to reuse
socket. But if this new vxlan wants an IPv6 socket and a IPv4 one bound
to that port, vxlan will reuse an IPv4 socket as IPv6 and a panic will
follow. The following steps reproduce it:

   # ip link add vxlan6 type vxlan id 42 group 229.10.10.10 \
       srcport 5000 6000 dev eth0
   # ip link add vxlan7 type vxlan id 43 group ff0e::110 \
       srcport 5000 6000 dev eth0
   # ip link set vxlan6 up
   # ip link set vxlan7 up
   <panic>

[    4.187481] BUG: unable to handle kernel NULL pointer dereference at 0000000000000058
...
[    4.188076] Call Trace:
[    4.188085]  [<ffffffff81667c4a>] ? ipv6_sock_mc_join+0x3a/0x630
[    4.188098]  [<ffffffffa05a6ad6>] vxlan_igmp_join+0x66/0xd0 [vxlan]
[    4.188113]  [<ffffffff810a3430>] process_one_work+0x220/0x710
[    4.188125]  [<ffffffff810a33c4>] ? process_one_work+0x1b4/0x710
[    4.188138]  [<ffffffff810a3a3b>] worker_thread+0x11b/0x3a0
[    4.188149]  [<ffffffff810a3920>] ? process_one_work+0x710/0x710

So address family must also match in order to reuse a socket.

Reported-by: Jean-Tsung Hsiao <jhsiao@redhat.com>
Signed-off-by: Marcelo Ricardo Leitner <mleitner@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-11-13 15:19:59 -05:00
..
appletalk net: better IFF_XMIT_DST_RELEASE support 2014-10-07 13:22:11 -04:00
arcnet ARCNET: enable eae arcnet card support 2014-09-29 14:36:26 -04:00
bonding Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-10-08 21:40:54 -04:00
caif net: set name_assign_type in alloc_netdev() 2014-07-15 16:12:48 -07:00
can drivers/net/can/Kconfig: Let CAN_AT91 depend on HAS_IOMEM 2014-10-03 15:52:03 -07:00
cris eth_v10: remove unnecessary break after return 2014-07-20 21:29:49 -07:00
dsa dsa: mv88e6171: Fix tagging protocol/Kconfig 2014-10-28 15:27:54 -04:00
ethernet smsc911x: power-up phydev before doing a software reset. 2014-11-13 15:09:28 -05:00
fddi defxx: DEFEA's ESIC port I/O decoding cleanup 2014-09-28 17:22:10 -04:00
hamradio net: set name_assign_type in alloc_netdev() 2014-07-15 16:12:48 -07:00
hippi PCI: Remove DEFINE_PCI_DEVICE_TABLE macro use 2014-08-12 12:15:14 -06:00
hyperv hyperv: Fix the total_data_buflen in send path 2014-10-22 17:58:50 -04:00
ieee802154 mrf24j40: use pr_* / dev_* instead of printk() 2014-09-24 14:14:42 +02:00
irda drivers/net/irda/Kconfig: Let SH_IRDA depend on HAS_IOMEM 2014-10-03 15:52:04 -07:00
phy net: ptp: fix time stamp matching logic for VLAN packets. 2014-11-12 15:06:17 -05:00
plip
ppp net: ppp: Don't call bpf_prog_create() in ppp_lock 2014-11-11 15:15:03 -05:00
slip net: set name_assign_type in alloc_netdev() 2014-07-15 16:12:48 -07:00
team Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-10-08 16:22:22 -04:00
usb asix: Do full reset during ax88772_bind 2014-11-07 15:30:03 -05:00
vmxnet3 PCI changes for the v3.18 merge window: 2014-10-09 15:03:49 -04:00
wan net: better IFF_XMIT_DST_RELEASE support 2014-10-07 13:22:11 -04:00
wimax kbuild: remove unnecessary "obj- := dummy.o" trick 2014-10-02 13:55:02 +02:00
wireless This contains another small set of fixes for 3.18, these are all 2014-11-04 15:56:33 -05:00
xen-netback xen-netback: reintroduce guest Rx stall detection 2014-10-25 14:15:20 -04:00
Kconfig drivers/net: macvtap and tun depend on INET 2014-10-30 23:50:26 -04:00
LICENSE.SRC
Makefile net: reduce USB network driver config options. 2014-08-05 16:48:59 -07:00
Space.c
dummy.c net: set name_assign_type in alloc_netdev() 2014-07-15 16:12:48 -07:00
eql.c net: better IFF_XMIT_DST_RELEASE support 2014-10-07 13:22:11 -04:00
ifb.c net: better IFF_XMIT_DST_RELEASE support 2014-10-07 13:22:11 -04:00
loopback.c net: better IFF_XMIT_DST_RELEASE support 2014-10-07 13:22:11 -04:00
macvlan.c macvlan: fix a race on port dismantle and possible skb leaks 2014-10-25 16:24:02 -04:00
macvtap.c macvtap: Fix csum_start when VLAN tags are present 2014-11-03 14:52:20 -05:00
mdio.c
mii.c
netconsole.c
nlmon.c net: nlmon: flag nlmon devs with LLTX/SG 2014-03-28 16:49:47 -04:00
ntb_netdev.c net: use ethtool_cmd_speed_set helper to set ethtool speed value 2014-06-06 16:24:07 -07:00
rionet.c net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
sb1000.c
sungem_phy.c sungem: Fix global namespace pollution of phy accessors. 2014-08-27 23:07:12 -07:00
tun.c tun: Fix TUN_PKT_STRIP setting 2014-11-03 14:27:06 -05:00
veth.c net: rtnetlink - make create_link take name_assign_type 2014-07-15 16:13:07 -07:00
virtio_net.c drivers/net: Disable UFO through virtio 2014-10-30 20:01:18 -04:00
vxlan.c vxlan: Do not reuse sockets for a different address family 2014-11-13 15:19:59 -05:00
xen-netfront.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-10-18 09:31:37 -07:00