linux/net
Nicolas Dichtel 95bd9e47cd ip_tunnel: restore binding to ifaces with a large mtu
commit 82612de1c9 upstream.

After commit f6cc9c054e, the following conf is broken (note that the
default loopback mtu is 65536, ie IP_MAX_MTU + 1):

$ ip tunnel add gre1 mode gre local 10.125.0.1 remote 10.125.0.2 dev lo
add tunnel "gre0" failed: Invalid argument
$ ip l a type dummy
$ ip l s dummy1 up
$ ip l s dummy1 mtu 65535
$ ip tunnel add gre1 mode gre local 10.125.0.1 remote 10.125.0.2 dev dummy1
add tunnel "gre0" failed: Invalid argument

dev_set_mtu() doesn't allow to set a mtu which is too large.
First, let's cap the mtu returned by ip_tunnel_bind_dev(). Second, remove
the magic value 0xFFF8 and use IP_MAX_MTU instead.
0xFFF8 seems to be there for ages, I don't know why this value was used.

With a recent kernel, it's also possible to set a mtu > IP_MAX_MTU:
$ ip l s dummy1 mtu 66000
After that patch, it's also possible to bind an ip tunnel on that kind of
interface.

CC: Petr Machata <petrm@mellanox.com>
CC: Ido Schimmel <idosch@mellanox.com>
Link: https://git.kernel.org/pub/scm/linux/kernel/git/davem/netdev-vger-cvs.git/commit/?id=e5afd356a411a
Fixes: f6cc9c054e ("ip_tunnel: Emit events for post-register MTU changes")
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backported to 3.16:
 - Drop change in ip_tunnel_create()
 - Adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2018-10-21 08:46:22 +01:00
