1. 22 12月, 2012 8 次提交
    • E
      ipv4: arp: fix a lockdep splat in arp_solicit() · 9650388b
      Eric Dumazet 提交于
      Yan Burman reported following lockdep warning :
      
      =============================================
      [ INFO: possible recursive locking detected ]
      3.7.0+ #24 Not tainted
      ---------------------------------------------
      swapper/1/0 is trying to acquire lock:
        (&n->lock){++--..}, at: [<ffffffff8139f56e>] __neigh_event_send
      +0x2e/0x2f0
      
      but task is already holding lock:
        (&n->lock){++--..}, at: [<ffffffff813f63f4>] arp_solicit+0x1d4/0x280
      
      other info that might help us debug this:
        Possible unsafe locking scenario:
      
              CPU0
              ----
         lock(&n->lock);
         lock(&n->lock);
      
        *** DEADLOCK ***
      
        May be due to missing lock nesting notation
      
      4 locks held by swapper/1/0:
        #0:  (((&n->timer))){+.-...}, at: [<ffffffff8104b350>]
      call_timer_fn+0x0/0x1c0
        #1:  (&n->lock){++--..}, at: [<ffffffff813f63f4>] arp_solicit
      +0x1d4/0x280
        #2:  (rcu_read_lock_bh){.+....}, at: [<ffffffff81395400>]
      dev_queue_xmit+0x0/0x5d0
        #3:  (rcu_read_lock_bh){.+....}, at: [<ffffffff813cb41e>]
      ip_finish_output+0x13e/0x640
      
      stack backtrace:
      Pid: 0, comm: swapper/1 Not tainted 3.7.0+ #24
      Call Trace:
        <IRQ>  [<ffffffff8108c7ac>] validate_chain+0xdcc/0x11f0
        [<ffffffff8108d570>] ? __lock_acquire+0x440/0xc30
        [<ffffffff81120565>] ? kmem_cache_free+0xe5/0x1c0
        [<ffffffff8108d570>] __lock_acquire+0x440/0xc30
        [<ffffffff813c3570>] ? inet_getpeer+0x40/0x600
        [<ffffffff8108d570>] ? __lock_acquire+0x440/0xc30
        [<ffffffff8139f56e>] ? __neigh_event_send+0x2e/0x2f0
        [<ffffffff8108ddf5>] lock_acquire+0x95/0x140
        [<ffffffff8139f56e>] ? __neigh_event_send+0x2e/0x2f0
        [<ffffffff8108d570>] ? __lock_acquire+0x440/0xc30
        [<ffffffff81448d4b>] _raw_write_lock_bh+0x3b/0x50
        [<ffffffff8139f56e>] ? __neigh_event_send+0x2e/0x2f0
        [<ffffffff8139f56e>] __neigh_event_send+0x2e/0x2f0
        [<ffffffff8139f99b>] neigh_resolve_output+0x16b/0x270
        [<ffffffff813cb62d>] ip_finish_output+0x34d/0x640
        [<ffffffff813cb41e>] ? ip_finish_output+0x13e/0x640
        [<ffffffffa046f146>] ? vxlan_xmit+0x556/0xbec [vxlan]
        [<ffffffff813cb9a0>] ip_output+0x80/0xf0
        [<ffffffff813ca368>] ip_local_out+0x28/0x80
        [<ffffffffa046f25a>] vxlan_xmit+0x66a/0xbec [vxlan]
        [<ffffffffa046f146>] ? vxlan_xmit+0x556/0xbec [vxlan]
        [<ffffffff81394a50>] ? skb_gso_segment+0x2b0/0x2b0
        [<ffffffff81449355>] ? _raw_spin_unlock_irqrestore+0x65/0x80
        [<ffffffff81394c57>] ? dev_queue_xmit_nit+0x207/0x270
        [<ffffffff813950c8>] dev_hard_start_xmit+0x298/0x5d0
        [<ffffffff813956f3>] dev_queue_xmit+0x2f3/0x5d0
        [<ffffffff81395400>] ? dev_hard_start_xmit+0x5d0/0x5d0
        [<ffffffff813f5788>] arp_xmit+0x58/0x60
        [<ffffffff813f59db>] arp_send+0x3b/0x40
        [<ffffffff813f6424>] arp_solicit+0x204/0x280
        [<ffffffff813a1a70>] ? neigh_add+0x310/0x310
        [<ffffffff8139f515>] neigh_probe+0x45/0x70
        [<ffffffff813a1c10>] neigh_timer_handler+0x1a0/0x2a0
        [<ffffffff8104b3cf>] call_timer_fn+0x7f/0x1c0
        [<ffffffff8104b350>] ? detach_if_pending+0x120/0x120
        [<ffffffff8104b748>] run_timer_softirq+0x238/0x2b0
        [<ffffffff813a1a70>] ? neigh_add+0x310/0x310
        [<ffffffff81043e51>] __do_softirq+0x101/0x280
        [<ffffffff814518cc>] call_softirq+0x1c/0x30
        [<ffffffff81003b65>] do_softirq+0x85/0xc0
        [<ffffffff81043a7e>] irq_exit+0x9e/0xc0
        [<ffffffff810264f8>] smp_apic_timer_interrupt+0x68/0xa0
        [<ffffffff8145122f>] apic_timer_interrupt+0x6f/0x80
        <EOI>  [<ffffffff8100a054>] ? mwait_idle+0xa4/0x1c0
        [<ffffffff8100a04b>] ? mwait_idle+0x9b/0x1c0
        [<ffffffff8100a6a9>] cpu_idle+0x89/0xe0
        [<ffffffff81441127>] start_secondary+0x1b2/0x1b6
      
      Bug is from arp_solicit(), releasing the neigh lock after arp_send()
      In case of vxlan, we eventually need to write lock a neigh lock later.
      
      Its a false positive, but we can get rid of it without lockdep
      annotations.
      
      We can instead use neigh_ha_snapshot() helper.
      Reported-by: NYan Burman <yanb@mellanox.com>
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Acked-by: NStephen Hemminger <shemminger@vyatta.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9650388b
    • E
      tuntap: dont use a private kmem_cache · 9fdc6bef
      Eric Dumazet 提交于
      Commit 96442e42 (tuntap: choose the txq based on rxq)
      added a per tun_struct kmem_cache.
      
      As soon as several tun_struct are used, we get an error
      because two caches cannot have same name.
      
      Use the default kmalloc()/kfree_rcu(), as it reduce code
      size and doesn't have performance impact here.
      Reported-by: NPaul Moore <pmoore@redhat.com>
      Tested-by: NPaul Moore <pmoore@redhat.com>
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Acked-by: NStephen Hemminger <shemminger@vyatta.com>
      Acked-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9fdc6bef
    • E
      net: devnet_rename_seq should be a seqcount · 30e6c9fa
      Eric Dumazet 提交于
      Using a seqlock for devnet_rename_seq is not a good idea,
      as device_rename() can sleep.
      
      As we hold RTNL, we dont need a protection for writers,
      and only need a seqcount so that readers can catch a change done
      by a writer.
      
      Bug added in commit c91f6df2 (sockopt: Change getsockopt() of
      SO_BINDTODEVICE to return an interface name)
      Reported-by: NDave Jones <davej@redhat.com>
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: Brian Haley <brian.haley@hp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      30e6c9fa
    • E
      ip_gre: fix possible use after free · f7e75ba1
      Eric Dumazet 提交于
      Once skb_realloc_headroom() is called, tiph might point to freed memory.
      
      Cache tiph->ttl value before the reallocation, to avoid unexpected
      behavior.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: Isaku Yamahata <yamahata@valinux.co.jp>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f7e75ba1
    • I
      ip_gre: make ipgre_tunnel_xmit() not parse network header as IP unconditionally · 412ed947
      Isaku Yamahata 提交于
      ipgre_tunnel_xmit() parses network header as IP unconditionally.
      But transmitting packets are not always IP packet. For example such packet
      can be sent by packet socket with sockaddr_ll.sll_protocol set.
      So make the function check if skb->protocol is IP.
      Signed-off-by: NIsaku Yamahata <yamahata@valinux.co.jp>
      Acked-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      412ed947
    • D
      solos-pci: double lock in geos_gpio_store() · 29042073
      Dan Carpenter 提交于
      There is a typo here so we do a double lock instead of an unlock.
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Acked-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      29042073
    • T
      NFS: Kill fscache warnings when mounting without -ofsc · c4271c6e
      Trond Myklebust 提交于
      The fscache code will currently bleat a "non-unique superblock keys"
      warning even if the user is mounting without the 'fsc' option.
      
      There should be no reason to even initialise the superblock cache cookie
      unless we're planning on using fscache for something, so ensure that we
      check for the NFS_OPTION_FSCACHE flag before calling into the fscache
      code.
      Reported-by: NPaweł Sikora <pawel.sikora@agmk.net>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      Cc: David Howells <dhowells@redhat.com>
      Acked-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c4271c6e
    • D
      NFS: Provide stub nfs_fscache_wait_on_invalidate() for when CONFIG_NFS_FSCACHE=n · c129c293
      David Howells 提交于
      Provide a stub nfs_fscache_wait_on_invalidate() function for when
      CONFIG_NFS_FSCACHE=n lest the following error appear:
      
        fs/nfs/inode.c: In function 'nfs_invalidate_mapping':
        fs/nfs/inode.c:887:2: error: implicit declaration of function 'nfs_fscache_wait_on_invalidate' [-Werror=implicit-function-declaration]
        cc1: some warnings being treated as errors
      Reported-by: Nkbuild test robot <fengguang.wu@intel.com>
      Reported-by: NVineet Gupta <Vineet.Gupta1@synopsys.com>
      Reported-by: NBorislav Petkov <bp@alien8.de>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c129c293
  2. 21 12月, 2012 32 次提交