1. 01 8月, 2013 2 次提交
  2. 31 7月, 2013 2 次提交
  3. 30 7月, 2013 1 次提交
  4. 28 7月, 2013 1 次提交
    • S
      genetlink: release cb_lock before requesting additional module · c74f2b26
      Stanislaw Gruszka 提交于
      Requesting external module with cb_lock taken can result in
      the deadlock like showed below:
      
      [ 2458.111347] Showing all locks held in the system:
      [ 2458.111347] 1 lock held by NetworkManager/582:
      [ 2458.111347]  #0:  (cb_lock){++++++}, at: [<ffffffff8162bc79>] genl_rcv+0x19/0x40
      [ 2458.111347] 1 lock held by modprobe/603:
      [ 2458.111347]  #0:  (cb_lock){++++++}, at: [<ffffffff8162baa5>] genl_lock_all+0x15/0x30
      
      [ 2461.579457] SysRq : Show Blocked State
      [ 2461.580103]   task                        PC stack   pid father
      [ 2461.580103] NetworkManager  D ffff880034b84500  4040   582      1 0x00000080
      [ 2461.580103]  ffff8800197ff720 0000000000000046 00000000001d5340 ffff8800197fffd8
      [ 2461.580103]  ffff8800197fffd8 00000000001d5340 ffff880019631700 7fffffffffffffff
      [ 2461.580103]  ffff8800197ff880 ffff8800197ff878 ffff880019631700 ffff880019631700
      [ 2461.580103] Call Trace:
      [ 2461.580103]  [<ffffffff817355f9>] schedule+0x29/0x70
      [ 2461.580103]  [<ffffffff81731ad1>] schedule_timeout+0x1c1/0x360
      [ 2461.580103]  [<ffffffff810e69eb>] ? mark_held_locks+0xbb/0x140
      [ 2461.580103]  [<ffffffff817377ac>] ? _raw_spin_unlock_irq+0x2c/0x50
      [ 2461.580103]  [<ffffffff810e6b6d>] ? trace_hardirqs_on_caller+0xfd/0x1c0
      [ 2461.580103]  [<ffffffff81736398>] wait_for_completion_killable+0xe8/0x170
      [ 2461.580103]  [<ffffffff810b7fa0>] ? wake_up_state+0x20/0x20
      [ 2461.580103]  [<ffffffff81095825>] call_usermodehelper_exec+0x1a5/0x210
      [ 2461.580103]  [<ffffffff817362ed>] ? wait_for_completion_killable+0x3d/0x170
      [ 2461.580103]  [<ffffffff81095cc3>] __request_module+0x1b3/0x370
      [ 2461.580103]  [<ffffffff810e6b6d>] ? trace_hardirqs_on_caller+0xfd/0x1c0
      [ 2461.580103]  [<ffffffff8162c5c9>] ctrl_getfamily+0x159/0x190
      [ 2461.580103]  [<ffffffff8162d8a4>] genl_family_rcv_msg+0x1f4/0x2e0
      [ 2461.580103]  [<ffffffff8162d990>] ? genl_family_rcv_msg+0x2e0/0x2e0
      [ 2461.580103]  [<ffffffff8162da1e>] genl_rcv_msg+0x8e/0xd0
      [ 2461.580103]  [<ffffffff8162b729>] netlink_rcv_skb+0xa9/0xc0
      [ 2461.580103]  [<ffffffff8162bc88>] genl_rcv+0x28/0x40
      [ 2461.580103]  [<ffffffff8162ad6d>] netlink_unicast+0xdd/0x190
      [ 2461.580103]  [<ffffffff8162b149>] netlink_sendmsg+0x329/0x750
      [ 2461.580103]  [<ffffffff815db849>] sock_sendmsg+0x99/0xd0
      [ 2461.580103]  [<ffffffff810bb58f>] ? local_clock+0x5f/0x70
      [ 2461.580103]  [<ffffffff810e96e8>] ? lock_release_non_nested+0x308/0x350
      [ 2461.580103]  [<ffffffff815dbc6e>] ___sys_sendmsg+0x39e/0x3b0
      [ 2461.580103]  [<ffffffff810565af>] ? kvm_clock_read+0x2f/0x50
      [ 2461.580103]  [<ffffffff810218b9>] ? sched_clock+0x9/0x10
      [ 2461.580103]  [<ffffffff810bb2bd>] ? sched_clock_local+0x1d/0x80
      [ 2461.580103]  [<ffffffff810bb448>] ? sched_clock_cpu+0xa8/0x100
      [ 2461.580103]  [<ffffffff810e33ad>] ? trace_hardirqs_off+0xd/0x10
      [ 2461.580103]  [<ffffffff810bb58f>] ? local_clock+0x5f/0x70
      [ 2461.580103]  [<ffffffff810e3f7f>] ? lock_release_holdtime.part.28+0xf/0x1a0
      [ 2461.580103]  [<ffffffff8120fec9>] ? fget_light+0xf9/0x510
      [ 2461.580103]  [<ffffffff8120fe0c>] ? fget_light+0x3c/0x510
      [ 2461.580103]  [<ffffffff815dd1d2>] __sys_sendmsg+0x42/0x80
      [ 2461.580103]  [<ffffffff815dd222>] SyS_sendmsg+0x12/0x20
      [ 2461.580103]  [<ffffffff81741ad9>] system_call_fastpath+0x16/0x1b
      [ 2461.580103] modprobe        D ffff88000f2c8000  4632   603    602 0x00000080
      [ 2461.580103]  ffff88000f04fba8 0000000000000046 00000000001d5340 ffff88000f04ffd8
      [ 2461.580103]  ffff88000f04ffd8 00000000001d5340 ffff8800377d4500 ffff8800377d4500
      [ 2461.580103]  ffffffff81d0b260 ffffffff81d0b268 ffffffff00000000 ffffffff81d0b2b0
      [ 2461.580103] Call Trace:
      [ 2461.580103]  [<ffffffff817355f9>] schedule+0x29/0x70
      [ 2461.580103]  [<ffffffff81736d4d>] rwsem_down_write_failed+0xed/0x1a0
      [ 2461.580103]  [<ffffffff810bb200>] ? update_cpu_load_active+0x10/0xb0
      [ 2461.580103]  [<ffffffff8137b473>] call_rwsem_down_write_failed+0x13/0x20
      [ 2461.580103]  [<ffffffff8173492d>] ? down_write+0x9d/0xb2
      [ 2461.580103]  [<ffffffff8162baa5>] ? genl_lock_all+0x15/0x30
      [ 2461.580103]  [<ffffffff8162baa5>] genl_lock_all+0x15/0x30
      [ 2461.580103]  [<ffffffff8162cbb3>] genl_register_family+0x53/0x1f0
      [ 2461.580103]  [<ffffffffa01dc000>] ? 0xffffffffa01dbfff
      [ 2461.580103]  [<ffffffff8162d650>] genl_register_family_with_ops+0x20/0x80
      [ 2461.580103]  [<ffffffffa01dc000>] ? 0xffffffffa01dbfff
      [ 2461.580103]  [<ffffffffa017fe84>] nl80211_init+0x24/0xf0 [cfg80211]
      [ 2461.580103]  [<ffffffffa01dc000>] ? 0xffffffffa01dbfff
      [ 2461.580103]  [<ffffffffa01dc043>] cfg80211_init+0x43/0xdb [cfg80211]
      [ 2461.580103]  [<ffffffff810020fa>] do_one_initcall+0xfa/0x1b0
      [ 2461.580103]  [<ffffffff8105cb93>] ? set_memory_nx+0x43/0x50
      [ 2461.580103]  [<ffffffff810f75af>] load_module+0x1c6f/0x27f0
      [ 2461.580103]  [<ffffffff810f2c90>] ? store_uevent+0x40/0x40
      [ 2461.580103]  [<ffffffff810f82c6>] SyS_finit_module+0x86/0xb0
      [ 2461.580103]  [<ffffffff81741ad9>] system_call_fastpath+0x16/0x1b
      [ 2461.580103] Sched Debug Version: v0.10, 3.11.0-0.rc1.git4.1.fc20.x86_64 #1
      
      Problem start to happen after adding net-pf-16-proto-16-family-nl80211
      alias name to cfg80211 module by below commit (though that commit
      itself is perfectly fine):
      
      commit fb4e1568
      Author: Marcel Holtmann <marcel@holtmann.org>
      Date:   Sun Apr 28 16:22:06 2013 -0700
      
          nl80211: Add generic netlink module alias for cfg80211/nl80211
      Reported-and-tested-by: NJeff Layton <jlayton@redhat.com>
      Reported-by: NRichard W.M. Jones <rjones@redhat.com>
      Signed-off-by: NStanislaw Gruszka <sgruszka@redhat.com>
      Reviewed-by: NPravin B Shelar <pshelar@nicira.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c74f2b26
  5. 27 7月, 2013 1 次提交
  6. 25 7月, 2013 3 次提交
    • F
      net: fix comment above build_skb() · deceb4c0
      Florian Fainelli 提交于
      build_skb() specifies that the data parameter must come from a kmalloc'd
      area, this is only true if frag_size equals 0, because then build_skb()
      will use kzsize(data) to figure out the actual data size. Update the
      comment to reflect that special condition.
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      deceb4c0
    • H
      ipv6: take rtnl_lock and mark mrt6 table as freed on namespace cleanup · 905a6f96
      Hannes Frederic Sowa 提交于
      Otherwise we end up dereferencing the already freed net->ipv6.mrt pointer
      which leads to a panic (from Srivatsa S. Bhat):
      
      BUG: unable to handle kernel paging request at ffff882018552020
      IP: [<ffffffffa0366b02>] ip6mr_sk_done+0x32/0xb0 [ipv6]
      PGD 290a067 PUD 207ffe0067 PMD 207ff1d067 PTE 8000002018552060
      Oops: 0000 [#1] SMP DEBUG_PAGEALLOC
      Modules linked in: ebtable_nat ebtables nfs fscache nf_conntrack_ipv4 nf_defrag_ipv4 ipt_REJECT xt_CHECKSUM iptable_mangle iptable_filter ip_tables nfsd lockd nfs_acl exportfs auth_rpcgss autofs4 sunrpc 8021q garp bridge stp llc ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter
      +ip6_tables ipv6 vfat fat vhost_net macvtap macvlan vhost tun kvm_intel kvm uinput iTCO_wdt iTCO_vendor_support cdc_ether usbnet mii microcode i2c_i801 i2c_core lpc_ich mfd_core shpchp ioatdma dca mlx4_core be2net wmi acpi_cpufreq mperf ext4 jbd2 mbcache dm_mirror dm_region_hash dm_log dm_mod
      CPU: 0 PID: 7 Comm: kworker/u33:0 Not tainted 3.11.0-rc1-ea45e-a #4
      Hardware name: IBM  -[8737R2A]-/00Y2738, BIOS -[B2E120RUS-1.20]- 11/30/2012
      Workqueue: netns cleanup_net
      task: ffff8810393641c0 ti: ffff881039366000 task.ti: ffff881039366000
      RIP: 0010:[<ffffffffa0366b02>]  [<ffffffffa0366b02>] ip6mr_sk_done+0x32/0xb0 [ipv6]
      RSP: 0018:ffff881039367bd8  EFLAGS: 00010286
      RAX: ffff881039367fd8 RBX: ffff882018552000 RCX: dead000000200200
      RDX: 0000000000000000 RSI: ffff881039367b68 RDI: ffff881039367b68
      RBP: ffff881039367bf8 R08: ffff881039367b68 R09: 2222222222222222
      R10: 2222222222222222 R11: 2222222222222222 R12: ffff882015a7a040
      R13: ffff882014eb89c0 R14: ffff8820289e2800 R15: 0000000000000000
      FS:  0000000000000000(0000) GS:ffff88103fc00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: ffff882018552020 CR3: 0000000001c0b000 CR4: 00000000000407f0
      Stack:
       ffff881039367c18 ffff882014eb89c0 ffff882015e28c00 0000000000000000
       ffff881039367c18 ffffffffa034d9d1 ffff8820289e2800 ffff882014eb89c0
       ffff881039367c58 ffffffff815bdecb ffffffff815bddf2 ffff882014eb89c0
      Call Trace:
       [<ffffffffa034d9d1>] rawv6_close+0x21/0x40 [ipv6]
       [<ffffffff815bdecb>] inet_release+0xfb/0x220
       [<ffffffff815bddf2>] ? inet_release+0x22/0x220
       [<ffffffffa032686f>] inet6_release+0x3f/0x50 [ipv6]
       [<ffffffff8151c1d9>] sock_release+0x29/0xa0
       [<ffffffff81525520>] sk_release_kernel+0x30/0x70
       [<ffffffffa034f14b>] icmpv6_sk_exit+0x3b/0x80 [ipv6]
       [<ffffffff8152fff9>] ops_exit_list+0x39/0x60
       [<ffffffff815306fb>] cleanup_net+0xfb/0x1a0
       [<ffffffff81075e3a>] process_one_work+0x1da/0x610
       [<ffffffff81075dc9>] ? process_one_work+0x169/0x610
       [<ffffffff81076390>] worker_thread+0x120/0x3a0
       [<ffffffff81076270>] ? process_one_work+0x610/0x610
       [<ffffffff8107da2e>] kthread+0xee/0x100
       [<ffffffff8107d940>] ? __init_kthread_worker+0x70/0x70
       [<ffffffff8162a99c>] ret_from_fork+0x7c/0xb0
       [<ffffffff8107d940>] ? __init_kthread_worker+0x70/0x70
      Code: 20 48 89 5d e8 4c 89 65 f0 4c 89 6d f8 66 66 66 66 90 4c 8b 67 30 49 89 fd e8 db 3c 1e e1 49 8b 9c 24 90 08 00 00 48 85 db 74 06 <4c> 39 6b 20 74 20 bb f3 ff ff ff e8 8e 3c 1e e1 89 d8 4c 8b 65
      RIP  [<ffffffffa0366b02>] ip6mr_sk_done+0x32/0xb0 [ipv6]
       RSP <ffff881039367bd8>
      CR2: ffff882018552020
      Reported-by: NSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Tested-by: NSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Signed-off-by: NHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      905a6f96
    • J
      fib_trie: potential out of bounds access in trie_show_stats() · f585a991
      Jerry Snitselaar 提交于
      With the <= max condition in the for loop, it will be always go 1
      element further than needed. If the condition for the while loop is
      never met, then max is MAX_STAT_DEPTH, and for loop will walk off the
      end of nodesizes[].
      Signed-off-by: NJerry Snitselaar <jerry.snitselaar@oracle.com>
      Acked-by: NHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f585a991
  7. 20 7月, 2013 2 次提交
  8. 19 7月, 2013 3 次提交
    • E
      vlan: fix a race in egress prio management · 3e3aac49
      Eric Dumazet 提交于
      egress_priority_map[] hash table updates are protected by rtnl,
      and we never remove elements until device is dismantled.
      
      We have to make sure that before inserting an new element in hash table,
      all its fields are committed to memory or else another cpu could
      find corrupt values and crash.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: Patrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3e3aac49
    • E
      vlan: mask vlan prio bits · d4b812de
      Eric Dumazet 提交于
      In commit 48cc32d3
      ("vlan: don't deliver frames for unknown vlans to protocols")
      Florian made sure we set pkt_type to PACKET_OTHERHOST
      if the vlan id is set and we could find a vlan device for this
      particular id.
      
      But we also have a problem if prio bits are set.
      
      Steinar reported an issue on a router receiving IPv6 frames with a
      vlan tag of 4000 (id 0, prio 2), and tunneled into a sit device,
      because skb->vlan_tci is set.
      
      Forwarded frame is completely corrupted : We can see (8100:4000)
      being inserted in the middle of IPv6 source address :
      
      16:48:00.780413 IP6 2001:16d8:8100:4000:ee1c:0:9d9:bc87 >
      9f94:4d95:2001:67c:29f4::: ICMP6, unknown icmp6 type (0), length 64
             0x0000:  0000 0029 8000 c7c3 7103 0001 a0ae e651
             0x0010:  0000 0000 ccce 0b00 0000 0000 1011 1213
             0x0020:  1415 1617 1819 1a1b 1c1d 1e1f 2021 2223
             0x0030:  2425 2627 2829 2a2b 2c2d 2e2f 3031 3233
      
      It seems we are not really ready to properly cope with this right now.
      
      We can probably do better in future kernels :
      vlan_get_ingress_priority() should be a netdev property instead of
      a per vlan_dev one.
      
      For stable kernels, lets clear vlan_tci to fix the bugs.
      Reported-by: NSteinar H. Gunderson <sesse@google.com>
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d4b812de
    • P
      pkt_sched: sch_qfq: remove a source of high packet delay/jitter · 87f40dd6
      Paolo Valente 提交于
      QFQ+ inherits from QFQ a design choice that may cause a high packet
      delay/jitter and a severe short-term unfairness. As QFQ, QFQ+ uses a
      special quantity, the system virtual time, to track the service
      provided by the ideal system it approximates. When a packet is
      dequeued, this quantity must be incremented by the size of the packet,
      divided by the sum of the weights of the aggregates waiting to be
      served. Tracking this sum correctly is a non-trivial task, because, to
      preserve tight service guarantees, the decrement of this sum must be
      delayed in a special way [1]: this sum can be decremented only after
      that its value would decrease also in the ideal system approximated by
      QFQ+. For efficiency, QFQ+ keeps track only of the 'instantaneous'
      weight sum, increased and decreased immediately as the weight of an
      aggregate changes, and as an aggregate is created or destroyed (which,
      in its turn, happens as a consequence of some class being
      created/destroyed/changed). However, to avoid the problems caused to
      service guarantees by these immediate decreases, QFQ+ increments the
      system virtual time using the maximum value allowed for the weight
      sum, 2^10, in place of the dynamic, instantaneous value. The
      instantaneous value of the weight sum is used only to check whether a
      request of weight increase or a class creation can be satisfied.
      
      Unfortunately, the problems caused by this choice are worse than the
      temporary degradation of the service guarantees that may occur, when a
      class is changed or destroyed, if the instantaneous value of the
      weight sum was used to update the system virtual time. In fact, the
      fraction of the link bandwidth guaranteed by QFQ+ to each aggregate is
      equal to the ratio between the weight of the aggregate and the sum of
      the weights of the competing aggregates. The packet delay guaranteed
      to the aggregate is instead inversely proportional to the guaranteed
      bandwidth. By using the maximum possible value, and not the actual
      value of the weight sum, QFQ+ provides each aggregate with the worst
      possible service guarantees, and not with service guarantees related
      to the actual set of competing aggregates. To see the consequences of
      this fact, consider the following simple example.
      
      Suppose that only the following aggregates are backlogged, i.e., that
      only the classes in the following aggregates have packets to transmit:
      one aggregate with weight 10, say A, and ten aggregates with weight 1,
      say B1, B2, ..., B10. In particular, suppose that these aggregates are
      always backlogged. Given the weight distribution, the smoothest and
      fairest service order would be:
      A B1 A B2 A B3 A B4 A B5 A B6 A B7 A B8 A B9 A B10 A B1 A B2 ...
      
      QFQ+ would provide exactly this optimal service if it used the actual
      value for the weight sum instead of the maximum possible value, i.e.,
      11 instead of 2^10. In contrast, since QFQ+ uses the latter value, it
      serves aggregates as follows (easy to prove and to reproduce
      experimentally):
      A B1 B2 B3 B4 B5 B6 B7 B8 B9 B10 A A A A A A A A A A B1 B2 ... B10 A A ...
      
      By replacing 10 with N in the above example, and by increasing N, one
      can increase at will the maximum packet delay and the jitter
      experienced by the classes in aggregate A.
      
      This patch addresses this issue by just using the above
      'instantaneous' value of the weight sum, instead of the maximum
      possible value, when updating the system virtual time.  After the
      instantaneous weight sum is decreased, QFQ+ may deviate from the ideal
      service for a time interval in the order of the time to serve one
      maximum-size packet for each backlogged class. The worst-case extent
      of the deviation exhibited by QFQ+ during this time interval [1] is
      basically the same as of the deviation described above (but, without
      this patch, QFQ+ suffers from such a deviation all the time). Finally,
      this patch modifies the comment to the function qfq_slot_insert, to
      make it coherent with the fact that the weight sum used by QFQ+ can
      now be lower than the maximum possible value.
      
      [1] P. Valente, "Extending WF2Q+ to support a dynamic traffic mix",
      Proceedings of AAA-IDEA'05, June 2005.
      Signed-off-by: NPaolo Valente <paolo.valente@unimore.it>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      87f40dd6
  9. 17 7月, 2013 5 次提交
  10. 16 7月, 2013 8 次提交
  11. 15 7月, 2013 5 次提交
  12. 14 7月, 2013 3 次提交
  13. 13 7月, 2013 4 次提交