..
9p 9p/trans_virtio: discard zero-length reply 2018-06-16 22:22:12 +01:00
802 neigh: use NEIGH_VAR_INIT in ndo_neigh_setup functions. 2014-01-16 11:31:58 -08:00
8021q 8021q: fix a memory leak for VLAN 0 device 2018-03-03 15:52:21 +00:00
appletalk appletalk: Fix socket referencing in skb 2014-07-08 19:39:43 -07:00
atm net: atm: Fix potential Spectre v1 2018-10-21 08:45:54 +01:00
ax25 Revert "ax25: add link layer header validation function" 2016-06-15 21:29:20 +01:00
batman-adv batman-adv: prevent TT request storms by not sending inconsistent TT TLVLs 2018-10-21 08:46:03 +01:00
bluetooth Bluetooth: hidp: buffer overflow in hidp_process_report 2018-09-25 23:47:25 +01:00
bridge netfilter: ebtables: handle string from userspace with care 2018-10-21 08:46:12 +01:00
caif net: caif: fix misleading indentation 2017-11-11 13:33:52 +00:00
can can: af_can: canfd_rcv(): replace WARN_ONCE by pr_warn_once 2018-03-03 15:52:26 +00:00
ceph libceph: validate con->state at the top of try_write() 2018-10-21 08:45:46 +01:00
core vlan: Fix reading memory beyond skb->tail in skb_vlan_tagged_multi 2018-10-21 08:45:30 +01:00
dcb net: Use netlink_ns_capable to verify the permisions of netlink messages 2014-04-24 13:44:54 -04:00
dccp dccp: fix tasklet usage 2018-10-21 08:45:53 +01:00
decnet dn_getsockoptdecnet: move nf_{get/set}sockopt outside sock lock 2018-06-16 22:22:18 +01:00
dns_resolver KEYS: DNS: limit the length of option strings 2018-10-21 08:45:30 +01:00
dsa net: dsa: Fix off-by-one in switch address parsing 2015-08-10 17:10:19 +01:00
ethernet net: eth_type_trans() should use skb_header_pointer() 2014-01-16 15:30:31 -08:00
hsr hsr: replace del_timer by del_timer_sync 2014-03-27 15:28:06 -04:00
ieee802154 ieee802154: Fix sockaddr_ieee802154 implicit padding information leak. 2015-07-15 10:00:19 +01:00
ipv4 ip_tunnel: restore binding to ifaces with a large mtu 2018-10-21 08:46:22 +01:00
ipv6 net: test tailroom before appending to linear skb 2018-10-21 08:46:13 +01:00
ipx ipx: call ipxitf_put() in ioctl error path 2017-06-05 21:17:23 +01:00
irda irda: Only insert new objects into the global database via setsockopt 2018-10-03 04:10:07 +01:00
iucv af_iucv: Move sockaddr length checks to before accessing sa_family in bind and connect handlers 2017-10-12 15:27:52 +01:00
key af_key: fix buffer overread in parse_exthdrs() 2018-03-03 15:52:08 +00:00
l2tp l2tp: check sockaddr length in pppol2tp_connect() 2018-10-21 08:45:40 +01:00
lapb net/lapb: re-send packets on timeout 2013-09-23 16:52:45 -04:00
llc llc: better deal with too small mtu 2018-10-21 08:45:56 +01:00
mac80211 cfg80211: fix cfg80211_beacon_dup 2018-06-16 22:22:20 +01:00
mac802154 mac802154: don't deliver packets to devices that are down 2014-06-11 12:10:19 -07:00
mpls net: gso: use feature flag argument in all protocol gso handlers 2015-08-27 14:27:14 +01:00
netfilter ipvs: fix buffer overflow with sync daemon and service 2018-10-21 08:46:16 +01:00
netlabel netlabel: add address family checks to netlbl_{sock,req}_delattr() 2016-11-20 01:16:39 +00:00
netlink netlink: fix uninit-value in netlink_sendmsg 2018-10-21 08:45:17 +01:00
netrom net: Fix use after free by removing length arg from sk_data_ready callbacks. 2014-04-11 16:15:36 -04:00
nfc NFC: llcp: Limit size of SDP URI 2018-06-16 22:22:18 +01:00
openvswitch ovs: do not allocate memory from offline numa node 2015-10-28 10:33:20 +00:00
packet packet: fix bitfield update race 2018-10-21 08:45:41 +01:00
phonet phonet: properly unshare skbs in phonet_rcv() 2016-01-28 10:51:50 +00:00
rds rds: Fix NULL pointer dereference in __rds_rdma_map 2018-03-03 15:52:35 +00:00
rfkill rfkill: gpio: fix memory leak in probe error path 2018-10-21 08:45:56 +01:00
rose rose: limit sk_filter trim to payload 2017-02-23 03:54:46 +00:00
rxrpc rxrpc: Fix several cases where a padded len isn't checked in ticket decode 2017-07-02 17:13:03 +01:00
sched net_sched: fq: take care of throttled flows before reuse 2018-10-21 08:45:52 +01:00
sctp sctp: fix the issue that the cookie-ack with auth can't get processed 2018-10-21 08:45:51 +01:00
sunrpc rpc_pipefs: fix double-dput() 2018-10-21 08:45:26 +01:00
tipc tipc: check minimum bearer MTU 2017-02-23 03:54:42 +00:00
unix net/unix: don't show information about sockets from other namespaces 2018-01-01 20:51:59 +00:00
vmw_vsock VSOCK: Detach QP check should filter out non matching QPs. 2017-11-26 13:50:40 +00:00
wimax wimax: remove dead code 2013-11-21 13:09:42 -05:00
wireless nl80211: Sanitize array index in parse_txq_params 2018-03-19 18:59:14 +00:00
x25 net: fix a kernel infoleak in x25 module 2016-06-15 21:29:34 +01:00
xfrm xfrm_user: uncoditionally validate esn replay attribute struct 2018-06-16 22:22:13 +01:00
compat.c net: support compat 64-bit time in {s,g}etsockopt 2018-10-21 08:45:49 +01:00
Kconfig Merge branch 'for-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup 2014-04-03 13:05:42 -07:00
Makefile net: move 6lowpan compression code to separate module 2014-01-15 15:36:38 -08:00
nonet.c llseek: automatically add .llseek fop 2010-10-15 15:53:27 +02:00
socket.c net: socket: fix recvmmsg not returning error from sock_error 2017-03-16 02:27:23 +00:00
sysctl_net.c net: Update the sysctl permissions handler to test effective uid/gid 2013-10-07 15:57:56 -04:00