1. 16 Oct, 2017 9 commits
    • Cong Wang's avatar
      tun: call dev_get_valid_name() before register_netdevice() · 0ad646c8
      Cong Wang authored
      register_netdevice() could fail early when we have an invalid
      dev name, in which case ->ndo_uninit() is not called. For tun
      device, this is a problem because a timer etc. are already
      initialized and it expects ->ndo_uninit() to clean them up.
      
      We could move these initializations into a ->ndo_init() so
      that register_netdevice() knows better, however this is still
      complicated due to the logic in tun_detach().
      
      Therefore, I choose to just call dev_get_valid_name() before
      register_netdevice(), which is quicker and much easier to audit.
      And for this specific case, it is already enough.
      
      Fixes: 96442e42 ("tuntap: choose the txq based on rxq")
      Reported-by: default avatarDmitry Alexeev <avekceeb@gmail.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0ad646c8
    • Nicolas Dichtel's avatar
      net: enable interface alias removal via rtnl · 2459b4c6
      Nicolas Dichtel authored
      IFLA_IFALIAS is defined as NLA_STRING. It means that the minimal length of
      the attribute is 1 ("\0"). However, to remove an alias, the attribute
      length must be 0 (see dev_set_alias()).
      
      Let's define the type to NLA_BINARY to allow 0-length string, so that the
      alias can be removed.
      
      Example:
      $ ip l s dummy0 alias foo
      $ ip l l dev dummy0
      5: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
          link/ether ae:20:30:4f:a7:f3 brd ff:ff:ff:ff:ff:ff
          alias foo
      
      Before the patch:
      $ ip l s dummy0 alias ""
      RTNETLINK answers: Numerical result out of range
      
      After the patch:
      $ ip l s dummy0 alias ""
      $ ip l l dev dummy0
      5: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
          link/ether ae:20:30:4f:a7:f3 brd ff:ff:ff:ff:ff:ff
      
      CC: Oliver Hartkopp <oliver@hartkopp.net>
      CC: Stephen Hemminger <stephen@networkplumber.org>
      Fixes: 96ca4a2c ("net: remove ifalias on empty given alias")
      Reported-by: default avatarJulien FLoret <julien.floret@6wind.com>
      Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2459b4c6
    • David S. Miller's avatar
      Merge branch 'rtnetlink-dev-notification-fixes' · 2fd7c5ab
      David S. Miller authored
      Xin Long says:
      
      ====================
      rtnetlink: a bunch of fixes for userspace notifications in changing dev properties
      
      Whenever any property of a link, address, route, etc. changes by whatever way,
      kernel should notify the programs that listen for such events in userspace.
      
      The patchet "rtnetlink: Cleanup user notifications for netdev events" tried to
      fix a redundant notifications issue, but it also introduced a side effect.
      
      After that, user notifications could only be sent when changing dev properties
      via netlink api. As it removed some events process in rtnetlink_event where
      the notifications was sent to users.
      
      It resulted in no notification generated when dev properties are changed via
      other ways, like ioctl, sysfs, etc. It may cause some user programs doesn't
      work as expected because of the missing notifications.
      
      This patchset will fix it by bringing some of these netdev events back and
      also fix the old redundant notifications issue with a proper way.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2fd7c5ab
    • Xin Long's avatar
      rtnetlink: do not set notification for tx_queue_len in do_setlink · 2d7f669b
      Xin Long authored
      NETDEV_CHANGE_TX_QUEUE_LEN event process in rtnetlink_event would
      send a notification for userspace and tx_queue_len's setting in
      do_setlink would trigger NETDEV_CHANGE_TX_QUEUE_LEN.
      
      So it shouldn't set DO_SETLINK_NOTIFY status for this change to
      send a notification any more.
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Acked-by: default avatarDavid Ahern <dsahern@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2d7f669b
    • Xin Long's avatar
      rtnetlink: check DO_SETLINK_NOTIFY correctly in do_setlink · 64ff90cc
      Xin Long authored
      The check 'status & DO_SETLINK_NOTIFY' in do_setlink doesn't really
      work after status & DO_SETLINK_MODIFIED, as:
      
        DO_SETLINK_MODIFIED 0x1
        DO_SETLINK_NOTIFY 0x3
      
      Considering that notifications are suppposed to be sent only when
      status have the flag DO_SETLINK_NOTIFY, the right check would be:
      
        (status & DO_SETLINK_NOTIFY) == DO_SETLINK_NOTIFY
      
      This would avoid lots of duplicated notifications when setting some
      properties of a link.
      
      Fixes: ba998906 ("rtnl/do_setlink(): notify when a netdev is modified")
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Acked-by: default avatarDavid Ahern <dsahern@gmail.com>
      Acked-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      64ff90cc
    • Xin Long's avatar
      rtnetlink: bring NETDEV_CHANGEUPPER event process back in rtnetlink_event · dc709f37
      Xin Long authored
      libteam needs this event notification in userspace when dev's master
      dev has been changed. After this, the redundant notifications issue
      would be fixed in the later patch 'rtnetlink: check DO_SETLINK_NOTIFY
      correctly in do_setlink'.
      
      Fixes: b6b36eb2 ("rtnetlink: Do not generate notifications for NETDEV_CHANGEUPPER event")
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Acked-by: default avatarDavid Ahern <dsahern@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      dc709f37
    • Xin Long's avatar
      rtnetlink: bring NETDEV_POST_TYPE_CHANGE event process back in rtnetlink_event · e6e66594
      Xin Long authored
      As I said in patch 'rtnetlink: bring NETDEV_CHANGEMTU event process back
      in rtnetlink_event', removing NETDEV_POST_TYPE_CHANGE event was not the
      right fix for the redundant notifications issue.
      
      So bring this event process back to rtnetlink_event and the old redundant
      notifications issue would be fixed in the later patch 'rtnetlink: check
      DO_SETLINK_NOTIFY correctly in do_setlink'.
      
      Fixes: aef091ae ("rtnetlink: Do not generate notifications for POST_TYPE_CHANGE event")
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Acked-by: default avatarDavid Ahern <dsahern@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e6e66594
    • Xin Long's avatar
      rtnetlink: bring NETDEV_CHANGE_TX_QUEUE_LEN event process back in rtnetlink_event · ebdcf045
      Xin Long authored
      The same fix for changing mtu in the patch 'rtnetlink: bring
      NETDEV_CHANGEMTU event process back in rtnetlink_event' is
      needed for changing tx_queue_len.
      
      Note that the redundant notifications issue for tx_queue_len
      will be fixed in the later patch 'rtnetlink: do not send
      notification for tx_queue_len in do_setlink'.
      
      Fixes: 27b3b551 ("rtnetlink: Do not generate notifications for NETDEV_CHANGE_TX_QUEUE_LEN event")
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Acked-by: default avatarDavid Ahern <dsahern@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ebdcf045
    • Xin Long's avatar
      rtnetlink: bring NETDEV_CHANGEMTU event process back in rtnetlink_event · 8a212589
      Xin Long authored
      Commit 085e1a65 ("rtnetlink: Do not generate notifications for MTU
      events") tried to fix the redundant notifications issue when ip link
      set mtu by removing NETDEV_CHANGEMTU event process in rtnetlink_event.
      
      But it also resulted in no notification generated when dev's mtu is
      changed via other methods, like:
        'ifconfig eth1 mtu 1400' or 'echo 1400 > /sys/class/net/eth1/mtu'
      It would cause users not to be notified by this change.
      
      This patch is to fix it by bringing NETDEV_CHANGEMTU event back into
      rtnetlink_event, and the redundant notifications issue will be fixed
      in the later patch 'rtnetlink: check DO_SETLINK_NOTIFY correctly in
      do_setlink'.
      
      Fixes: 085e1a65 ("rtnetlink: Do not generate notifications for MTU events")
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8a212589
  2. 15 Oct, 2017 10 commits
  3. 13 Oct, 2017 4 commits
  4. 12 Oct, 2017 1 commit
    • Samuel Mendoza-Jonas's avatar
      net/ncsi: Don't limit vids based on hot_channel · 6e9c0075
      Samuel Mendoza-Jonas authored
      Currently we drop any new VLAN ids if there are more than the current
      (or last used) channel can support. Most importantly this is a problem
      if no channel has been selected yet, resulting in a segfault.
      
      Secondly this does not necessarily reflect the capabilities of any other
      channels. Instead only drop a new VLAN id if we are already tracking the
      maximum allowed by the NCSI specification. Per-channel limits are
      already handled by ncsi_add_filter(), but add a message to set_one_vid()
      to make it obvious that the channel can not support any more VLAN ids.
      Signed-off-by: default avatarSamuel Mendoza-Jonas <sam@mendozajonas.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6e9c0075
  5. 11 Oct, 2017 4 commits
  6. 10 Oct, 2017 10 commits
  7. 09 Oct, 2017 2 commits
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · ff33952e
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Fix object leak on IPSEC offload failure, from Steffen Klassert.
      
       2) Fix range checks in ipset address range addition operations, from
          Jozsef Kadlecsik.
      
       3) Fix pernet ops unregistration order in ipset, from Florian Westphal.
      
       4) Add missing netlink attribute policy for nl80211 packet pattern
          attrs, from Peng Xu.
      
       5) Fix PPP device destruction race, from Guillaume Nault.
      
       6) Write marks get lost when BPF verifier processes R1=R2 register
          assignments, causing incorrect liveness information and less state
          pruning. Fix from Alexei Starovoitov.
      
       7) Fix blockhole routes so that they are marked dead and therefore not
          cached in sockets, otherwise IPSEC stops working. From Steffen
          Klassert.
      
       8) Fix broadcast handling of UDP socket early demux, from Paolo Abeni.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (37 commits)
        cdc_ether: flag the u-blox TOBY-L2 and SARA-U2 as wwan
        net: thunderx: mark expected switch fall-throughs in nicvf_main()
        udp: fix bcast packet reception
        netlink: do not set cb_running if dump's start() errs
        ipv4: Fix traffic triggered IPsec connections.
        ipv6: Fix traffic triggered IPsec connections.
        ixgbe: incorrect XDP ring accounting in ethtool tx_frame param
        net: ixgbe: Use new PCI_DEV_FLAGS_NO_RELAXED_ORDERING flag
        Revert commit 1a8b6d76 ("net:add one common config...")
        ixgbe: fix masking of bits read from IXGBE_VXLANCTRL register
        ixgbe: Return error when getting PHY address if PHY access is not supported
        netfilter: xt_bpf: Fix XT_BPF_MODE_FD_PINNED mode of 'xt_bpf_info_v1'
        netfilter: SYNPROXY: skip non-tcp packet in {ipv4, ipv6}_synproxy_hook
        tipc: Unclone message at secondary destination lookup
        tipc: correct initialization of skb list
        gso: fix payload length when gso_size is zero
        mlxsw: spectrum_router: Avoid expensive lookup during route removal
        bpf: fix liveness marking
        doc: Fix typo "8023.ad" in bonding documentation
        ipv6: fix net.ipv6.conf.all.accept_dad behaviour for real
        ...
      ff33952e
    • Aleksander Morgado's avatar
      cdc_ether: flag the u-blox TOBY-L2 and SARA-U2 as wwan · fdfbad32
      Aleksander Morgado authored
      The u-blox TOBY-L2 is a LTE Cat 4 module with HSPA+ and 2G fallback.
      This module allows switching to different USB profiles with the
      'AT+UUSBCONF' command, and provides a ECM network interface when the
      'AT+UUSBCONF=2' profile is selected.
      
      The u-blox SARA-U2 is a HSPA module with 2G fallback. The default USB
      configuration includes a ECM network interface.
      
      Both these modules are controlled via AT commands through one of the
      TTYs exposed. Connecting these modules may be done just by activating
      the desired PDP context with 'AT+CGACT=1,<cid>' and then running DHCP
      on the ECM interface.
      Signed-off-by: default avatarAleksander Morgado <aleksander@aleksander.es>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fdfbad32