1. 09 11月, 2015 2 次提交
  2. 08 11月, 2015 4 次提交
    • M
      dwc_eth_qos: Delete an unnecessary check before the function call "of_node_put" · 3694bfbd
      Markus Elfring 提交于
      The of_node_put() function tests whether its argument is NULL
      and then returns immediately.
      Thus the test around the call is not needed.
      
      This issue was detected by using the Coccinelle software.
      Signed-off-by: NMarkus Elfring <elfring@users.sourceforge.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3694bfbd
    • J
      bonding: fix panic on non-ARPHRD_ETHER enslave failure · 40baec22
      Jay Vosburgh 提交于
      Since commit 7d5cd2ce529b, when bond_enslave fails on devices that
      are not ARPHRD_ETHER, if needed, it resets the bonding device back to
      ARPHRD_ETHER by calling ether_setup.
      
      	Unfortunately, ether_setup clobbers dev->flags, clearing IFF_UP
      if the bond device is up, leaving it in a quasi-down state without
      having actually gone through dev_close.  For bonding, if any periodic
      work queue items are active (miimon, arp_interval, etc), those will
      remain running, as they are stopped by bond_close.  At this point, if
      the bonding module is unloaded or the bond is deleted, the system will
      panic when the work function is called.
      
      	This panic is resolved by calling dev_close on the bond itself
      prior to calling ether_setup.
      
      Cc: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: NJay Vosburgh <jay.vosburgh@canonical.com>
      Fixes: 7d5cd2ce ("bonding: correctly handle bonding type change on enslave failure")
      Acked-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      40baec22
    • J
      net/qlcnic: fix mac address restore in bond mode 5/6 · e824de8a
      Jarod Wilson 提交于
      The bonding driver saves a copy of slaves' original mac address and then
      assigns whatever mac as needed to the slave, depending on mode. In at
      least modes 5 and 6 (balance-tlb, balance-alb), it often ends up being the
      mac address of another slave. On release from the bond, the original mac
      address is supposed to get restored via a dev_set_mac_address() call in
      the bonding driver's __bond_release_one() function, which calls the
      slave's ndo_set_mac_address function, which for qlcnic, is
      qlcnic_set_mac().
      
      Now, this function tries to be somewhat intelligent and exit early if
      you're trying to set the mac address to the same thing that is already
      set. The problem here is that adapter->mac_addr isn't in sync with
      netdev->dev_addr. The qlcnic driver still has the original mac stored in
      adapter->mac_addr, while the bonding driver has updated netdev->dev_addr,
      so qlcnic thinks we're trying to set the same address it already has.
      
      I think the way to go here, since the function updates both netdev and
      adapter's stored mac addresses, is to check if either of them doesn't
      match the newly requested mac. Simply checking netdev's value only could
      result in a similar mismatch and non-update, so look at both.
      
      CC: Dept-GELinuxNICDev@qlogic.com
      CC: netdev@vger.kernel.org
      CC: Manish Chopra <manish.chopra@qlogic.com>
      Signed-off-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e824de8a
    • M
      fjes: Delete an unnecessary check before the function call "vfree" · f7b5964d
      Markus Elfring 提交于
      The vfree() function performs also input parameter validation.
      Thus the test around the call is not needed.
      
      This issue was detected by using the Coccinelle software.
      Signed-off-by: NMarkus Elfring <elfring@users.sourceforge.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f7b5964d
  3. 06 11月, 2015 16 次提交
  4. 05 11月, 2015 18 次提交
    • Y
      bpf: add mod default A and X test cases · d4e4bc16
      Yang Shi 提交于
      When running "mod X" operation, if X is 0 the filter has to be halt.
      Add new test cases to cover A = A mod X if X is 0, and A = A mod 1.
      
      CC: Xi Wang <xi.wang@gmail.com>
      CC: Zi Shen Lim <zlim.lnx@gmail.com>
      Signed-off-by: NYang Shi <yang.shi@linaro.org>
      Acked-by: NDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: NAlexei Starovoitov <ast@kernel.org>
      Acked-by: NZi Shen Lim <zlim.lnx@gmail.com>
      Acked-by: NXi Wang <xi.wang@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d4e4bc16
    • A
      bnxt_en: add VXLAN dependency · df761ea1
      Arnd Bergmann 提交于
      VXLAN may be a loadable module, and this driver cannot be built-in
      in that case, or we get a link error:
      
      drivers/built-in.o: In function `__bnxt_open_nic':
      drivers/net/ethernet/broadcom/bnxt/bnxt.c:4581: undefined reference to `vxlan_get_rx_port'
      
      This adds a Kconfig dependency that ensures that either VXLAN is
      disabled (which the driver handles correctly), or we depend on
      VXLAN itself and disallow built-in compilation when VXLAN is
      a module.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: c0c050c5 ("bnxt_en: New Broadcom ethernet driver.")
      Acked-by: NMichael Chan <mchan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      df761ea1
    • J
      net: add forgotten IFF_L3MDEV_SLAVE define · 8f25348b
      Jiri Pirko 提交于
      Fixes: fee6d4c7 ("net: Add netif_is_l3_slave")
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Acked-by: NDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8f25348b
    • S
      ipv6: clean up dev_snmp6 proc entry when we fail to initialize inet6_dev · 2a189f9e
      Sabrina Dubroca 提交于
      In ipv6_add_dev, when addrconf_sysctl_register fails, we do not clean up
      the dev_snmp6 entry that we have already registered for this device.
      Call snmp6_unregister_dev in this case.
      
      Fixes: a317a2f1 ("ipv6: fail early when creating netdev named all or default")
      Reported-by: NDmitry Vyukov <dvyukov@google.com>
      Signed-off-by: NSabrina Dubroca <sd@queasysnail.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2a189f9e
    • D
      qlogic: qed: fix a test for MODE_MF_SI · 87aec47d
      Dan Carpenter 提交于
      MODE_MF_SI is 9.  We should be testing bit 9 instead of AND 0x9.
      
      Fixes: fe56b9e6 ('qed: Add module with basic common support')
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Acked-by: NYuval Mintz <Yuval.Mintz@qlogic.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      87aec47d
    • D
      qlogic/qed: remove bogus NULL check · 8c169c28
      Dan Carpenter 提交于
      We check if "p_hwfn" is NULL and then dereference it in the error
      handling code.  I read the code and it isn't NULL so let's remove the
      check.
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Acked-by: NYuval Mintz <Yuval.Mintz@qlogic.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8c169c28
    • J
      Bluetooth: L2CAP: Add missing checks for invalid LE DCID · 40624183
      Johan Hedberg 提交于
      When receiving a connect response we should make sure that the DCID is
      within the valid range and that we don't already have another channel
      allocated for the same DCID.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      40624183
    • J
      Bluetooth: L2CAP: Fix checked range when allocating new CID · ab0c127f
      Johan Hedberg 提交于
      The 'dyn_end' value is also a valid CID so it should be included in
      the range of values checked.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      ab0c127f
    • J
      Bluetooth: L2CAP: Fix returning correct LE CoC response codes · 8a7889cc
      Johan Hedberg 提交于
      The core spec defines specific response codes for situations when the
      received CID is incorrect. Add the defines for these and return them
      as appropriate from the LE Connect Request handler function.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      8a7889cc
    • M
      Bluetooth: Check for supported white list before issuing commands · 2ab216a7
      Marcel Holtmann 提交于
      The white list commands might not be implemented if the controller does
      not actually support the white list. So check the supported commands
      first before issuing these commands. Not supporting the white list is
      the same as supporting a white list with zero size.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      2ab216a7
    • K
      Bluetooth: Fix possible deadlock in btusb · f6fc86f2
      Kuba Pawlak 提交于
      commit 8f9d02f4 introduced spinlocks
      in btusb_work. This is run in a context of a worqueue and can be interrupted
      by hardware irq. If it happens while spinlock is held, we have a deadlock.
      Solution is to use _irqsave/_resore version of locking
      
      [  466.460560] =================================
      [  466.460565] [ INFO: inconsistent lock state ]
      [  466.460572] 4.3.0-rc6+ #1 Tainted: G        W
      [  466.460576] ---------------------------------
      [  466.460582] inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage.
      [  466.460589] kworker/0:2/94 [HC0[0]:SC0[0]:HE1:SE1] takes:
      [  466.460595]  (&(&data->rxlock)->rlock){?.-...}, at: [<ffffffffa0526923>] btusb_work+0xa3/0x3fd [btusb]
      [  466.460621] {IN-HARDIRQ-W} state was registered at:
      [  466.460625]   [<ffffffff811021b5>] __lock_acquire+0xc45/0x1e80
      [  466.460638]   [<ffffffff811040d5>] lock_acquire+0xe5/0x1f0
      [  466.460646]   [<ffffffff8182f108>] _raw_spin_lock+0x38/0x50
      [  466.460657]   [<ffffffffa0525448>] btusb_recv_intr+0x38/0x170 [btusb]
      [  466.460668]   [<ffffffffa0525626>] btusb_intr_complete+0xa6/0x130 [btusb]
      [  466.460679]   [<ffffffff815d8f1e>] __usb_hcd_giveback_urb+0x8e/0x160
      [  466.460690]   [<ffffffff815d911f>] usb_hcd_giveback_urb+0x3f/0x120
      [  466.460698]   [<ffffffff81606e4d>] uhci_giveback_urb+0xad/0x280
      [  466.460706]   [<ffffffff81608f64>] uhci_scan_schedule.part.33+0x6b4/0xbe0
      [  466.460714]   [<ffffffff81609b50>] uhci_irq+0xd0/0x180
      [  466.460722]   [<ffffffff815d8296>] usb_hcd_irq+0x26/0x40
      [  466.460729]   [<ffffffff81117d40>] handle_irq_event_percpu+0x40/0x300
      [  466.460739]   [<ffffffff81118040>] handle_irq_event+0x40/0x60
      [  466.460746]   [<ffffffff8111af39>] handle_fasteoi_irq+0x89/0x150
      [  466.460754]   [<ffffffff8101e0f3>] handle_irq+0x73/0x120
      [  466.460763]   [<ffffffff81832f11>] do_IRQ+0x61/0x120
      [  466.460772]   [<ffffffff8183084c>] ret_from_intr+0x0/0x31
      [  466.460780]   [<ffffffff81697a77>] cpuidle_enter+0x17/0x20
      [  466.460790]   [<ffffffff810f62c2>] call_cpuidle+0x32/0x60
      [  466.460800]   [<ffffffff810f65a8>] cpu_startup_entry+0x2b8/0x3f0
      [  466.460807]   [<ffffffff818214ca>] rest_init+0x13a/0x140
      [  466.460817]   [<ffffffff81f76029>] start_kernel+0x4a3/0x4c4
      [  466.460827]   [<ffffffff81f75339>] x86_64_start_reservations+0x2a/0x2c
      [  466.460837]   [<ffffffff81f75485>] x86_64_start_kernel+0x14a/0x16d
      [  466.460846] irq event stamp: 754913
      [  466.460851] hardirqs last  enabled at (754913): [<ffffffff8182f4cc>] _raw_spin_unlock_irq+0x2c/0x40
      [  466.460861] hardirqs last disabled at (754912): [<ffffffff8182f28d>] _raw_spin_lock_irq+0x1d/0x60
      [  466.460869] softirqs last  enabled at (753024): [<ffffffff810aeaa0>] __do_softirq+0x380/0x490
      [  466.460880] softirqs last disabled at (753009): [<ffffffff810aedef>] irq_exit+0x10f/0x120
      [  466.460888]
                     other info that might help us debug this:
      [  466.460894]  Possible unsafe locking scenario:
      
      [  466.460899]        CPU0
      [  466.460903]        ----
      [  466.460907]   lock(&(&data->rxlock)->rlock);
      [  466.460915]   <Interrupt>
      [  466.460918]     lock(&(&data->rxlock)->rlock);
      [  466.460926]
                      *** DEADLOCK ***
      
      [  466.460935] 2 locks held by kworker/0:2/94:
      [  466.460939]  #0:  ("events"){.+.+.+}, at: [<ffffffff810c69bb>] process_one_work+0x16b/0x660
      [  466.460958]  #1:  ((&data->work)){+.+...}, at: [<ffffffff810c69bb>] process_one_work+0x16b/0x660
      [  466.460974]
      Signed-off-by: NKuba Pawlak <kubax.t.pawlak@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      f6fc86f2
    • S
      VSOCK: call sk->sk_data_ready() on accept() · 7362945a
      Stefan Hajnoczi 提交于
      When a listen socket enqueues a connection for userspace to accept(),
      the sk->sk_data_ready() callback should be invoked.  In-kernel socket
      users rely on this callback to detect when incoming connections are
      available.
      
      Currently the sk->sk_state_change() callback is invoked by
      vmci_transport.c.  This happens to work for userspace applications since
      sk->sk_state_change = sock_def_wakeup() and sk->sk_data_ready =
      sock_def_readable() both wake up the accept() waiter.  In-kernel socket
      users, on the other hand, fail to detect incoming connections.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7362945a
    • T
      tun_dst: Fix potential NULL dereference · f63ce5b6
      Tobias Klauser 提交于
      In tun_dst_unclone() the return value of skb_metadata_dst() is checked
      for being NULL after it is dereferenced. Fix this by moving the
      dereference after the NULL check.
      
      Found by the Coverity scanner (CID 1338068).
      
      Fixes: fc4099f1 ("openvswitch: Fix egress tunnel info.")
      Cc: Pravin B Shelar <pshelar@nicira.com>
      Signed-off-by: NTobias Klauser <tklauser@distanz.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f63ce5b6
    • J
      net/core: ensure features get disabled on new lower devs · e7868a85
      Jarod Wilson 提交于
      With moving netdev_sync_lower_features() after the .ndo_set_features
      calls, I neglected to verify that devices added *after* a flag had been
      disabled on an upper device were properly added with that flag disabled as
      well. This currently happens, because we exit __netdev_update_features()
      when we see dev->features == features for the upper dev. We can retain the
      optimization of leaving without calling .ndo_set_features with a bit of
      tweaking and a goto here.
      
      Fixes: fd867d51 ("net/core: generic support for disabling netdev features down stack")
      CC: "David S. Miller" <davem@davemloft.net>
      CC: Eric Dumazet <edumazet@google.com>
      CC: Jay Vosburgh <j.vosburgh@gmail.com>
      CC: Veaceslav Falico <vfalico@gmail.com>
      CC: Andy Gospodarek <gospo@cumulusnetworks.com>
      CC: Jiri Pirko <jiri@resnulli.us>
      CC: Nikolay Aleksandrov <razor@blackwall.org>
      CC: Michal Kubecek <mkubecek@suse.cz>
      CC: Alexander Duyck <alexander.duyck@gmail.com>
      CC: netdev@vger.kernel.org
      Reported-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e7868a85
    • D
      net: Fix prefsrc lookups · e1b8d903
      David Ahern 提交于
      A bug report (https://bugzilla.kernel.org/show_bug.cgi?id=107071) noted
      that the follwoing ip command is failing with v4.3:
      
          $ ip route add 10.248.5.0/24 dev bond0.250 table vlan_250 src 10.248.5.154
          RTNETLINK answers: Invalid argument
      
      021dd3b8 changed the lookup of the given preferred source address to
      use the table id passed in, but this assumes the local entries are in the
      given table which is not necessarily true for non-VRF use cases. When
      validating the preferred source fallback to the local table on failure.
      
      Fixes: 021dd3b8 ("net: Add routes to the table associated with the device")
      Signed-off-by: NDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e1b8d903
    • W
      ipv4: fix a potential deadlock in mcast getsockopt() path · 87e9f031
      WANG Cong 提交于
      Sasha reported the following lockdep warning:
      
        Possible unsafe locking scenario:
      
              CPU0                    CPU1
              ----                    ----
         lock(sk_lock-AF_INET);
                                      lock(rtnl_mutex);
                                      lock(sk_lock-AF_INET);
         lock(rtnl_mutex);
      
      This is due to that for IP_MSFILTER and MCAST_MSFILTER, we take
      rtnl lock before the socket lock in setsockopt() path, but take
      the socket lock before rtnl lock in getsockopt() path. All the
      rest optnames are setsockopt()-only.
      
      Fix this by aligning the getsockopt() path with the setsockopt()
      path, so that all mcast socket path would be locked in the same
      order.
      
      Note, IPv6 part is different where rtnl lock is not held.
      
      Fixes: 54ff9ef3 ("ipv4, ipv6: kill ip_mc_{join, leave}_group and ipv6_sock_mc_{join, drop}")
      Reported-by: NSasha Levin <sasha.levin@oracle.com>
      Cc: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Reviewed-by: NMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      87e9f031
    • W
      ipv4: disable BH when changing ip local port range · 4ee3bd4a
      WANG Cong 提交于
      This fixes the following lockdep warning:
      
       [ INFO: inconsistent lock state ]
       4.3.0-rc7+ #1197 Not tainted
       ---------------------------------
       inconsistent {IN-SOFTIRQ-R} -> {SOFTIRQ-ON-W} usage.
       sysctl/1019 [HC0[0]:SC0[0]:HE1:SE1] takes:
        (&(&net->ipv4.ip_local_ports.lock)->seqcount){+.+-..}, at: [<ffffffff81921de7>] ipv4_local_port_range+0xb4/0x12a
       {IN-SOFTIRQ-R} state was registered at:
         [<ffffffff810bd682>] __lock_acquire+0x2f6/0xdf0
         [<ffffffff810be6d5>] lock_acquire+0x11c/0x1a4
         [<ffffffff818e599c>] inet_get_local_port_range+0x4e/0xae
         [<ffffffff8166e8e3>] udp_flow_src_port.constprop.40+0x23/0x116
         [<ffffffff81671cb9>] vxlan_xmit_one+0x219/0xa6a
         [<ffffffff81672f75>] vxlan_xmit+0xa6b/0xaa5
         [<ffffffff817f2deb>] dev_hard_start_xmit+0x2ae/0x465
         [<ffffffff817f35ed>] __dev_queue_xmit+0x531/0x633
         [<ffffffff817f3702>] dev_queue_xmit_sk+0x13/0x15
         [<ffffffff818004a5>] neigh_resolve_output+0x12f/0x14d
         [<ffffffff81959cfa>] ip6_finish_output2+0x344/0x39f
         [<ffffffff8195bf58>] ip6_finish_output+0x88/0x8e
         [<ffffffff8195bfef>] ip6_output+0x91/0xe5
         [<ffffffff819792ae>] dst_output_sk+0x47/0x4c
         [<ffffffff81979392>] NF_HOOK_THRESH.constprop.30+0x38/0x82
         [<ffffffff8197981e>] mld_sendpack+0x189/0x266
         [<ffffffff8197b28b>] mld_ifc_timer_expire+0x1ef/0x223
         [<ffffffff810de581>] call_timer_fn+0xfb/0x28c
         [<ffffffff810ded1e>] run_timer_softirq+0x1c7/0x1f1
      
      Fixes: b8f1a556 ("udp: Add function to make source port for UDP tunnels")
      Cc: Tom Herbert <tom@herbertland.com>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4ee3bd4a
    • S
      sh_eth: merge sh_eth_free_dma_buffer() into sh_eth_ring_free() · 8e03a5e7
      Sergei Shtylyov 提交于
      While the ring allocation is done by a single function, sh_eth_ring_init(),
      the ring deallocation was split into two functions (almost always called
      one after the other) for no good reason. Merge  sh_eth_free_dma_buffer()
      into sh_eth_ring_free() which allows us  to save space not only on the
      direct calls  of the former function but also on the sh_eth_ring_init()'s
      simplified error path...
      Signed-off-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8e03a5e7