1. 16 4月, 2012 2 次提交
  2. 15 4月, 2012 6 次提交
  3. 14 4月, 2012 7 次提交
  4. 13 4月, 2012 12 次提交
    • D
      caif: set traffic class for caif packets · 44764812
      Dmitry Tarnyagin 提交于
      Set traffic class for CAIF packets, based on socket
      priority, CAIF protocol type, or type of message.
      
      Traffic class mapping for different packet types:
       - control:       TC_PRIO_CONTROL;
       - flow control:  TC_PRIO_CONTROL;
       - at:            TC_PRIO_CONTROL;
       - rfm:           TC_PRIO_INTERACTIVE_BULK;
       - other sockets: equals to socket's TC;
       - network data:  no change.
      Signed-off-by: NDmitry Tarnyagin <dmitry.tarnyagin@stericsson.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      44764812
    • T
      caif: Fix memory leakage in the chnl_net.c. · 5c699fb7
      Tomasz Gregorek 提交于
      Added kfree_skb() calls in the chnk_net.c file on
      the error paths.
      Signed-off-by: NSjur Brændeland <sjur.brandeland@stericsson.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5c699fb7
    • J
      l2tp: don't overwrite source address in l2tp_ip_bind() · c9be48dc
      James Chapman 提交于
      Applications using L2TP/IP sockets want to be able to bind() an L2TP/IP
      socket to set the local tunnel id while leaving the auto-assigned source
      address alone. So if no source address is supplied, don't overwrite
      the address already stored in the socket.
      Signed-off-by: NJames Chapman <jchapman@katalix.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c9be48dc
    • J
      l2tp: fix refcount leak in l2tp_ip sockets · d1f224ae
      James Chapman 提交于
      The l2tp_ip socket close handler does not update the module refcount
      correctly which prevents module unload after the first bind() call on
      an L2TPv3 IP encapulation socket.
      Signed-off-by: NJames Chapman <jchapman@katalix.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d1f224ae
    • J
      net/key/af_key.c: add missing kfree_skb · 89eb06f1
      Julia Lawall 提交于
      At the point of this error-handling code, alloc_skb has succeded, so free
      the resulting skb by jumping to the err label.
      Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      89eb06f1
    • E
      phonet: Sort out initiailziation and cleanup code. · 03478756
      Eric W. Biederman 提交于
      Recently an oops was reported in phonet if there was a failure during
      network namespace creation.
      
      [  163.733755] ------------[ cut here ]------------
      [  163.734501] kernel BUG at include/net/netns/generic.h:45!
      [  163.734501] invalid opcode: 0000 [#1] PREEMPT SMP
      [  163.734501] CPU 2
      [  163.734501] Pid: 19145, comm: trinity Tainted: G        W 3.4.0-rc1-next-20120405-sasha-dirty #57
      [  163.734501] RIP: 0010:[<ffffffff824d6062>]  [<ffffffff824d6062>] phonet_pernet+0x182/0x1a0
      [  163.734501] RSP: 0018:ffff8800674d5ca8  EFLAGS: 00010246
      [  163.734501] RAX: 000000003fffffff RBX: 0000000000000000 RCX: ffff8800678c88d8
      [  163.734501] RDX: 00000000003f4000 RSI: ffff8800678c8910 RDI: 0000000000000282
      [  163.734501] RBP: ffff8800674d5cc8 R08: 0000000000000000 R09: 0000000000000000
      [  163.734501] R10: 0000000000000000 R11: 0000000000000000 R12: ffff880068bec920
      [  163.734501] R13: ffffffff836b90c0 R14: 0000000000000000 R15: 0000000000000000
      [  163.734501] FS:  00007f055e8de700(0000) GS:ffff88007d000000(0000) knlGS:0000000000000000
      [  163.734501] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
      [  163.734501] CR2: 00007f055e6bb518 CR3: 0000000070c16000 CR4: 00000000000406e0
      [  163.734501] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [  163.734501] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      [  163.734501] Process trinity (pid: 19145, threadinfo ffff8800674d4000, task ffff8800678c8000)
      [  163.734501] Stack:
      [  163.734501]  ffffffff824d5f00 ffffffff810e2ec1 ffff880067ae0000 00000000ffffffd4
      [  163.734501]  ffff8800674d5cf8 ffffffff824d667a ffff880067ae0000 00000000ffffffd4
      [  163.734501]  ffffffff836b90c0 0000000000000000 ffff8800674d5d18 ffffffff824d707d
      [  163.734501] Call Trace:
      [  163.734501]  [<ffffffff824d5f00>] ? phonet_pernet+0x20/0x1a0
      [  163.734501]  [<ffffffff810e2ec1>] ? get_parent_ip+0x11/0x50
      [  163.734501]  [<ffffffff824d667a>] phonet_device_destroy+0x1a/0x100
      [  163.734501]  [<ffffffff824d707d>] phonet_device_notify+0x3d/0x50
      [  163.734501]  [<ffffffff810dd96e>] notifier_call_chain+0xee/0x130
      [  163.734501]  [<ffffffff810dd9d1>] raw_notifier_call_chain+0x11/0x20
      [  163.734501]  [<ffffffff821cce12>] call_netdevice_notifiers+0x52/0x60
      [  163.734501]  [<ffffffff821cd235>] rollback_registered_many+0x185/0x270
      [  163.734501]  [<ffffffff821cd334>] unregister_netdevice_many+0x14/0x60
      [  163.734501]  [<ffffffff823123e3>] ipip_exit_net+0x1b3/0x1d0
      [  163.734501]  [<ffffffff82312230>] ? ipip_rcv+0x420/0x420
      [  163.734501]  [<ffffffff821c8515>] ops_exit_list+0x35/0x70
      [  163.734501]  [<ffffffff821c911b>] setup_net+0xab/0xe0
      [  163.734501]  [<ffffffff821c9416>] copy_net_ns+0x76/0x100
      [  163.734501]  [<ffffffff810dc92b>] create_new_namespaces+0xfb/0x190
      [  163.734501]  [<ffffffff810dca21>] unshare_nsproxy_namespaces+0x61/0x80
      [  163.734501]  [<ffffffff810afd1f>] sys_unshare+0xff/0x290
      [  163.734501]  [<ffffffff8187622e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
      [  163.734501]  [<ffffffff82665539>] system_call_fastpath+0x16/0x1b
      [  163.734501] Code: e0 c3 fe 66 0f 1f 44 00 00 48 c7 c2 40 60 4d 82 be 01 00 00 00 48 c7 c7 80 d1 23 83 e8 48 2a c4 fe e8 73 06 c8 fe 48 85 db 75 0e <0f> 0b 0f 1f 40 00 eb fe 66 0f 1f 44 00 00 48 83 c4 10 48 89 d8
      [  163.734501] RIP  [<ffffffff824d6062>] phonet_pernet+0x182/0x1a0
      [  163.734501]  RSP <ffff8800674d5ca8>
      [  163.861289] ---[ end trace fb5615826c548066 ]---
      
      After investigation it turns out there were two issues.
      1) Phonet was not implementing network devices but was using register_pernet_device
         instead of register_pernet_subsys.
      
         This was allowing there to be cases when phonenet was not initialized and
         the phonet net_generic was not set for a network namespace when network
         device events were being reported on the netdevice_notifier for a network
         namespace leading to the oops above.
      
      2) phonet_exit_net was implementing a confusing and special case of handling all
         network devices from going away that it was hard to see was correct, and would
         only occur when the phonet module was removed.
      
         Now that unregister_netdevice_notifier has been modified to synthesize unregistration
         events for the network devices that are extant when called this confusing special
         case in phonet_exit_net is no longer needed.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Acked-by: NRémi Denis-Courmont <remi.denis-courmont@nokia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      03478756
    • E
      net: In unregister_netdevice_notifier unregister the netdevices. · 7d3d43da
      Eric W. Biederman 提交于
      We already synthesize events in register_netdevice_notifier and synthesizing
      events in unregister_netdevice_notifier allows to us remove the need for
      special case cleanup code.
      
      This change should be safe as it adds no new cases for existing callers
      of unregiser_netdevice_notifier to handle.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7d3d43da
    • E
      net/ipv6/exthdrs.c: Strict PadN option checking · c1412fce
      Eldad Zack 提交于
      Added strict checking of PadN, as PadN can be used to increase header
      size and thus push the protocol header into the 2nd fragment.
      
      PadN is used to align the options within the Hop-by-Hop or
      Destination Options header to 64-bit boundaries. The maximum valid
      size is thus 7 bytes.
      RFC 4942 recommends to actively check the "payload" itself and
      ensure that it contains only zeroes.
      
      See also RFC 4942 section 2.1.9.5.
      Signed-off-by: NEldad Zack <eldad@fogrefinery.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c1412fce
    • J
      net: Fixed coding style issues relating to braces. · 46ba5b23
      Jeffrin Jose 提交于
      Fixed coding style issues in net/core/utils.c
      in relation with braces placement.
      Signed-off-by: NJeffrin Jose <ahiliation@yahoo.co.in>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      46ba5b23
    • E
      net/ipv6/ipv6_sockglue.c: Removed redundant extern · 6fdbd164
      Eldad Zack 提交于
      extern int sysctl_mld_max_msf is already defined in linux/ipv6.h.
      Signed-off-by: NEldad Zack <eldad@fogrefinery.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6fdbd164
    • S
      net/core: simple_strtoul cleanup · e1e420c7
      Shuah Khan 提交于
      Changed net/core/net-sysfs.c: netdev_store() to use kstrtoul()
      instead of obsolete simple_strtoul().
      Signed-off-by: NShuah Khan <shuahkhan@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e1e420c7
    • A
      Treat ND option 31 as userland (DNSSL support) · e35f30c1
      Alexey I. Froloff 提交于
      As specified in RFC6106, DNSSL option contains one or more domain names
      of DNS suffixes.  8-bit identifier of the DNSSL option type as assigned
      by the IANA is 31.  This option should also be treated as userland.
      Signed-off-by: NAlexey I. Froloff <raorn@raorn.name>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e35f30c1
  5. 12 4月, 2012 11 次提交
  6. 11 4月, 2012 2 次提交
    • E
      tcp: avoid order-1 allocations on wifi and tx path · a21d4572
      Eric Dumazet 提交于
      Marc Merlin reported many order-1 allocations failures in TX path on its
      wireless setup, that dont make any sense with MTU=1500 network, and non
      SG capable hardware.
      
      After investigation, it turns out TCP uses sk_stream_alloc_skb() and
      used as a convention skb_tailroom(skb) to know how many bytes of data
      payload could be put in this skb (for non SG capable devices)
      
      Note : these skb used kmalloc-4096 (MTU=1500 + MAX_HEADER +
      sizeof(struct skb_shared_info) being above 2048)
      
      Later, mac80211 layer need to add some bytes at the tail of skb
      (IEEE80211_ENCRYPT_TAILROOM = 18 bytes) and since no more tailroom is
      available has to call pskb_expand_head() and request order-1
      allocations.
      
      This patch changes sk_stream_alloc_skb() so that only
      sk->sk_prot->max_header bytes of headroom are reserved, and use a new
      skb field, avail_size to hold the data payload limit.
      
      This way, order-0 allocations done by TCP stack can leave more than 2 KB
      of tailroom and no more allocation is performed in mac80211 layer (or
      any layer needing some tailroom)
      
      avail_size is unioned with mark/dropcount, since mark will be set later
      in IP stack for output packets. Therefore, skb size is unchanged.
      Reported-by: NMarc MERLIN <marc@merlins.org>
      Tested-by: NMarc MERLIN <marc@merlins.org>
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a21d4572
    • E
      net: allow pskb_expand_head() to get maximum tailroom · 87151b86
      Eric Dumazet 提交于
      Marc Merlin reported many order-1 allocations failures in TX path on its
      wireless setup, that dont make any sense with MTU=1500 network, and non
      SG capable hardware.
      
      Turns out part of the problem comes from pskb_expand_head() not using
      ksize() to get exact head size given by kmalloc(). Doing the same thing
      than __alloc_skb() allows more tailroom in skb and can prevent future
      reallocations.
      
      As a bonus, struct skb_shared_info becomes cache line aligned.
      Reported-by: NMarc MERLIN <marc@merlins.org>
      Tested-by: NMarc MERLIN <marc@merlins.org>
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      87151b86