1. 16 6月, 2016 10 次提交
    • Y
      tipc: fix suspicious RCU usage · 66d95b67
      Ying Xue 提交于
      When run tipcTS&tipcTC test suite, the following complaint appears:
      
      [   56.926168] ===============================
      [   56.926169] [ INFO: suspicious RCU usage. ]
      [   56.926171] 4.7.0-rc1+ #160 Not tainted
      [   56.926173] -------------------------------
      [   56.926174] net/tipc/bearer.c:408 suspicious rcu_dereference_protected() usage!
      [   56.926175]
      [   56.926175] other info that might help us debug this:
      [   56.926175]
      [   56.926177]
      [   56.926177] rcu_scheduler_active = 1, debug_locks = 1
      [   56.926179] 3 locks held by swapper/4/0:
      [   56.926180]  #0:  (((&req->timer))){+.-...}, at: [<ffffffff810e79b5>] call_timer_fn+0x5/0x340
      [   56.926203]  #1:  (&(&req->lock)->rlock){+.-...}, at: [<ffffffffa000c29b>] disc_timeout+0x1b/0xd0 [tipc]
      [   56.926212]  #2:  (rcu_read_lock){......}, at: [<ffffffffa00055e0>] tipc_bearer_xmit_skb+0xb0/0x2e0 [tipc]
      [   56.926218]
      [   56.926218] stack backtrace:
      [   56.926221] CPU: 4 PID: 0 Comm: swapper/4 Not tainted 4.7.0-rc1+ #160
      [   56.926222] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
      [   56.926224]  0000000000000000 ffff880016803d28 ffffffff813c4423 ffff8800154252c0
      [   56.926227]  0000000000000001 ffff880016803d58 ffffffff810b7512 ffff8800124d8120
      [   56.926230]  ffff880013f8a160 ffff8800132b5ccc ffff8800124d8120 ffff880016803d88
      [   56.926234] Call Trace:
      [   56.926235]  <IRQ>  [<ffffffff813c4423>] dump_stack+0x67/0x94
      [   56.926250]  [<ffffffff810b7512>] lockdep_rcu_suspicious+0xe2/0x120
      [   56.926256]  [<ffffffffa00051f1>] tipc_l2_send_msg+0x131/0x1c0 [tipc]
      [   56.926261]  [<ffffffffa000567c>] tipc_bearer_xmit_skb+0x14c/0x2e0 [tipc]
      [   56.926266]  [<ffffffffa00055e0>] ? tipc_bearer_xmit_skb+0xb0/0x2e0 [tipc]
      [   56.926273]  [<ffffffffa000c280>] ? tipc_disc_init_msg+0x1f0/0x1f0 [tipc]
      [   56.926278]  [<ffffffffa000c280>] ? tipc_disc_init_msg+0x1f0/0x1f0 [tipc]
      [   56.926283]  [<ffffffffa000c2d6>] disc_timeout+0x56/0xd0 [tipc]
      [   56.926288]  [<ffffffff810e7a68>] call_timer_fn+0xb8/0x340
      [   56.926291]  [<ffffffff810e79b5>] ? call_timer_fn+0x5/0x340
      [   56.926296]  [<ffffffffa000c280>] ? tipc_disc_init_msg+0x1f0/0x1f0 [tipc]
      [   56.926300]  [<ffffffff810e8f4a>] run_timer_softirq+0x23a/0x390
      [   56.926306]  [<ffffffff810f89ff>] ? clockevents_program_event+0x7f/0x130
      [   56.926316]  [<ffffffff819727c3>] __do_softirq+0xc3/0x4a2
      [   56.926323]  [<ffffffff8106ba5a>] irq_exit+0x8a/0xb0
      [   56.926327]  [<ffffffff81972456>] smp_apic_timer_interrupt+0x46/0x60
      [   56.926331]  [<ffffffff81970a49>] apic_timer_interrupt+0x89/0x90
      [   56.926333]  <EOI>  [<ffffffff81027fda>] ? default_idle+0x2a/0x1a0
      [   56.926340]  [<ffffffff81027fd8>] ? default_idle+0x28/0x1a0
      [   56.926342]  [<ffffffff810289cf>] arch_cpu_idle+0xf/0x20
      [   56.926345]  [<ffffffff810adf0f>] default_idle_call+0x2f/0x50
      [   56.926347]  [<ffffffff810ae145>] cpu_startup_entry+0x215/0x3e0
      [   56.926353]  [<ffffffff81040ad9>] start_secondary+0xf9/0x100
      
      The warning appears as rtnl_dereference() is wrongly used in
      tipc_l2_send_msg() under RCU read lock protection. Instead the proper
      usage should be that rcu_dereference_rtnl() is called here.
      
      Fixes: 5b7066c3 ("tipc: stricter filtering of packets in bearer layer")
      Acked-by: NJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: NYing Xue <ying.xue@windriver.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      66d95b67
    • D
      Merge branch 'macsec-fixes' · e4587ea1
      David S. Miller 提交于
      Sabrina Dubroca says:
      
      ====================
      macsec fixes
      
      Patch 1 adds rcu_barrier() during module unload to prevent possible
      panics.
      
      Patch 2 allocates memory for scattergather lists and the IV on the
      heap, since they can escape the current function's context during
      crypto callbacks.
      
      Patch 3 fixes a failure to create secure associations.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e4587ea1
    • S
      macsec: fix SA initialization · 6052f7fb
      Sabrina Dubroca 提交于
      The ASYNC flag prevents initialization on some physical machines.
      
      Fixes: c09440f7 ("macsec: introduce IEEE 802.1AE driver")
      Signed-off-by: NSabrina Dubroca <sd@queasysnail.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6052f7fb
    • S
      macsec: allocate sg and iv on the heap · 5d9649b3
      Sabrina Dubroca 提交于
      For the crypto callbacks to work properly, we cannot have sg and iv on
      the stack.  Use kmalloc instead, with a single allocation for
      aead_request + scatterlist + iv.
      
      Fixes: c09440f7 ("macsec: introduce IEEE 802.1AE driver")
      Signed-off-by: NSabrina Dubroca <sd@queasysnail.net>
      Acked-by: NHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5d9649b3
    • S
      macsec: add rcu_barrier() on module exit · b196c22a
      Sabrina Dubroca 提交于
      Without this, the various uses of call_rcu could cause a kernel panic.
      
      Fixes: c09440f7 ("macsec: introduce IEEE 802.1AE driver")
      Signed-off-by: NSabrina Dubroca <sd@queasysnail.net>
      Acked-by: NHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b196c22a
    • F
      htb: call qdisc_root with rcu read lock held · 0ee13627
      Florian Westphal 提交于
      saw a debug splat:
      net/include/net/sch_generic.h:287 suspicious rcu_dereference_check() usage!
      other info that might help us debug this:
      rcu_scheduler_active = 1, debug_locks = 0
       2 locks held by kworker/2:1/710:
        #0:  ("events"){.+.+.+}, at: [<ffffffff8106ca1d>]
        #1:  ((&q->work)){+.+...}, at: [<ffffffff8106ca1d>] process_one_work+0x14d/0x690
      Workqueue: events htb_work_func
      Call Trace:
       [<ffffffff812dc763>] dump_stack+0x85/0xc2
       [<ffffffff8109fee7>] lockdep_rcu_suspicious+0xe7/0x120
       [<ffffffff814ced47>] htb_work_func+0x67/0x70
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Acked-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0ee13627
    • J
      net sched actions: bug fix dumping actions directly didnt produce NLMSG_DONE · ebecaa66
      Jamal Hadi Salim 提交于
      This refers to commands to direct action access as follows:
      
      sudo tc actions add action drop index 12
      sudo tc actions add action pipe index 10
      
      And then dumping them like so:
      sudo tc actions ls action gact
      
      iproute2 worked because it depended on absence of TCA_ACT_TAB TLV
      as end of message.
      This fix has been tested with iproute2 and is backward compatible.
      Signed-off-by: NJamal Hadi Salim <jhs@mojatatu.com>
      Acked-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ebecaa66
    • W
      act_ipt: fix a bind refcnt leak · d15eccea
      WANG Cong 提交于
      And avoid calling tcf_hash_check() twice.
      
      Fixes: a57f19d3 ("net sched: ipt action fix late binding")
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Acked-by: NJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d15eccea
    • E
      net_sched: prio: insure proper transactional behavior · 3d7c8257
      Eric Dumazet 提交于
      Now prio_init() can return -ENOMEM, it also has to make sure
      any allocated qdiscs are freed, since the caller (qdisc_create()) wont
      call ->destroy() handler for us.
      
      More generally, we want a transactional behavior for "tc qdisc
      change ...", so prio_tune() should not make modifications if
      any error is returned.
      
      It means that we must validate parameters and allocate missing qdisc(s)
      before taking root qdisc lock exactly once, to not leave the prio qdisc
      in an intermediate state.
      
      Fixes: cbdf4511 ("net_sched: prio: properly report out of memory errors")
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Reported-by: NCong Wang <xiyou.wangcong@gmail.com>
      Acked-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3d7c8257
    • E
      net/mlx4_en: initialize cmd.context_lock spinlock earlier · 0c5ddb51
      Eric Dumazet 提交于
      Maciej Żenczykowski reported lockdep warning a spinlock
      was not registered before being held in mlx4_cmd_wake_completions()
      
      cmd.context_lock initialization is not at the right place.
      
      1) mlx4_cmd_use_events() can be called multiple times.
         Calling spin_lock_init() on a live spinlock can lead
         to hangs.
      
      2) mlx4_cmd_wake_completions() can be called while lock
         has not been initialized.
         Lockdep complains, and current logic is not race prone.
      
      It seems better to move the initialization earlier in
      mlx4_load_one()
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Reported-by: NMaciej Żenczykowski <maze@google.com>
      Cc: Eugenia Emantayev <eugenia@mellanox.com>
      Cc: Tariq Toukan <tariqt@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0c5ddb51
  2. 15 6月, 2016 13 次提交
  3. 13 6月, 2016 2 次提交
  4. 12 6月, 2016 1 次提交
  5. 11 6月, 2016 14 次提交