1. 30 11月, 2014 4 次提交
    • M
      sh_eth: Fix sleeping function called from invalid context · 7fa2955f
      Mitsuhiro Kimura 提交于
      This resolves the following bug which can be reproduced by building the
      kernel with CONFIG_DEBUG_ATOMIC_SLEEP=y and reading network statistics
      while the network interface is down.
      
      e.g.:
      
      ifconfig eth0 down
      cat /sys/class/net/eth0/statistics/tx_errors
      
      ----
      [ 1238.161349] BUG: sleeping function called from invalid context at drivers/base/power/runtime.c:952
      [ 1238.188279] in_atomic(): 1, irqs_disabled(): 0, pid: 1388, name: cat
      [ 1238.207425] CPU: 0 PID: 1388 Comm: cat Not tainted 3.10.31-ltsi-00046-gefa0b46 #1087
      [ 1238.230737] Backtrace:
      [ 1238.238123] [<c0012e64>] (dump_backtrace+0x0/0x10c) from [<c0013000>] (show_stack+0x18/0x1c)
      [ 1238.263499]  r6:000003b8 r5:c06160c0 r4:c0669e00 r3:00404000
      [ 1238.280583] [<c0012fe8>] (show_stack+0x0/0x1c) from [<c04515a4>] (dump_stack+0x20/0x28)
      [ 1238.304631] [<c0451584>] (dump_stack+0x0/0x28) from [<c004970c>] (__might_sleep+0xf8/0x118)
      [ 1238.329734] [<c0049614>] (__might_sleep+0x0/0x118) from [<c02465ac>] (__pm_runtime_resume+0x38/0x90)
      [ 1238.357170]  r7:d616f000 r6:c049c458 r5:00000004 r4:d6a17210
      [ 1238.374251] [<c0246574>] (__pm_runtime_resume+0x0/0x90) from [<c029b1c4>] (sh_eth_get_stats+0x44/0x280)
      [ 1238.402468]  r7:d616f000 r6:c049c458 r5:d5c21000 r4:d5c21000
      [ 1238.419552] [<c029b180>] (sh_eth_get_stats+0x0/0x280) from [<c03ae39c>] (dev_get_stats+0x54/0x88)
      [ 1238.446204]  r5:d5c21000 r4:d5ed7e08
      [ 1238.456980] [<c03ae348>] (dev_get_stats+0x0/0x88) from [<c03c677c>] (netstat_show.isra.15+0x54/0x9c)
      [ 1238.484413]  r6:d5c21000 r5:d5c21238 r4:00000028 r3:00000001
      [ 1238.501495] [<c03c6728>] (netstat_show.isra.15+0x0/0x9c) from [<c03c69b8>] (show_tx_errors+0x18/0x1c)
      [ 1238.529196]  r7:d5f945d8 r6:d5f945c0 r5:c049716c r4:c0650e7c
      [ 1238.546279] [<c03c69a0>] (show_tx_errors+0x0/0x1c) from [<c023963c>] (dev_attr_show+0x24/0x50)
      [ 1238.572157] [<c0239618>] (dev_attr_show+0x0/0x50) from [<c010c148>] (sysfs_read_file+0xb0/0x140)
      [ 1238.598554]  r5:c049716c r4:d5c21240
      [ 1238.609326] [<c010c098>] (sysfs_read_file+0x0/0x140) from [<c00b9ee4>] (vfs_read+0xb0/0x13c)
      [ 1238.634679] [<c00b9e34>] (vfs_read+0x0/0x13c) from [<c00ba0ac>] (SyS_read+0x44/0x74)
      [ 1238.657944]  r8:bef45bf0 r7:00000000 r6:d6ac0600 r5:00000000 r4:00000000
      [ 1238.678172] [<c00ba068>] (SyS_read+0x0/0x74) from [<c000eec0>] (ret_fast_syscall+0x0/0x30)
      ----
      Signed-off-by: NMitsuhiro Kimura <mitsuhiro.kimura.kc@renesas.com>
      Signed-off-by: NYoshihiro Kaneko <ykaneko0929@gmail.com>
      Signed-off-by: NSimon Horman <horms+renesas@verge.net.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7fa2955f
    • H
      stmmac: platform: Move plat_dat checking earlier · 28603d13
      Huacai Chen 提交于
      Original code only check/alloc plat_dat for the CONFIG_OF case, this
      patch check/alloc it earlier and unconditionally to avoid kernel build
      warnings:
      
      drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:275
      stmmac_pltfr_probe() warn: variable dereferenced before check 'plat_dat'
      
      V2: Fix coding style.
      Signed-off-by: NHuacai Chen <chenhc@lemote.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      28603d13
    • M
      sh_eth: Fix skb alloc size and alignment adjust rule. · 4d6a949c
      Mitsuhiro Kimura 提交于
      In the current driver, allocation size of skb does not care the alignment
      adjust after allocation.
      And also, in the current implementation, buffer alignment method by
      sh_eth_set_receive_align function has a bug that this function displace
      buffer start address forcedly when the alignment is corrected.
      In the result, tail of the skb will exceed allocated area and kernel panic
      will be occurred.
      This patch fix this issue.
      Signed-off-by: NMitsuhiro Kimura <mitsuhiro.kimura.kc@renesas.com>
      Signed-off-by: NYoshihiro Kaneko <ykaneko0929@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4d6a949c
    • T
      bond: Check length of IFLA_BOND_ARP_IP_TARGET attributes · f6c6fda4
      Thomas Graf 提交于
      Fixes: 7f28fa10 ("bonding: add arp_ip_target netlink support")
      Reported-by: NJohn Fastabend <john.fastabend@gmail.com>
      Cc: Scott Feldman <sfeldma@cumulusnetworks.com>
      Signed-off-by: NThomas Graf <tgraf@suug.ch>
      Acked-by: NJohn Fastabend <john.r.fastabend@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f6c6fda4
  2. 28 11月, 2014 1 次提交
  3. 27 11月, 2014 7 次提交
    • L
      staging: r8188eu: Fix scheduling while atomic error introduced in commit fadbe0cd · 33dc85c3
      Larry Finger 提交于
      In commit fadbe0cd entitled "staging:
      rtl8188eu:Remove rtw_zmalloc(), wrapper for kzalloc()", the author failed
      to note that the original code in the wrapper tested whether the caller
      could sleep, and set the flags argument to kzalloc() appropriately.
      After the patch, GFP_KERNEL is used unconditionally. Unfortunately, several
      of the routines may be entered from an interrupt routine and generate
      a BUG splat for every such call. Routine rtw_sitesurvey_cmd() is used in the
      example below:
      
      BUG: sleeping function called from invalid context at mm/slub.c:1240
      in_atomic(): 1, irqs_disabled(): 0, pid: 756, name: wpa_supplicant
      INFO: lockdep is turned off.
      CPU: 2 PID: 756 Comm: wpa_supplicant Tainted: G        WC O   3.18.0-rc4+ #34
      Hardware name: TOSHIBA TECRA A50-A/TECRA A50-A, BIOS Version 4.20   04/17/2014
      ffffc90005557000 ffff880216fafaa8 ffffffff816b0bbf 0000000000000000
      ffff8800c3b58000 ffff880216fafac8 ffffffff8107af77 0000000000000001
      0000000000000010 ffff880216fafb18 ffffffff811b06ce 0000000000000000
      Call Trace:
       [<ffffffff816b0bbf>] dump_stack+0x4e/0x71
       [<ffffffff8107af77>] __might_sleep+0xf7/0x120
       [<ffffffff811b06ce>] kmem_cache_alloc_trace+0x4e/0x1f0
       [<ffffffffa0888226>] ? rtw_sitesurvey_cmd+0x56/0x2a0 [r8188eu]
       [<ffffffffa0888226>] rtw_sitesurvey_cmd+0x56/0x2a0 [r8188eu]
       [<ffffffffa088f00d>] rtw_do_join+0x22d/0x370 [r8188eu]
       [<ffffffffa088f6e8>] rtw_set_802_11_ssid+0x218/0x3d0 [r8188eu]
       [<ffffffffa08c3ca5>] rtw_wx_set_essid+0x1e5/0x410 [r8188eu]
       [<ffffffffa08c3ac0>] ? rtw_wx_get_rate+0x50/0x50 [r8188eu]
       [<ffffffff816938f1>] ioctl_standard_iw_point+0x151/0x3f0
       [<ffffffff81693d52>] ioctl_standard_call+0xb2/0xe0
       [<ffffffff81597df7>] ? rtnl_lock+0x17/0x20
       [<ffffffff816945a0>] ? iw_handler_get_private+0x70/0x70
       [<ffffffff81693ca0>] ? call_commit_handler+0x40/0x40
       [<ffffffff81693256>] wireless_process_ioctl+0x176/0x1c0
       [<ffffffff81693e79>] wext_handle_ioctl+0x69/0xc0
       [<ffffffff8159fe79>] dev_ioctl+0x309/0x5e0
       [<ffffffff810be9c7>] ? call_rcu+0x17/0x20
       [<ffffffff8156a472>] sock_ioctl+0x142/0x2e0
       [<ffffffff811e0c70>] do_vfs_ioctl+0x300/0x520
       [<ffffffff81101514>] ? __audit_syscall_entry+0xb4/0x110
       [<ffffffff81101514>] ? __audit_syscall_entry+0xb4/0x110
       [<ffffffff810102bc>] ? do_audit_syscall_entry+0x6c/0x70
       [<ffffffff811e0f11>] SyS_ioctl+0x81/0xa0
       [<ffffffff816ba1d2>] system_call_fastpath+0x12/0x17
      
      Additional routines that generate this BUG are rtw_joinbss_cmd(),
      rtw_dynamic_chk_wk_cmd(), rtw_lps_ctrl_wk_cmd(), rtw_rpt_timer_cfg_cmd(),
      rtw_ps_cmd(), report_survey_event(), report_join_res(), survey_timer_hdl(),
      and rtw_check_bcn_info().
      Signed-off-by: NLarry Finger <Larry.Finger@lwfinger.net>
      Cc: navin patidar <navin.patidar@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      33dc85c3
    • T
      net: Check for presence of IFLA_AF_SPEC · 4ea85e83
      Thomas Graf 提交于
      ndo_bridge_setlink() is currently only called on the slave if
      IFLA_AF_SPEC is set but this is a very fragile assumption and may
      change in the future.
      
      Cc: Ajit Khaparde <ajit.khaparde@emulex.com>
      Cc: John Fastabend <john.r.fastabend@intel.com>
      Signed-off-by: NThomas Graf <tgraf@suug.ch>
      Acked-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4ea85e83
    • T
      net: Validate IFLA_BRIDGE_MODE attribute length · b7c1a314
      Thomas Graf 提交于
      Payload is currently accessed blindly and may exceed valid message
      boundaries.
      
      Fixes: a77dcb8c ("be2net: set and query VEB/VEPA mode of the PF interface")
      Fixes: 815cccbf ("ixgbe: add setlink, getlink support to ixgbe and ixgbevf")
      Cc: Ajit Khaparde <ajit.khaparde@emulex.com>
      Cc: John Fastabend <john.r.fastabend@intel.com>
      Signed-off-by: NThomas Graf <tgraf@suug.ch>
      Acked-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Acked-by: NJohn Fastabend <john.r.fastabend@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b7c1a314
    • H
      stmmac: platform: fix default values of the filter bins setting · 571dcfde
      Huacai Chen 提交于
      The commit 3b57de95 brought the support for a different amount of
      the filter bins, but didn't update the platform driver that without
      CONFIG_OF.
      
      Fixes: 3b57de95 (net: stmmac: Support devicetree configs for mcast
      and ucast filter entries)
      Signed-off-by: NHuacai Chen <chenhc@lemote.com>
      Acked-by: NGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      571dcfde
    • J
      net/mlx4_core: Limit count field to 24 bits in qp_alloc_res · 2d5c57d7
      Jack Morgenstein 提交于
      Some VF drivers use the upper byte of "param1" (the qp count field)
      in mlx4_qp_reserve_range() to pass flags which are used to optimize
      the range allocation.
      
      Under the current code, if any of these flags are set, the 32-bit
      count field yields a count greater than 2^24, which is out of range,
      and this VF fails.
      
      As these flags represent a "best-effort" allocation hint anyway, they may
      safely be ignored. Therefore, the PF driver may simply mask out the bits.
      
      Fixes: c82e9aa0 "mlx4_core: resource tracking for HCA resources used by guests"
      Signed-off-by: NJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: NOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2d5c57d7
    • F
      net: dsa: bcm_sf2: reset switch prior to initialization · 33f84614
      Florian Fainelli 提交于
      Our boot agent may have left the switch in an certain configuration
      state, make sure we issue a software reset prior to configuring the
      switch in order to ensure the HW is in a consistent state, in particular
      transmit queues and internal buffers.
      
      Fixes: 246d7f77 ("net: dsa: add Broadcom SF2 switch driver")
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      33f84614
    • F
      net: dsa: bcm_sf2: fix unmapping registers in case of errors · a566059d
      Florian Fainelli 提交于
      In case we fail to ioremap() one of our registers, we would be leaking
      existing mappings, unwind those accordingly on errors.
      
      Fixes: 246d7f77 ("net: dsa: add Broadcom SF2 switch driver")
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a566059d
  4. 26 11月, 2014 9 次提交
  5. 25 11月, 2014 4 次提交
  6. 24 11月, 2014 7 次提交
    • B
      gpu/radeon: Set flag to indicate broken 64-bit MSI · 91ed6fd2
      Benjamin Herrenschmidt 提交于
      Some radeon ASICs don't support all 64 address bits of MSIs despite
      advertising support for 64-bit MSIs in their configuration space.
      
      This breaks on systems such as IBM POWER7/8, where 64-bit MSIs can
      be assigned with some of the high address bits set.
      
      This makes use of the newly introduced "no_64bit_msi" flag in structure
      pci_dev to allow the MSI allocation code to fallback to 32-bit MSIs
      on those adapters.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
      CC: <stable@vger.kernel.org>
      ---
      
      Adding Alex's review tag. Patch to the driver is identical to the
      reviewed one, I dropped the arch/powerpc hunk rewrote the subject
      and cset comment.
      91ed6fd2
    • B
      PCI/MSI: Add device flag indicating that 64-bit MSIs don't work · f144d149
      Benjamin Herrenschmidt 提交于
      This can be set by quirks/drivers to be used by the architecture code
      that assigns the MSI addresses.
      
      We additionally add verification in the core MSI code that the values
      assigned by the architecture do satisfy the limitation in order to fail
      gracefully if they don't (ie. the arch hasn't been updated to deal with
      that quirk yet).
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      CC: <stable@vger.kernel.org>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      f144d149
    • L
      iwlwifi: mvm: check TLV flag before trying to use hotspot firmware commands · 5ac6c72e
      Luciano Coelho 提交于
      Older firmwares do not provide support for the HOT_SPOT_CMD command.
      Check for the appropriate TLV flag that declares hotspot support in
      the firmware to prevent a firmware assertion failure that can be
      triggered from the userspace,
      
      Cc: stable@vger.kernel.org [3.17+]
      Signed-off-by: NLuciano Coelho <luciano.coelho@intel.com>
      Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      5ac6c72e
    • J
      solos-pci: fix error return code · 73112f9b
      Julia Lawall 提交于
      Return a negative error code on failure.
      
      A simplified version of the semantic match that finds this problem is as
      follows: (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @@
      identifier ret; expression e1,e2;
      @@
      (
      if (\(ret < 0\|ret != 0\))
       { ... return ret; }
      |
      ret = 0
      )
      ... when != ret = e1
          when != &ret
      *if(...)
      {
        ... when != ret = e2
            when forall
       return ret;
      }
      // </smpl>
      Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      73112f9b
    • C
      igb: Fixes needed for surprise removal support · 17a402a0
      Carolyn Wyborny 提交于
      This patch adds some checks in order to prevent panic's on surprise
      removal of devices during S0, S3, S4.  Without this patch, Thunderbolt
      type device removal will panic the system.
      Signed-off-by: NYanir Lubetkin <yanirx.lubetkin@intel.com>
      Signed-off-by: NCarolyn Wyborny <carolyn.wyborny@intel.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      17a402a0
    • D
      ixgbe: fix use after free adapter->state test in ixgbe_remove/ixgbe_probe · b5b2ffc0
      Daniel Borkmann 提交于
      While working on a different issue, I noticed an annoying use
      after free bug on my machine when unloading the ixgbe driver:
      
      [ 8642.318797] ixgbe 0000:02:00.1: removed PHC on p2p2
      [ 8642.742716] ixgbe 0000:02:00.1: complete
      [ 8642.743784] BUG: unable to handle kernel paging request at ffff8807d3740a90
      [ 8642.744828] IP: [<ffffffffa01c77dc>] ixgbe_remove+0xfc/0x1b0 [ixgbe]
      [ 8642.745886] PGD 20c6067 PUD 81c1f6067 PMD 81c15a067 PTE 80000007d3740060
      [ 8642.746956] Oops: 0002 [#1] SMP DEBUG_PAGEALLOC
      [ 8642.748039] Modules linked in: [...]
      [ 8642.752929] CPU: 1 PID: 1225 Comm: rmmod Not tainted 3.18.0-rc2+ #49
      [ 8642.754203] Hardware name: Supermicro X10SLM-F/X10SLM-F, BIOS 1.1b 11/01/2013
      [ 8642.755505] task: ffff8807e34d3fe0 ti: ffff8807b7204000 task.ti: ffff8807b7204000
      [ 8642.756831] RIP: 0010:[<ffffffffa01c77dc>]  [<ffffffffa01c77dc>] ixgbe_remove+0xfc/0x1b0 [ixgbe]
      [...]
      [ 8642.774335] Stack:
      [ 8642.775805]  ffff8807ee824098 ffff8807ee824098 ffffffffa01f3000 ffff8807ee824000
      [ 8642.777326]  ffff8807b7207e18 ffffffff8137720f ffff8807ee824098 ffff8807ee824098
      [ 8642.778848]  ffffffffa01f3068 ffff8807ee8240f8 ffff8807b7207e38 ffffffff8144180f
      [ 8642.780365] Call Trace:
      [ 8642.781869]  [<ffffffff8137720f>] pci_device_remove+0x3f/0xc0
      [ 8642.783395]  [<ffffffff8144180f>] __device_release_driver+0x7f/0xf0
      [ 8642.784876]  [<ffffffff814421f8>] driver_detach+0xb8/0xc0
      [ 8642.786352]  [<ffffffff814414a9>] bus_remove_driver+0x59/0xe0
      [ 8642.787783]  [<ffffffff814429d0>] driver_unregister+0x30/0x70
      [ 8642.789202]  [<ffffffff81375c65>] pci_unregister_driver+0x25/0xa0
      [ 8642.790657]  [<ffffffffa01eb38e>] ixgbe_exit_module+0x1c/0xc8e [ixgbe]
      [ 8642.792064]  [<ffffffff810f93a2>] SyS_delete_module+0x132/0x1c0
      [ 8642.793450]  [<ffffffff81012c61>] ? do_notify_resume+0x61/0xa0
      [ 8642.794837]  [<ffffffff816d2029>] system_call_fastpath+0x12/0x17
      
      The issue is that test_and_set_bit() done on adapter->state is being
      performed *after* the netdevice has been freed via free_netdev().
      
      When netdev is being allocated on initialization time, it allocates
      a private area, here struct ixgbe_adapter, that resides after the
      net_device structure. In ixgbe_probe(), the device init routine,
      we set up the adapter after alloc_etherdev_mq() on the private area
      and add a reference for the pci_dev as well via pci_set_drvdata().
      
      Both in the error path of ixgbe_probe(), but also on module unload
      when ixgbe_remove() is being called, commit 41c62843 ("ixgbe:
      Fix rcu warnings induced by LER") accesses adapter after free_netdev().
      The patch stores the result in a bool and thus fixes above oops on my
      side.
      
      Fixes: 41c62843 ("ixgbe: Fix rcu warnings induced by LER")
      Cc: stable <stable@vger.kernel.org>
      Cc: Mark Rustad <mark.d.rustad@intel.com>
      Signed-off-by: NDaniel Borkmann <dborkman@redhat.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b5b2ffc0
    • V
      ixgbe: Correctly disable VLAN filter in promiscuous mode · 4556dc59
      Vlad Yasevich 提交于
      IXGBE adapter seems to require that VLAN filtering be enabled if
      VMDQ or SRIOV are enabled.  When those functions are disabled,
      VLAN filtering may be disabled in promiscuous mode.
      
      Prior to commit a9b8943e ("ixgbe: remove vlan_filter_disable
      and enable functions")
      
      The logic was correct.  However, after the commit the logic
      got reversed and VLAN filtered in now turned on when VMDQ/SRIOV
      is disabled.
      
      This patch changes the condition to enable hw vlan filtered
      when VMDQ or SRIOV is enabled.
      
      Fixes: a9b8943e ("ixgbe: remove vlan_filter_disable and enable functions")
      Cc: stable <stable@vger.kernel.org>
      CC: Jacob Keller <jacob.e.keller@intel.com>
      Signed-off-by: NVladislav Yasevich <vyasevic@redhat.com>
      Acked-by: NEmil Tantilov <emil.s.tantilov@intel.com>
      Tested-by: NPhil Schmitt <phillip.j.schmitt@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4556dc59
  7. 22 11月, 2014 7 次提交
  8. 21 11月, 2014 1 次提交