1. 27 Oct, 2017 20 commits
  2. 20 Oct, 2017 20 commits
    • Kalle Valo's avatar
      Merge tag 'iwlwifi-next-for-kalle-2017-10-18' of... · 5e5c79b2
      Kalle Valo authored
      Merge tag 'iwlwifi-next-for-kalle-2017-10-18' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next
      
      Second batch of iwlwifi patches for 4.15
      
      * Allocate reorder buffer dynamically to save memory;
      * Fix a FW dump problem in the A000 family;
      * Fix for a statistics gathering issue (v2);
      * Sort the list of 9000 devices to make it easier to find entries;
      * A couple of cleanups in the FW dump code;
      * Remove some unnecessary variables and fields and calculations;
      5e5c79b2
    • Eric Dumazet's avatar
      net-tun: fix panics at dismantle time · aec72f33
      Eric Dumazet authored
      syzkaller got crashes at dismantle time [1]
      
      It is not correct to test (tun->flags & IFF_NAPI) in tun_napi_disable()
      and tun_napi_del() : Each tun_file can have different mode, depending
      on how they were created.
      
      Similarly I have changed tun_get_user() and tun_poll_controller()
      to use the new tfile->napi_enabled boolean.
      
      [  154.331360] BUG: unable to handle kernel NULL pointer dereference at           (null)
      [  154.339220] IP: [<ffffffff9634cad6>] hrtimer_active+0x26/0x60
      [  154.344983] PGD 0
      [  154.347009] Oops: 0000 [#1] SMP
      [  154.350680] gsmi: Log Shutdown Reason 0x03
      [  154.379572] task: ffff994719150dc0 ti: ffff99475c0ae000 task.ti: ffff99475c0ae000
      [  154.387043] RIP: 0010:[<ffffffff9634cad6>]  [<ffffffff9634cad6>] hrtimer_active+0x26/0x60
      [  154.395232] RSP: 0018:ffff99475c0afce8  EFLAGS: 00010246
      [  154.400542] RAX: ffff994754850ac0 RBX: ffff994753e65408 RCX: ffff994753e65388
      [  154.407666] RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff994753e65408
      [  154.414790] RBP: ffff99475c0afce8 R08: 0000000000000000 R09: 0000000000000000
      [  154.421921] R10: ffff99475f6f5910 R11: 0000000000000001 R12: 0000000000000000
      [  154.429044] R13: ffff99417deab668 R14: ffff99417deaa780 R15: ffff99475f45dde0
      [  154.436174] FS:  0000000000000000(0000) GS:ffff994767a00000(0000) knlGS:0000000000000000
      [  154.444249] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  154.449986] CR2: 0000000000000000 CR3: 00000005a8a0e000 CR4: 0000000000022670
      [  154.457110] Stack:
      [  154.459120]  ffff99475c0afd28 ffffffff9634d614 1000000000000000 0000000000000000
      [  154.466598]  ffffe54240000000 ffff994753e65408 ffff994753e653a8 ffff99417deab668
      [  154.474067]  ffff99475c0afd48 ffffffff9634d6fd ffff99474c2be678 ffff994753e65398
      [  154.481537] Call Trace:
      [  154.483985]  [<ffffffff9634d614>] hrtimer_try_to_cancel+0x24/0xf0
      [  154.490074]  [<ffffffff9634d6fd>] hrtimer_cancel+0x1d/0x30
      [  154.495563]  [<ffffffff96860b3c>] napi_disable+0x3c/0x70
      [  154.500875]  [<ffffffff9678ae62>] __tun_detach+0xd2/0x360
      [  154.506272]  [<ffffffff9678b117>] tun_chr_close+0x27/0x40
      [  154.511669]  [<ffffffff9646ebe6>] __fput+0xd6/0x1e0
      [  154.516548]  [<ffffffff9646ed3e>] ____fput+0xe/0x10
      [  154.521429]  [<ffffffff963035a2>] task_work_run+0x72/0x90
      [  154.526827]  [<ffffffff962e9407>] do_exit+0x317/0xb60
      [  154.531879]  [<ffffffff962e9c8f>] do_group_exit+0x3f/0xa0
      [  154.537275]  [<ffffffff962e9d07>] SyS_exit_group+0x17/0x20
      [  154.542769]  [<ffffffff969784be>] entry_SYSCALL_64_fastpath+0x12/0x17
      
      Fixes: 94317099 ("net-tun: enable NAPI for TUN/TAP driver")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      aec72f33
    • David Ahern's avatar
      net: ipv4: Change fib notifiers to take a fib_alias · 6eba87c7
      David Ahern authored
      All of the notifier data (fib_info, tos, type and table id) are
      contained in the fib_alias. Pass it to the notifier instead of
      each data separately shortening the argument list by 3.
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Reviewed-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6eba87c7
    • Yuchung Cheng's avatar
      tcp: socket option to set TCP fast open key · 1fba70e5
      Yuchung Cheng authored
      New socket option TCP_FASTOPEN_KEY to allow different keys per
      listener.  The listener by default uses the global key until the
      socket option is set.  The key is a 16 bytes long binary data. This
      option has no effect on regular non-listener TCP sockets.
      Signed-off-by: default avatarYuchung Cheng <ycheng@google.com>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Reviewed-by: default avatarChristoph Paasch <cpaasch@apple.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1fba70e5
    • David S. Miller's avatar
      Merge branch 'mlxsw-extack' · ce12f7dd
      David S. Miller authored
      David Ahern says:
      
      ====================
      mlxsw: spectrum_router: Add extack messages for RIF and VRF overflow
      
      Currently, exceeding the number of VRF instances or the number of router
      interfaces either fails with a non-intuitive EBUSY:
          $ ip li set swp1s1.6 vrf vrf-1s1-6 up
          RTNETLINK answers: Device or resource busy
      
      or fails silently (IPv6) since the checks are done in a work queue. This
      set adds support for the address validator notifier to spectrum which
      allows ext-ack based messages to be returned on failure.
      
      To make that happen the IPv6 version needs to be converted from atomic
      to blocking (patch 2), and then support for extack needs to be added
      to the notifier (patch 3). Patch 1 reworks the locking in ipv6_add_addr
      to work better in the atomic and non-atomic code paths. Patches 4 and 5
      add the validator notifier to spectrum and then plumb the extack argument
      through spectrum_router.
      
      With this set, VRF overflows fail with:
         $ ip li set swp1s1.6 vrf vrf-1s1-6 up
         Error: spectrum: Exceeded number of supported VRF.
      
      and RIF overflows fail with:
         $ ip addr add dev swp1s2.191 10.12.191.1/24
         Error: spectrum: Exceeded number of supported router interfaces.
      
      v2 -> v3
      - fix surround context of patch 4 which was altered by c30f5d01
      
      v1 -> v2
      - fix error path in ipv6_add_addr: reset rt to NULL (Ido comment) and
        add in6_dev_put on ifa once the hold has been done
      
      RFC -> v1
      - addressed various comments from Ido
      - refactored ipv6_add_addr to allow ifa's to be allocated with
        GFP_KERNEL as requested by DaveM
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ce12f7dd
    • David Ahern's avatar
      mlxsw: spectrum_router: Add extack message for RIF and VRF overflow · f8fa9b4e
      David Ahern authored
      Add extack argument down to mlxsw_sp_rif_create and mlxsw_sp_vr_create
      to set an error message on RIF or VR overflow. Now on overflow of
      either resource the user gets an informative message as opposed to
      failing with EBUSY.
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Reviewed-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f8fa9b4e
    • David Ahern's avatar
      mlxsw: spectrum: router: Add support for address validator notifier · 89d5dd2e
      David Ahern authored
      Add support for inetaddr_validator and inet6addr_validator. The
      notifiers provide a means for validating ipv4 and ipv6 addresses
      before the addresses are installed and on failure the error
      is propagated back to the user.
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Reviewed-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      89d5dd2e
    • David Ahern's avatar
      net: Add extack to validator_info structs used for address notifier · de95e047
      David Ahern authored
      Add extack to in_validator_info and in6_validator_info. Update the one
      user of each, ipvlan, to return an error message for failures.
      
      Only manual configuration of an address is plumbed in the IPv6 code path.
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Reviewed-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      de95e047
    • David Ahern's avatar
      net: ipv6: Make inet6addr_validator a blocking notifier · ff7883ea
      David Ahern authored
      inet6addr_validator chain was added by commit 3ad7d246 ("Ipvlan
      should return an error when an address is already in use") to allow
      address validation before changes are committed and to be able to
      fail the address change with an error back to the user. The address
      validation is not done for addresses received from router
      advertisements.
      
      Handling RAs in softirq context is the only reason for the notifier
      chain to be atomic versus blocking. Since the only current user, ipvlan,
      of the validator chain ignores softirq context, the notifier can be made
      blocking and simply not invoked for softirq path.
      
      The blocking option is needed by spectrum for example to validate
      resources for an adding an address to an interface.
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Reviewed-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ff7883ea
    • David Ahern's avatar
      ipv6: addrconf: cleanup locking in ipv6_add_addr · f3d9832e
      David Ahern authored
      ipv6_add_addr is called in process context with rtnl lock held
      (e.g., manual config of an address) or during softirq processing
      (e.g., autoconf and address from a router advertisement).
      
      Currently, ipv6_add_addr calls rcu_read_lock_bh shortly after entry
      and does not call unlock until exit, minus the call around the address
      validator notifier. Similarly, addrconf_hash_lock is taken after the
      validator notifier and held until exit. This forces the allocation of
      inet6_ifaddr to always be atomic.
      
      Refactor ipv6_add_addr as follows:
      1. add an input boolean to discriminate the call path (process context
         or softirq). This new flag controls whether the alloc can be done
         with GFP_KERNEL or GFP_ATOMIC.
      
      2. Move the rcu_read_lock_bh and unlock calls only around functions that
         do rcu updates.
      
      3. Remove the in6_dev_hold and put added by 3ad7d246 ("Ipvlan should
         return an error when an address is already in use."). This was done
         presumably because rcu_read_unlock_bh needs to be called before calling
         the validator. Since rcu_read_lock is not needed before the validator
         runs revert the hold and put added by 3ad7d246 and only do the
         hold when setting ifp->idev.
      
      4. move duplicate address check and insertion of new address in the global
         address hash into a helper. The helper is called after an ifa is
         allocated and filled in.
      
      This allows the ifa for manually configured addresses to be done with
      GFP_KERNEL and reduces the overall amount of time with rcu_read_lock held
      and hash table spinlock held.
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f3d9832e
    • David S. Miller's avatar
      Merge branch 's390-next' · 6b1f8eda
      David S. Miller authored
      Julian Wiedmann says:
      
      ====================
      s390/net: updates 2017-10-18
      
      please apply some additional robustness fixes and cleanups for 4.15.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6b1f8eda
    • Julian Wiedmann's avatar
      s390/qeth: don't dump control cmd twice · 52c44d29
      Julian Wiedmann authored
      A few lines down, qeth_prepare_control_data() makes further changes to
      the control cmd buffer, and then also writes a trace entry for it.
      So the first entry just pollutes the trace file with intermediate data,
      drop it.
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.vnet.ibm.com>
      Reviewed-by: default avatarUrsula Braun <ubraun@linux.vnet.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      52c44d29
    • Julian Wiedmann's avatar
      s390/qeth: support GRO flush timer · 978759e8
      Julian Wiedmann authored
      Switch to napi_complete_done(), and thus enable delayed GRO flushing.
      The timeout is configured via /sys/class/net/<if>/gro_flush_timeout.
      
      Default timeout is 0, so no change in behaviour.
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.vnet.ibm.com>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      978759e8
    • Julian Wiedmann's avatar
      s390/qeth: try harder to get packets from RX buffer · 864c17c3
      Julian Wiedmann authored
      Current code bails out when two subsequent buffer elements hold
      insufficient data to contain a qeth_hdr packet descriptor.
      This seems reasonable, but it would be legal for quirky hardware to
      leave a few elements empty and then present packets in a subsequent
      element. These packets would currently be dropped.
      
      So make sure to check all buffer elements, until we hit the LAST_ENTRY
      indication.
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.vnet.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      864c17c3
    • Julian Wiedmann's avatar
      s390/qeth: consolidate skb allocation · 8d68af6a
      Julian Wiedmann authored
      Move the allocation of SG skbs into the main path. This allows for
      a little code sharing, and handling ENOMEM from within one place.
      
      As side effect, L2 SG skbs now get the proper amount of additional
      headroom (read: zero) instead of the hard-coded ETH_HLEN.
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.vnet.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8d68af6a
    • Julian Wiedmann's avatar
      s390/qeth: clean up page frag creation · b6f72f96
      Julian Wiedmann authored
      Replace the open-coded skb_add_rx_frag(), and use a fall-through
      to remove some duplicated code.
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.vnet.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b6f72f96
    • Julian Wiedmann's avatar
      s390/qeth: no VLAN support on OSM · 9400c53f
      Julian Wiedmann authored
      Instead of silently discarding VLAN registration requests on OSM,
      just indicate that this card type doesn't support VLAN.
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.vnet.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9400c53f
    • Julian Wiedmann's avatar
      s390/qeth: don't verify device when setting MAC address · 857d8ee2
      Julian Wiedmann authored
      There's no reason why l2_set_mac_address() should ever be called for
      a netdevice that's not owned by qeth. It's certainly not required for
      VLAN devices, which have their own netdev_ops.
      
      Also:
      1) we don't do such validation for any of the other netdev_ops routines.
      2) the code in question clearly has never been actually exercised;
         it's broken. After determining that the device is not owned
         by qeth, it would still use dev->ml_priv to write a qeth trace entry.
      
      Remove the check, and its helper that walked the global card list.
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.vnet.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      857d8ee2
    • Julian Wiedmann's avatar
      s390/qeth: clean up initial MTU determination · 6e6f472d
      Julian Wiedmann authored
      1. Drop the support for Token Ring,
      2. use the ETH_DATA_LEN macro for the default L2 MTU,
      3. handle OSM via the default case (as OSM is L2-only), and
      4. document why the L3 MTU is reduced.
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.vnet.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6e6f472d
    • Julian Wiedmann's avatar
      s390/qeth: fix early exit from error path · 83cf79a2
      Julian Wiedmann authored
      When the allocation of the addr buffer fails, we need to free
      our refcount on the inetdevice before returning.
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.vnet.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      83cf79a2