1. 30 4月, 2013 3 次提交
  2. 29 4月, 2013 1 次提交
    • H
      ipvs: ip_vs_sip_fill_param() BUG: bad check of return value · f7a1dd6e
      Hans Schillstrom 提交于
      The reason for this patch is crash in kmemdup
      caused by returning from get_callid with uniialized
      matchoff and matchlen.
      
      Removing Zero check of matchlen since it's done by ct_sip_get_header()
      
      BUG: unable to handle kernel paging request at ffff880457b5763f
      IP: [<ffffffff810df7fc>] kmemdup+0x2e/0x35
      PGD 27f6067 PUD 0
      Oops: 0000 [#1] PREEMPT SMP
      Modules linked in: xt_state xt_helper nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_mangle xt_connmark xt_conntrack ip6_tables nf_conntrack_ftp ip_vs_ftp nf_nat xt_tcpudp iptable_mangle xt_mark ip_tables x_tables ip_vs_rr ip_vs_lblcr ip_vs_pe_sip ip_vs nf_conntrack_sip nf_conntrack bonding igb i2c_algo_bit i2c_core
      CPU 5
      Pid: 0, comm: swapper/5 Not tainted 3.9.0-rc5+ #5                  /S1200KP
      RIP: 0010:[<ffffffff810df7fc>]  [<ffffffff810df7fc>] kmemdup+0x2e/0x35
      RSP: 0018:ffff8803fea03648  EFLAGS: 00010282
      RAX: ffff8803d61063e0 RBX: 0000000000000003 RCX: 0000000000000003
      RDX: 0000000000000003 RSI: ffff880457b5763f RDI: ffff8803d61063e0
      RBP: ffff8803fea03658 R08: 0000000000000008 R09: 0000000000000011
      R10: 0000000000000011 R11: 00ffffffff81a8a3 R12: ffff880457b5763f
      R13: ffff8803d67f786a R14: ffff8803fea03730 R15: ffffffffa0098e90
      FS:  0000000000000000(0000) GS:ffff8803fea00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: ffff880457b5763f CR3: 0000000001a0c000 CR4: 00000000001407e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Process swapper/5 (pid: 0, threadinfo ffff8803ee18c000, task ffff8803ee18a480)
      Stack:
       ffff8803d822a080 000000000000001c ffff8803fea036c8 ffffffffa000937a
       ffffffff81f0d8a0 000000038135fdd5 ffff880300000014 ffff880300110000
       ffffffff150118ac ffff8803d7e8a000 ffff88031e0118ac 0000000000000000
      Call Trace:
       <IRQ>
      
       [<ffffffffa000937a>] ip_vs_sip_fill_param+0x13a/0x187 [ip_vs_pe_sip]
       [<ffffffffa007b209>] ip_vs_sched_persist+0x2c6/0x9c3 [ip_vs]
       [<ffffffff8107dc53>] ? __lock_acquire+0x677/0x1697
       [<ffffffff8100972e>] ? native_sched_clock+0x3c/0x7d
       [<ffffffff8100972e>] ? native_sched_clock+0x3c/0x7d
       [<ffffffff810649bc>] ? sched_clock_cpu+0x43/0xcf
       [<ffffffffa007bb1e>] ip_vs_schedule+0x181/0x4ba [ip_vs]
      ...
      Signed-off-by: NHans Schillstrom <hans@schillstrom.com>
      Acked-by: NJulian Anastasov <ja@ssi.bg>
      Signed-off-by: NSimon Horman <horms@verge.net.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f7a1dd6e
  3. 25 4月, 2013 5 次提交
  4. 22 4月, 2013 1 次提交
  5. 20 4月, 2013 4 次提交
  6. 19 4月, 2013 2 次提交
  7. 18 4月, 2013 1 次提交
  8. 17 4月, 2013 1 次提交
    • E
      net: drop dst before queueing fragments · 97599dc7
      Eric Dumazet 提交于
      Commit 4a94445c (net: Use ip_route_input_noref() in input path)
      added a bug in IP defragmentation handling, as non refcounted
      dst could escape an RCU protected section.
      
      Commit 64f3b9e2 (net: ip_expire() must revalidate route) fixed
      the case of timeouts, but not the general problem.
      
      Tom Parkin noticed crashes in UDP stack and provided a patch,
      but further analysis permitted us to pinpoint the root cause.
      
      Before queueing a packet into a frag list, we must drop its dst,
      as this dst has limited lifetime (RCU protected)
      
      When/if a packet is finally reassembled, we use the dst of the very
      last skb, still protected by RCU and valid, as the dst of the
      reassembled packet.
      
      Use same logic in IPv6, as there is no need to hold dst references.
      Reported-by: NTom Parkin <tparkin@katalix.com>
      Tested-by: NTom Parkin <tparkin@katalix.com>
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      97599dc7
  9. 16 4月, 2013 2 次提交
  10. 15 4月, 2013 1 次提交
    • C
      ipv6: statically link register_inet6addr_notifier() · f88c91dd
      Cong Wang 提交于
      Tomas reported the following build error:
      
      net/built-in.o: In function `ieee80211_unregister_hw':
      (.text+0x10f0e1): undefined reference to `unregister_inet6addr_notifier'
      net/built-in.o: In function `ieee80211_register_hw':
      (.text+0x10f610): undefined reference to `register_inet6addr_notifier'
      make: *** [vmlinux] Error 1
      
      when built IPv6 as a module.
      
      So we have to statically link these symbols.
      Reported-by: NTomas Melin <tomas.melin@iki.fi>
      Cc: Tomas Melin <tomas.melin@iki.fi>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: YOSHIFUJI Hidaki <yoshfuji@linux-ipv6.org>
      Signed-off-by: NCong Wang <amwang@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f88c91dd
  11. 13 4月, 2013 1 次提交
  12. 12 4月, 2013 3 次提交
    • F
      netfilter: nf_nat: fix race when unloading protocol modules · c2d421e1
      Florian Westphal 提交于
      following oops was reported:
      RIP: 0010:[<ffffffffa03227f2>]  [<ffffffffa03227f2>] nf_nat_cleanup_conntrack+0x42/0x70 [nf_nat]
      RSP: 0018:ffff880202c63d40  EFLAGS: 00010246
      RAX: 0000000000000000 RBX: ffff8801ac7bec28 RCX: ffff8801d0eedbe0
      RDX: dead000000200200 RSI: 0000000000000011 RDI: ffffffffa03265b8
      [..]
      Call Trace:
       [..]
       [<ffffffffa02febed>] destroy_conntrack+0xbd/0x110 [nf_conntrack]
      
      Happens when a conntrack timeout expires right after first part
      of the nat cleanup has completed (bysrc hash removal), but before
      part 2 has completed (re-initialization of nat area).
      
      [ destroy callback tries to delete bysrc again ]
      
      Patrick suggested to just remove the affected conntracks -- the
      connections won't work properly anyway without nat transformation.
      
      So, lets do that.
      Reported-by: NCAI Qian <caiqian@redhat.com>
      Cc: Patrick McHardy <kaber@trash.net>
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Acked-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      c2d421e1
    • T
      tcp: Reallocate headroom if it would overflow csum_start · 50bceae9
      Thomas Graf 提交于
      If a TCP retransmission gets partially ACKed and collapsed multiple
      times it is possible for the headroom to grow beyond 64K which will
      overflow the 16bit skb->csum_start which is based on the start of
      the headroom. It has been observed rarely in the wild with IPoIB due
      to the 64K MTU.
      
      Verify if the acking and collapsing resulted in a headroom exceeding
      what csum_start can cover and reallocate the headroom if so.
      
      A big thank you to Jim Foraker <foraker1@llnl.gov> and the team at
      LLNL for helping out with the investigation and testing.
      Reported-by: NJim Foraker <foraker1@llnl.gov>
      Signed-off-by: NThomas Graf <tgraf@suug.ch>
      Acked-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      50bceae9
    • D
      tcp: incoming connections might use wrong route under synflood · d66954a0
      Dmitry Popov 提交于
      There is a bug in cookie_v4_check (net/ipv4/syncookies.c):
      	flowi4_init_output(&fl4, 0, sk->sk_mark, RT_CONN_FLAGS(sk),
      			   RT_SCOPE_UNIVERSE, IPPROTO_TCP,
      			   inet_sk_flowi_flags(sk),
      			   (opt && opt->srr) ? opt->faddr : ireq->rmt_addr,
      			   ireq->loc_addr, th->source, th->dest);
      
      Here we do not respect sk->sk_bound_dev_if, therefore wrong dst_entry may be
      taken. This dst_entry is used by new socket (get_cookie_sock ->
      tcp_v4_syn_recv_sock), so its packets may take the wrong path.
      Signed-off-by: NDmitry Popov <dp@highloadlab.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d66954a0
  13. 11 4月, 2013 1 次提交
    • J
      mac80211: fix cfg80211 interaction on auth/assoc request · 7b119dc0
      Johannes Berg 提交于
      If authentication (or association with FT) is requested by
      userspace, mac80211 currently doesn't tell cfg80211 that it
      disconnected from the AP. That leaves inconsistent state:
      cfg80211 thinks it's connected while mac80211 thinks it's
      not. Typically this won't last long, as soon as mac80211
      reports the new association to cfg80211 the old one goes
      away. If, however, the new authentication or association
      doesn't succeed, then cfg80211 will forever think the old
      one still exists and will refuse attempts to authenticate
      or associate with the AP it thinks it's connected to.
      
      Anders reported that this leads to it taking a very long
      time to reconnect to a network, or never even succeeding.
      I tested this with an AP hacked to never respond to auth
      frames, and one that works, and with just those two the
      system never recovers because one won't work and cfg80211
      thinks it's connected to the other so refuses connections
      to it.
      
      To fix this, simply make mac80211 tell cfg80211 when it is
      no longer connected to the old AP, while authenticating or
      associating to a new one.
      
      Cc: stable@vger.kernel.org
      Reported-by: NAnders Kaseorg <andersk@mit.edu>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      7b119dc0
  14. 10 4月, 2013 3 次提交
  15. 09 4月, 2013 6 次提交
  16. 08 4月, 2013 5 次提交
    • J
      mac80211: fix LED in idle handling · 62a40a15
      Johannes Berg 提交于
      feng xiangjun reports that my
      
      commit 382a103b
      Author: Johannes Berg <johannes.berg@intel.com>
      Date:   Fri Mar 22 22:30:09 2013 +0100
      
          mac80211: fix idle handling sequence
      
      broke the wireless status LED. The reason is that
      we now call ieee80211_idle_off() when the channel
      context is assigned, and that doesn't recalculate
      the LED state. Fix this by making that function a
      wrapper around most of idle recalculation while
      forcing active.
      Reported-by: Nfeng xiangjun <fengxj325@gmail.com>
      Tested-by: Nfeng xiangjun <fengxj325@gmail.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      62a40a15
    • M
      VSOCK: Fix missing msg_namelen update in vsock_stream_recvmsg() · d5e0d0f6
      Mathias Krause 提交于
      The code misses to update the msg_namelen member to 0 and therefore
      makes net/socket.c leak the local, uninitialized sockaddr_storage
      variable to userland -- 128 bytes of kernel stack memory.
      
      Cc: Andy King <acking@vmware.com>
      Cc: Dmitry Torokhov <dtor@vmware.com>
      Cc: George Zhang <georgezhang@vmware.com>
      Signed-off-by: NMathias Krause <minipli@googlemail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d5e0d0f6
    • M
      VSOCK: vmci - fix possible info leak in vmci_transport_dgram_dequeue() · 680d04e0
      Mathias Krause 提交于
      In case we received no data on the call to skb_recv_datagram(), i.e.
      skb->data is NULL, vmci_transport_dgram_dequeue() will return with 0
      without updating msg_namelen leading to net/socket.c leaking the local,
      uninitialized sockaddr_storage variable to userland -- 128 bytes of
      kernel stack memory.
      
      Fix this by moving the already existing msg_namelen assignment a few
      lines above.
      
      Cc: Andy King <acking@vmware.com>
      Cc: Dmitry Torokhov <dtor@vmware.com>
      Cc: George Zhang <georgezhang@vmware.com>
      Signed-off-by: NMathias Krause <minipli@googlemail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      680d04e0
    • M
      tipc: fix info leaks via msg_name in recv_msg/recv_stream · 60085c3d
      Mathias Krause 提交于
      The code in set_orig_addr() does not initialize all of the members of
      struct sockaddr_tipc when filling the sockaddr info -- namely the union
      is only partly filled. This will make recv_msg() and recv_stream() --
      the only users of this function -- leak kernel stack memory as the
      msg_name member is a local variable in net/socket.c.
      
      Additionally to that both recv_msg() and recv_stream() fail to update
      the msg_namelen member to 0 while otherwise returning with 0, i.e.
      "success". This is the case for, e.g., non-blocking sockets. This will
      lead to a 128 byte kernel stack leak in net/socket.c.
      
      Fix the first issue by initializing the memory of the union with
      memset(0). Fix the second one by setting msg_namelen to 0 early as it
      will be updated later if we're going to fill the msg_name member.
      
      Cc: Jon Maloy <jon.maloy@ericsson.com>
      Cc: Allan Stephens <allan.stephens@windriver.com>
      Signed-off-by: NMathias Krause <minipli@googlemail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      60085c3d
    • M
      rose: fix info leak via msg_name in rose_recvmsg() · 4a184233
      Mathias Krause 提交于
      The code in rose_recvmsg() does not initialize all of the members of
      struct sockaddr_rose/full_sockaddr_rose when filling the sockaddr info.
      Nor does it initialize the padding bytes of the structure inserted by
      the compiler for alignment. This will lead to leaking uninitialized
      kernel stack bytes in net/socket.c.
      
      Fix the issue by initializing the memory used for sockaddr info with
      memset(0).
      
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Signed-off-by: NMathias Krause <minipli@googlemail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4a184233