1. 12 5月, 2012 8 次提交
  2. 11 5月, 2012 7 次提交
    • J
      bonding: don't increase rx_dropped after processing LACPDUs · 13a8e0c8
      Jiri Bohac 提交于
      Since commit 3aba891d, bonding processes LACP frames (802.3ad
      mode) with bond_handle_frame(). Currently a copy of the skb is
      made and the original is left to be processed by other
      rx_handlers and the rest of the network stack by returning
      RX_HANDLER_ANOTHER.  As there is no protocol handler for
      PKT_TYPE_LACPDU, the frame is dropped and dev->rx_dropped
      increased.
      
      Fix this by making bond_handle_frame() return RX_HANDLER_CONSUMED
      if bonding has processed the LACP frame.
      Signed-off-by: NJiri Bohac <jbohac@suse.cz>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      13a8e0c8
    • E
      connector/userns: replace netlink uses of cap_raised() with capable() · 38bf1953
      Eric W. Biederman 提交于
      In 2009 Philip Reiser notied that a few users of netlink connector
      interface needed a capability check and added the idiom
      cap_raised(nsp->eff_cap, CAP_SYS_ADMIN) to a few of them, on the premise
      that netlink was asynchronous.
      
      In 2011 Patrick McHardy noticed we were being silly because netlink is
      synchronous and removed eff_cap from the netlink_skb_params and changed
      the idiom to cap_raised(current_cap(), CAP_SYS_ADMIN).
      
      Looking at those spots with a fresh eye we should be calling
      capable(CAP_SYS_ADMIN).  The only reason I can see for not calling capable
      is that it once appeared we were not in the same task as the caller which
      would have made calling capable() impossible.
      
      In the initial user_namespace the only difference between between
      cap_raised(current_cap(), CAP_SYS_ADMIN) and capable(CAP_SYS_ADMIN) are a
      few sanity checks and the fact that capable(CAP_SYS_ADMIN) sets
      PF_SUPERPRIV if we use the capability.
      
      Since we are going to be using root privilege setting PF_SUPERPRIV seems
      the right thing to do.
      
      The motivation for this that patch is that in a child user namespace
      cap_raised(current_cap(),...) tests your capabilities with respect to that
      child user namespace not capabilities in the initial user namespace and
      thus will allow processes that should be unprivielged to use the kernel
      services that are only protected with cap_raised(current_cap(),..).
      
      To fix possible user_namespace issues and to just clean up the code
      replace cap_raised(current_cap(), CAP_SYS_ADMIN) with
      capable(CAP_SYS_ADMIN).
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Cc: Patrick McHardy <kaber@trash.net>
      Cc: Philipp Reisner <philipp.reisner@linbit.com>
      Acked-by: NSerge E. Hallyn <serge.hallyn@canonical.com>
      Acked-by: NAndrew G. Morgan <morgan@kernel.org>
      Cc: Vasiliy Kulikov <segoon@openwall.com>
      Cc: David Howells <dhowells@redhat.com>
      Reviewed-by: NJames Morris <james.l.morris@oracle.com>
      Cc: David Miller <davem@davemloft.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      38bf1953
    • D
      Revert "net: maintain namespace isolation between vlan and real device" · 59b9997b
      David S. Miller 提交于
      This reverts commit 8a83a00b.
      
      It causes regressions for S390 devices, because it does an
      unconditional DST drop on SKBs for vlans and the QETH device
      needs the neighbour entry hung off the DST for certain things
      on transmit.
      
      Arnd can't remember exactly why he even needed this change.
      
      Conflicts:
      
      	drivers/net/macvlan.c
      	net/8021q/vlan_dev.c
      	net/core/dev.c
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      59b9997b
    • T
      ehea: fix losing of NEQ events when one event occurred early · 380ec964
      Thadeu Lima de Souza Cascardo 提交于
      The NEQ interrupt is only triggered when there was no previous pending
      interrupt. If we request irq handling after an interrupt has occurred,
      we will never get an interrupt until we call H_RESET_EVENTS.
      
      Events seem to be cleared when we first register the NEQ. So, when we
      requested irq handling right after registering it, a possible race with
      an interrupt was much less likely. Now, there is a chance we may lose
      this race and never get any events.
      
      The fix here is to poll and acknowledge any events that might have
      happened right after registering the irq handler.
      Signed-off-by: NThadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      380ec964
    • B
      igb: fix rtnl race in PM resume path · cfb8c3aa
      Benjamin Poirier 提交于
      Since the caller (PM resume code) is not the one holding rtnl, when taking the
      'else' branch rtnl may be released at any moment, thereby defeating the whole
      purpose of this code block.
      Signed-off-by: NBenjamin Poirier <bpoirier@suse.de>
      Tested-by: NJeff Pieper <jeffrey.e.pieper@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cfb8c3aa
    • R
      parisc: move definition of PAGE0 to asm/page.h · 4a8a0788
      Rolf Eike Beer 提交于
      This was defined in asm/pdc.h which needs to include asm/page.h for
      __PAGE_OFFSET. This leads to an include loop so that page.h eventually will
      include pdc.h again. While this is no problem because of header guards, it is
      a problem because some symbols may be undefined. Such an error is this:
      
      In file included from include/linux/bitops.h:35:0,
                       from include/asm-generic/getorder.h:7,
                       from arch/parisc/include/asm/page.h:162,
                       from arch/parisc/include/asm/pdc.h:346,
                       from arch/parisc/include/asm/processor.h:16,
                       from arch/parisc/include/asm/spinlock.h:6,
                       from arch/parisc/include/asm/atomic.h:20,
                       from include/linux/atomic.h:4,
                       from include/linux/sysfs.h:20,
                       from include/linux/kobject.h:21,
                       from include/linux/device.h:17,
                       from include/linux/eisa.h:5,
                       from arch/parisc/kernel/pci.c:11:
      arch/parisc/include/asm/bitops.h: In function ‘set_bit’:
      arch/parisc/include/asm/bitops.h:82:2: error: implicit declaration of function ‘_atomic_spin_lock_irqsave’ [-Werror=implicit-function-declaration]
      arch/parisc/include/asm/bitops.h:84:2: error: implicit declaration of function ‘_atomic_spin_unlock_irqrestore’ [-Werror=implicit-function-declaration]
      Signed-off-by: NRolf Eike Beer <eike-kernel@sf-tec.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4a8a0788
    • A
      drivers/leds: correct __devexit annotations · b8cd742a
      Arnd Bergmann 提交于
      __devexit functions are discarded without CONFIG_HOTPLUG, so they need
      to be referenced carefully.  A __devexit function may also not be called
      from a __devinit function.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NMathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Bryan Wu <bryan.wu@canonical.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b8cd742a
  3. 10 5月, 2012 8 次提交
  4. 09 5月, 2012 3 次提交
    • L
      regmap: fix possible memory corruption in regmap_bulk_read() · 6560ffd1
      Laxman Dewangan 提交于
      The function regmap_bulk_read() calls the regmap_read() for
      each register if set of register has volatile and cache is
      enabled. In this case, last few register read makes the memory
      corruption if the register size is not the size of unsigned int.
      The regam_read() takes argument as unsigned int for returning
      value and it update the value as
      	*val = map->format.parse_val(map->work_buf);
      This causes complete 4 bytes (size of unsigned int) to get written.
      Now if client pass the memory pointer for value which is equal to the
      required size of register count in regmap_bulk_read() then last few
      register read actually update the memory beyond passed pointer size.
      
      Avoid this by using local variable for read and then do memcpy()
      for actual byte copy to passed pointer based on register size.
      
      I allocated one pointer ptr and take first 16 bytes dump of that
      pointer then call regmap_bulk_read() with pointer which is just
      on top of this allocated pointer and register count of 128. Here
      register size is 1 byte.
      The memory trace of last 5 register read are as follows:
      
      [    5.438589] regmap_bulk_read after regamp_read() for register 122
      [    5.447421] 0xef993c20 0xef993c00 0x00000000 0x00000001
      [    5.467535] regmap_bulk_read after regamp_read() for register 123
      [    5.476374] 0xef993c20 0xef993c00 0x00000000 0x00000001
      [    5.496425] regmap_bulk_read after regamp_read() for register 124
      [    5.505260] 0xef993c20 0xef993c00 0x00000000 0x00000001
      [    5.525372] regmap_bulk_read after regamp_read() for register 125
      [    5.534205] 0xef993c00 0xef993c00 0x00000000 0x00000001
      [    5.554258] regmap_bulk_read after regamp_read() for register 126
      [    5.563100] 0xef990000 0xef993c00 0x00000000 0x00000001
      [    5.554258] regmap_bulk_read after regamp_read() for register 127
      [    5.587108] 0xef000000 0xef993c00 0x00000000 0x00000001
      
      Here it is observed that the memory content at first word started changing
      on last 3 regmap_read() and so corruption happened.
      Signed-off-by: NLaxman Dewangan <ldewangan@nvidia.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      6560ffd1
    • J
      r8169: fix unsigned int wraparound with TSO · 477206a0
      Julien Ducourthial 提交于
      The r8169 may get stuck or show bad behaviour after activating TSO :
      the net_device is not stopped when it has no more TX descriptors.
      This problem comes from TX_BUFS_AVAIL which may reach -1 when all
      transmit descriptors are in use. The patch simply tries to keep positive
      values.
      
      Tested with 8111d(onboard) on a D510MO, and with 8111e(onboard) on a
      Zotac 890GXITX.
      Signed-off-by: NJulien Ducourthial <jducourt@free.fr>
      Acked-by: NFrancois Romieu <romieu@fr.zoreil.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      477206a0
    • B
      sfc: Fix division by zero when using one RX channel and no SR-IOV · 3132d282
      Ben Hutchings 提交于
      If RSS is disabled on the PF (efx->n_rx_channels == 1) we try to set
      up the indirection table so that VFs can use it, setting
      efx->rss_spread = efx_vf_size(efx).  But if SR-IOV was disabled at
      compile time, this evaluates to 0 and we end up dividing by zero when
      initialising the table.
      
      I considered changing the fallback definition of efx_vf_size() to
      return 1, but its value is really meaningless if we are not going to
      enable VFs.  Therefore add a condition of efx_sriov_wanted(efx) in
      efx_probe_interrupts().
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      3132d282
  5. 08 5月, 2012 1 次提交
  6. 07 5月, 2012 7 次提交
  7. 05 5月, 2012 2 次提交
  8. 04 5月, 2012 4 次提交