1. 28 5月, 2013 2 次提交
  2. 20 4月, 2013 4 次提交
  3. 19 4月, 2013 2 次提交
  4. 18 4月, 2013 1 次提交
  5. 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
  6. 16 4月, 2013 2 次提交
  7. 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
  8. 13 4月, 2013 1 次提交
  9. 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
  10. 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
  11. 10 4月, 2013 3 次提交
  12. 09 4月, 2013 6 次提交
  13. 08 4月, 2013 13 次提交
    • 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
    • M
      NFC: llcp: fix info leaks via msg_name in llcp_sock_recvmsg() · d26d6504
      Mathias Krause 提交于
      The code in llcp_sock_recvmsg() does not initialize all the members of
      struct sockaddr_nfc_llcp when filling the sockaddr info. Nor does it
      initialize the padding bytes of the structure inserted by the compiler
      for alignment.
      
      Also, if the socket is in state LLCP_CLOSED or is shutting down during
      receive the msg_namelen member is not updated to 0 while otherwise
      returning with 0, i.e. "success". The msg_namelen update is also
      missing for stream and seqpacket sockets which don't fill the sockaddr
      info.
      
      Both issues lead to the fact that the code will leak uninitialized
      kernel stack bytes in net/socket.c.
      
      Fix the first issue by initializing the memory used for sockaddr info
      with memset(0). Fix the second one by setting msg_namelen to 0 early.
      It will be updated later if we're going to fill the msg_name member.
      
      Cc: Lauro Ramos Venancio <lauro.venancio@openbossa.org>
      Cc: Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
      Cc: Samuel Ortiz <sameo@linux.intel.com>
      Signed-off-by: NMathias Krause <minipli@googlemail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d26d6504
    • M
      netrom: fix info leak via msg_name in nr_recvmsg() · 3ce5efad
      Mathias Krause 提交于
      In case msg_name is set the sockaddr info gets filled out, as
      requested, but the code fails to initialize the padding bytes of
      struct sockaddr_ax25 inserted by the compiler for alignment. Also
      the sax25_ndigis member does not get assigned, leaking four more
      bytes.
      
      Both issues lead to the fact that the code will leak uninitialized
      kernel stack bytes in net/socket.c.
      
      Fix both issues by initializing the memory 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>
      3ce5efad
    • M
      llc: Fix missing msg_namelen update in llc_ui_recvmsg() · c77a4b9c
      Mathias Krause 提交于
      For stream sockets 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. The msg_namelen update is also missing for datagram sockets
      in case the socket is shutting down during receive.
      
      Fix both issues by setting msg_namelen to 0 early. It will be
      updated later if we're going to fill the msg_name member.
      
      Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
      Signed-off-by: NMathias Krause <minipli@googlemail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c77a4b9c
    • M
      l2tp: fix info leak in l2tp_ip6_recvmsg() · b860d3cc
      Mathias Krause 提交于
      The L2TP code for IPv6 fails to initialize the l2tp_conn_id member of
      struct sockaddr_l2tpip6 and therefore leaks four bytes kernel stack
      in l2tp_ip6_recvmsg() in case msg_name is set.
      
      Initialize l2tp_conn_id with 0 to avoid the info leak.
      Signed-off-by: NMathias Krause <minipli@googlemail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b860d3cc
    • M
      iucv: Fix missing msg_namelen update in iucv_sock_recvmsg() · a5598bd9
      Mathias Krause 提交于
      The current code does not fill the msg_name member in case it is set.
      It also does not set 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.
      
      Fix that by simply setting msg_namelen to 0 as obviously nobody cared
      about iucv_sock_recvmsg() not filling the msg_name in case it was set.
      
      Cc: Ursula Braun <ursula.braun@de.ibm.com>
      Signed-off-by: NMathias Krause <minipli@googlemail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a5598bd9
    • M
      irda: Fix missing msg_namelen update in irda_recvmsg_dgram() · 5ae94c0d
      Mathias Krause 提交于
      The current code does not fill the msg_name member in case it is set.
      It also does not set 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.
      
      Fix that by simply setting msg_namelen to 0 as obviously nobody cared
      about irda_recvmsg_dgram() not filling the msg_name in case it was
      set.
      
      Cc: Samuel Ortiz <samuel@sortiz.org>
      Signed-off-by: NMathias Krause <minipli@googlemail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5ae94c0d
    • M
      caif: Fix missing msg_namelen update in caif_seqpkt_recvmsg() · 2d6fbfe7
      Mathias Krause 提交于
      The current code does not fill the msg_name member in case it is set.
      It also does not set 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.
      
      Fix that by simply setting msg_namelen to 0 as obviously nobody cared
      about caif_seqpkt_recvmsg() not filling the msg_name in case it was
      set.
      
      Cc: Sjur Braendeland <sjur.brandeland@stericsson.com>
      Signed-off-by: NMathias Krause <minipli@googlemail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2d6fbfe7
    • M
      Bluetooth: SCO - Fix missing msg_namelen update in sco_sock_recvmsg() · c8c49917
      Mathias Krause 提交于
      If the socket is in state BT_CONNECT2 and BT_SK_DEFER_SETUP is set in
      the flags, sco_sock_recvmsg() returns early with 0 without updating the
      possibly set msg_namelen member. This, in turn, leads to a 128 byte
      kernel stack leak in net/socket.c.
      
      Fix this by updating msg_namelen in this case. For all other cases it
      will be handled in bt_sock_recvmsg().
      
      Cc: Marcel Holtmann <marcel@holtmann.org>
      Cc: Gustavo Padovan <gustavo@padovan.org>
      Cc: Johan Hedberg <johan.hedberg@gmail.com>
      Signed-off-by: NMathias Krause <minipli@googlemail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c8c49917