1. 10 12月, 2014 16 次提交
  2. 09 12月, 2014 4 次提交
    • A
      fib_trie: Fix /proc/net/fib_trie when CONFIG_IP_MULTIPLE_TABLES is not defined · a5a519b2
      Alexander Duyck 提交于
      In recent testing I had disabled CONFIG_IP_MULTIPLE_TABLES and as a result
      when I ran "cat /proc/net/fib_trie" the main trie was displayed multiple
      times.  I found that the problem line of code was in the function
      fib_trie_seq_next.  Specifically the line below caused the indexes to go in
      the opposite direction of our traversal:
      
      	h = tb->tb_id & (FIB_TABLE_HASHSZ - 1);
      
      This issue was that the RT tables are defined such that RT_TABLE_LOCAL is ID
      255, while it is located at TABLE_LOCAL_INDEX of 0, and RT_TABLE_MAIN is 254
      with a TABLE_MAIN_INDEX of 1.  This means that the above line will return 1
      for the local table and 0 for main.  The result is that fib_trie_seq_next
      will return NULL at the end of the local table, fib_trie_seq_start will
      return the start of the main table, and then fib_trie_seq_next will loop on
      main forever as h will always return 0.
      
      The fix for this is to reverse the ordering of the two tables.  It has the
      advantage of making it so that the tables now print in the same order
      regardless of if multiple tables are enabled or not.  In order to make the
      definition consistent with the multiple tables case I simply masked the to
      RT_TABLE_XXX values by (FIB_TABLE_HASHSZ - 1).  This way the two table
      layouts should always stay consistent.
      
      Fixes: 93456b6d ("[IPV4]: Unify access to the routing tables")
      Signed-off-by: NAlexander Duyck <alexander.h.duyck@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a5a519b2
    • E
      net: mvneta: fix race condition in mvneta_tx() · 5f478b41
      Eric Dumazet 提交于
      mvneta_tx() dereferences skb to get skb->len too late,
      as hardware might have completed the transmit and TX completion
      could have freed the skb from another cpu.
      
      Fixes: 71f6d1b3 ("net: mvneta: replace Tx timer with a real interrupt")
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5f478b41
    • W
      net: mvneta: fix Tx interrupt delay · aebea2ba
      willy tarreau 提交于
      The mvneta driver sets the amount of Tx coalesce packets to 16 by
      default. Normally that does not cause any trouble since the driver
      uses a much larger Tx ring size (532 packets). But some sockets
      might run with very small buffers, much smaller than the equivalent
      of 16 packets. This is what ping is doing for example, by setting
      SNDBUF to 324 bytes rounded up to 2kB by the kernel.
      
      The problem is that there is no documented method to force a specific
      packet to emit an interrupt (eg: the last of the ring) nor is it
      possible to make the NIC emit an interrupt after a given delay.
      
      In this case, it causes trouble, because when ping sends packets over
      its raw socket, the few first packets leave the system, and the first
      15 packets will be emitted without an IRQ being generated, so without
      the skbs being freed. And since the socket's buffer is small, there's
      no way to reach that amount of packets, and the ping ends up with
      "send: no buffer available" after sending 6 packets. Running with 3
      instances of ping in parallel is enough to hide the problem, because
      with 6 packets per instance, that's 18 packets total, which is enough
      to grant a Tx interrupt before all are sent.
      
      The original driver in the LSP kernel worked around this design flaw
      by using a software timer to clean up the Tx descriptors. This timer
      was slow and caused terrible network performance on some Tx-bound
      workloads (such as routing) but was enough to make tools like ping
      work correctly.
      
      Instead here, we simply set the packet counts before interrupt to 1.
      This ensures that each packet sent will produce an interrupt. NAPI
      takes care of coalescing interrupts since the interrupt is disabled
      once generated.
      
      No measurable performance impact nor CPU usage were observed on small
      nor large packets, including when saturating the link on Tx, and this
      fixes tools like ping which rely on too small a send buffer. If one
      wants to increase this value for certain workloads where it is safe
      to do so, "ethtool -C $dev tx-frames" will override this default
      setting.
      
      This fix needs to be applied to stable kernels starting with 3.10.
      Tested-By: NMaggie Mae Roxas <maggie.mae.roxas@gmail.com>
      Signed-off-by: NWilly Tarreau <w@1wt.eu>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      aebea2ba
    • D
      mips: bpf: Fix broken BPF_MOD · 2e46477a
      Denis Kirjanov 提交于
      Remove optimize_div() from BPF_MOD | BPF_K case
      since we don't know the dividend and fix the
      emit_mod() by reading the mod operation result from HI register
      Signed-off-by: NDenis Kirjanov <kda@linux-powerpc.org>
      Reviewed-by: NMarkos Chandras <markos.chandras@imgtec.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2e46477a
  3. 08 12月, 2014 1 次提交
  4. 07 12月, 2014 2 次提交
  5. 06 12月, 2014 7 次提交
  6. 04 12月, 2014 10 次提交
    • A
      context_tracking: Restore previous state in schedule_user · 7cc78f8f
      Andy Lutomirski 提交于
      It appears that some SCHEDULE_USER (asm for schedule_user) callers
      in arch/x86/kernel/entry_64.S are called from RCU kernel context,
      and schedule_user will return in RCU user context.  This causes RCU
      warnings and possible failures.
      
      This is intended to be a minimal fix suitable for 3.18.
      Reported-and-tested-by: NDave Jones <davej@redhat.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Acked-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: NAndy Lutomirski <luto@amacapital.net>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7cc78f8f
    • L
      Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · ebcd241a
      Linus Torvalds 提交于
      Pull i2c bugfixes from Wolfram Sang:
       "A few driver bugfixes for 3.18"
      
      * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: omap: fix i207 errata handling
        i2c: designware: prevent early stop on TX FIFO empty
        i2c: omap: fix NACK and Arbitration Lost irq handling
      ebcd241a
    • L
      Merge tag 'pci-v3.18-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci · 5dc62635
      Linus Torvalds 提交于
      Pull PCI fix from Bjorn Helgaas:
       "This fixes a Tegra20 regression that we introduced during the v3.18
        merge window"
      
      * tag 'pci-v3.18-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
        PCI: tegra: Use physical range for I/O mapping
      5dc62635
    • L
      Merge tag 'devicetree-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/glikely/linux · b48a20a5
      Linus Torvalds 提交于
      Pull devicetree bugfix from Grant Likely:
       "One more bug fix for v3.18.  I debated whether or not to send you this
        merge request because we're at such a late rc.  The bug isn't critical
        in that there is only one system known to be affected and the patch is
        easy to backport.  The codepath is used by pretty much every DT based
        system, so there is risk a of regression (it /should/ be safe, but
        I've been bitten by stuff that should be safe before).  I've had it in
        linux-next for a week and haven't received any complaints.
      
        I think it probably should just be merged right away rather than
        waiting for the merge window and backporting.  It does fix a real bug
        and the code is theoretically safer after the change.  I can't think
        of any situation where it would be dangerous to reserve the DT memory
        an extra time.
      
        Summary from tag:
      
          Single bugfix for boot failure seen in the wild.  The memory reserve
          code tries to be clever about reserving the FDT, but it should just
          go ahead and reserve it unconditionally to avoid the problem of
          partial overlap described in the patch"
      
      * tag 'devicetree-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/glikely/linux:
        of/fdt: memblock_reserve /memreserve/ regions in the case of partial overlap
      b48a20a5
    • L
      Merge branch 'for-linus' of git://git.kernel.dk/linux-block · 93bd38b3
      Linus Torvalds 提交于
      Pull block core regression fix from Jens Axboe:
       "Single fix for a regression introduced in this development cycle,
        where dm on top of dif/dix is broken.  From Darrick Wong"
      
      * 'for-linus' of git://git.kernel.dk/linux-block:
        block: fix regression where bio_integrity_process uses wrong bio_vec iterator
      93bd38b3
    • L
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · 46d967ae
      Linus Torvalds 提交于
      Pull drm fixes from Dave Airlie:
       "Radeon and Nouveau fixes:
      
        So nouveau had a few regression introduced, Ben and Maarten finally
        tracked down the one that was causing problems on my MacBookPro, also
        nvidia gave some info on the an engine we were using incorrectly, so
        disable our use of it, and one regresion with pci hotplug affecting
        optimus users.
      
        Radeon has an oops fixs, sync fix, and one workaround to avoid broken
        functionality on 32-bit x86, this needs better root causing and a
        better fix, but the bandaid is a lot safer at this point"
      
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
        drm/radeon: kernel panic in drm_calc_vbltimestamp_from_scanoutpos with 3.18.0-rc6
        drm/radeon: Ignore RADEON_GEM_GTT_WC on 32-bit x86
        drm/radeon: sync all BOs involved in a CS v2
        nouveau: move the hotplug ignore to correct place.
        drm/nouveau/gf116: remove copy1 engine
        drm/nouveau: prevent stale fence->channel pointers, and protect with rcu
        drm/nouveau/fifo/g84-: ack non-stall interrupt before handling it
      46d967ae
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 9044f940
      Linus Torvalds 提交于
      Pull networking fixes from David Miller:
      
       1) Fill in ethtool link parameters for all link types in cxgb4, from
          Hariprasad Shenai.
      
       2) Fix probe regressions in stmmac driver, from Huacai Chen.
      
       3) Network namespace leaks on errirs in rtnetlink, from Nicolas
          Dichtel.
      
       4) Remove erroneous BUG check which can actually trigger legitimately,
          in xen-netfront.  From Seth Forshee.
      
       5) Validate length of IFLA_BOND_ARP_IP_TARGET netlink attributes, from
          Thomas Grag.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
        cxgb4: Fill in supported link mode for SFP modules
        xen-netfront: Remove BUGs on paged skb data which crosses a page boundary
        sh_eth: Fix sleeping function called from invalid context
        stmmac: platform: Move plat_dat checking earlier
        sh_eth: Fix skb alloc size and alignment adjust rule.
        rtnetlink: release net refcnt on error in do_setlink()
        bond: Check length of IFLA_BOND_ARP_IP_TARGET attributes
      9044f940
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security · 23c836ce
      Linus Torvalds 提交于
      Pull keyring/nfs fixes from James Morris:
       "From David Howells:
      
        The first one fixes the handling of maximum buffer size for key
        descriptions, fixing the size at 4095 + NUL char rather than whatever
        PAGE_SIZE happens to be and permits you to read back the full
        description without it getting clipped because some extra information
        got prepended.
      
        The second and third fix a bug in NFS idmapper handling whereby a key
        representing a mapping between an id and a name expires and causing
        EKEYEXPIRED to be seen internally in NFS (which prevents the mapping
        from happening) rather than re-looking up the mapping"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
        KEYS: request_key() should reget expired keys rather than give EKEYEXPIRED
        KEYS: Simplify KEYRING_SEARCH_{NO,DO}_STATE_CHECK flags
        KEYS: Fix the size of the key description passed to/from userspace
      23c836ce
    • L
      Merge branch 'akpm' (patches from Andrew Morton) · 1dd909af
      Linus Torvalds 提交于
      Merge misc fixes from Andrew Morton:
       "10 fixes"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        slab: fix nodeid bounds check for non-contiguous node IDs
        lib/genalloc.c: export devm_gen_pool_create() for modules
        mm: fix anon_vma_clone() error treatment
        mm: fix swapoff hang after page migration and fork
        fat: fix oops on corrupted vfat fs
        ipc/sem.c: fully initialize sem_array before making it visible
        drivers/input/evdev.c: don't kfree() a vmalloc address
        mm/vmpressure.c: fix race in vmpressure_work_fn()
        mm: frontswap: invalidate expired data on a dup-store failure
        mm: do not overwrite reserved pages counter at show_mem()
      1dd909af
    • P
      slab: fix nodeid bounds check for non-contiguous node IDs · 7c3fbbdd
      Paul Mackerras 提交于
      The bounds check for nodeid in ____cache_alloc_node gives false
      positives on machines where the node IDs are not contiguous, leading to
      a panic at boot time.  For example, on a POWER8 machine the node IDs are
      typically 0, 1, 16 and 17.  This means that num_online_nodes() returns
      4, so when ____cache_alloc_node is called with nodeid = 16 the VM_BUG_ON
      triggers, like this:
      
        kernel BUG at /home/paulus/kernel/kvm/mm/slab.c:3079!
        Call Trace:
          .____cache_alloc_node+0x5c/0x270 (unreliable)
          .kmem_cache_alloc_node_trace+0xdc/0x360
          .init_list+0x3c/0x128
          .kmem_cache_init+0x1dc/0x258
          .start_kernel+0x2a0/0x568
          start_here_common+0x20/0xa8
      
      To fix this, we instead compare the nodeid with MAX_NUMNODES, and
      additionally make sure it isn't negative (since nodeid is an int).  The
      check is there mainly to protect the array dereference in the get_node()
      call in the next line, and the array being dereferenced is of size
      MAX_NUMNODES.  If the nodeid is in range but invalid (for example if the
      node is off-line), the BUG_ON in the next line will catch that.
      
      Fixes: 14e50c6a ("mm: slab: Verify the nodeid passed to ____cache_alloc_node")
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Reviewed-by: NYasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
      Reviewed-by: NPekka Enberg <penberg@kernel.org>
      Acked-by: NDavid Rientjes <rientjes@google.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7c3fbbdd