1. 29 9月, 2011 2 次提交
    • S
      libceph: fix pg_temp mapping update · 8adc8b3d
      Sage Weil 提交于
      The incremental map updates have a record for each pg_temp mapping that is
      to be add/updated (len > 0) or removed (len == 0).  The old code was
      written as if the updates were a complete enumeration; that was just wrong.
      Update the code to remove 0-length entries and drop the rbtree traversal.
      
      This avoids misdirected (and hung) requests that manifest as server
      errors like
      
      [WRN] client4104 10.0.1.219:0/275025290 misdirected client4104.1:129 0.1 to osd0 not [1,0] in e11/11
      Signed-off-by: NSage Weil <sage@newdream.net>
      8adc8b3d
    • S
      libceph: fix pg_temp mapping calculation · 782e182e
      Sage Weil 提交于
      We need to apply the modulo pg_num calculation before looking up a pgid in
      the pg_temp mapping rbtree.  This fixes pg_temp mappings, and fixes
      (some) misdirected requests that result in messages like
      
      [WRN] client4104 10.0.1.219:0/275025290 misdirected client4104.1:129 0.1 to osd0 not [1,0] in e11/11
      
      on the server and stall make the client block without getting a reply (at
      least until the pg_temp mapping goes way, but that can take a long long
      time).
      
      Reorder calc_pg_raw() a bit to make more sense.
      Signed-off-by: NSage Weil <sage@newdream.net>
      782e182e
  2. 17 9月, 2011 3 次提交
  3. 01 9月, 2011 1 次提交
  4. 10 8月, 2011 1 次提交
    • S
      libceph: fix msgpool · 5185352c
      Sage Weil 提交于
      There were several problems here:
      
       1- we weren't tagging allocations with the pool, so they were never
          returned to the pool.
       2- msgpool_put didn't add back to the mempool, even it were called.
       3- msgpool_release didn't clear the pool pointer, so it would have looped
          had #1 not been broken.
      
      These may or may not have been responsible for #1136 or #1381 (BUG due to
      non-empty mempool on umount).  I can't seem to trigger the crash now using
      the method I was using before.
      Signed-off-by: NSage Weil <sage@newdream.net>
      5185352c
  5. 27 7月, 2011 1 次提交
  6. 20 7月, 2011 1 次提交
    • S
      ceph: fix file mode calculation · 38be7a79
      Sage Weil 提交于
      open(2) must always include one of O_RDONLY, O_WRONLY, or O_RDWR.  No need
      for any O_APPEND special case.
      
      Passing O_WRONLY|O_RDWR is undefined according to the man page, but the
      Linux VFS interprets this as O_RDWR, so we'll do the same.
      
      This fixes open(2) with flags O_RDWR|O_APPEND, which was incorrectly being
      translated to readonly.
      Reported-by: NFyodor Ustinov <ufm@ufm.su>
      Signed-off-by: NSage Weil <sage@newdream.net>
      38be7a79
  7. 17 7月, 2011 2 次提交
    • I
      Bluetooth: Fix crash with incoming L2CAP connections · 05e9a2f6
      Ilia Kolomisnky 提交于
      Another regression fix considering incomming l2cap connections with
      defer_setup enabled. In situations when incomming connection is
      extracted with l2cap_sock_accept, it's bt_sock info will have
      'parent' member zerroed, but 'parent' may be used unconditionally
      in l2cap_conn_start() and l2cap_security_cfm() when defer_setup
      is enabled.
      
      Backtrace:
      [<bf02d5ac>] (l2cap_security_cfm+0x0/0x2ac [bluetooth]) from [<bf01f01c>] (hci_event_pac
      ket+0xc2c/0x4aa4 [bluetooth])
      [<bf01e3f0>] (hci_event_packet+0x0/0x4aa4 [bluetooth]) from [<bf01a844>] (hci_rx_task+0x
      cc/0x27c [bluetooth])
      [<bf01a778>] (hci_rx_task+0x0/0x27c [bluetooth]) from [<c008eee4>] (tasklet_action+0xa0/
      0x15c)
      [<c008ee44>] (tasklet_action+0x0/0x15c) from [<c008f38c>] (__do_softirq+0x98/0x130)
       r7:00000101 r6:00000018 r5:00000001 r4:efc46000
      [<c008f2f4>] (__do_softirq+0x0/0x130) from [<c008f524>] (do_softirq+0x4c/0x58)
      [<c008f4d8>] (do_softirq+0x0/0x58) from [<c008f5e0>] (run_ksoftirqd+0xb0/0x1b4)
       r4:efc46000 r3:00000001
      [<c008f530>] (run_ksoftirqd+0x0/0x1b4) from [<c009f2a8>] (kthread+0x84/0x8c)
       r7:00000000 r6:c008f530 r5:efc47fc4 r4:efc41f08
      [<c009f224>] (kthread+0x0/0x8c) from [<c008cc84>] (do_exit+0x0/0x5f0)
      Signed-off-by: NIlia Kolomisnky <iliak@ti.com>
      Signed-off-by: NGustavo F. Padovan <padovan@profusion.mobi>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      05e9a2f6
    • G
      Bluetooth: Fix regression in L2CAP connection procedure · 9191e6ad
      Gustavo F. Padovan 提交于
      Caused by the following commit, partially revert it.
      
      commit 9fa7e4f7
      Author: Gustavo F. Padovan <padovan@profusion.mobi>
      Date:   Thu Jun 30 16:11:30 2011 -0300
      
          Bluetooth: Fix regression with incoming L2CAP connections
      
          PTS test A2DP/SRC/SRC_SET/TC_SRC_SET_BV_02_I revealed that
          ( probably after the df3c3931 commit ) the l2cap connection
          could not be established in case when the "Auth Complete" HCI
          event does not arive before the initiator send "Configuration
          request", in which case l2cap replies with "Command rejected"
          since the channel is still in BT_CONNECT2 state.
      Signed-off-by: NLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      Signed-off-by: NGustavo F. Padovan <padovan@profusion.mobi>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9191e6ad
  8. 15 7月, 2011 2 次提交
    • M
      net: remove NETIF_F_ALL_TX_OFFLOADS · 62f2a3a4
      Michał Mirosław 提交于
      There is no software fallback implemented for SCTP or FCoE checksumming,
      and so it should not be passed on by software devices like bridge or bonding.
      
      For VLAN devices, this is different. First, the driver for underlying device
      should be prepared to get offloaded packets even when the feature is disabled
      (especially if it advertises it in vlan_features). Second, devices under
      VLANs do not get replaced without tearing down the VLAN first.
      
      This fixes a mess I accidentally introduced while converting bonding to
      ndo_fix_features.
      
      NETIF_F_SOFT_FEATURES are removed from BOND_VLAN_FEATURES because they
      are unused as of commit 712ae51a.
      Signed-off-by: NMichał Mirosław <mirq-linux@rere.qmqm.pl>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      62f2a3a4
    • M
      net: sctp: fix checksum marking for outgoing packets · b73c43f8
      Michał Mirosław 提交于
      Packets to devices without NETIF_F_SCTP_CSUM (including NETIF_F_NO_CSUM)
      should be properly checksummed because the packets can be diverted or
      rerouted after construction. This still leaves packets diverted from
      NETIF_F_SCTP_CSUM-enabled devices with broken checksums. Fixing this
      needs implementing software offload fallback in networking core.
      
      For users of sctp_checksum_disable, skb->ip_summed should be left as
      CHECKSUM_NONE and not CHECKSUM_UNNECESSARY as per include/linux/skbuff.h.
      Signed-off-by: NMichał Mirosław <mirq-linux@rere.qmqm.pl>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b73c43f8
  9. 13 7月, 2011 1 次提交
  10. 09 7月, 2011 1 次提交
  11. 08 7月, 2011 5 次提交
    • T
      XFRM: Fix memory leak in xfrm_state_update · 8fcbc637
      Tushar Gohad 提交于
      Upon "ip xfrm state update ..", xfrm_add_sa() takes an extra reference on
      the user-supplied SA and forgets to drop the reference when
      xfrm_state_update() returns 0.  This leads to a memory leak as the
      parameter SA is never freed.  This change attempts to fix the leak by
      calling __xfrm_state_put() when xfrm_state_update() updates a valid SA
      (err = 0).  The parameter SA is added to the gc list when the final
      reference is dropped by xfrm_add_sa() upon completion.
      Signed-off-by: NTushar Gohad <tgohad@mvista.com>
      Acked-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8fcbc637
    • T
      SUNRPC: Fix a race between work-queue and rpc_killall_tasks · b55c5989
      Trond Myklebust 提交于
      Since rpc_killall_tasks may modify the rpc_task's tk_action field
      without any locking, we need to be careful when dereferencing it.
      Reported-by: NBen Greear <greearb@candelatech.com>
      Tested-by: NBen Greear <greearb@candelatech.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      Cc: stable@kernel.org
      b55c5989
    • T
      sctp: Enforce retransmission limit during shutdown · f8d96052
      Thomas Graf 提交于
      When initiating a graceful shutdown while having data chunks
      on the retransmission queue with a peer which is in zero
      window mode the shutdown is never completed because the
      retransmission error count is reset periodically by the
      following two rules:
      
       - Do not timeout association while doing zero window probe.
       - Reset overall error count when a heartbeat request has
         been acknowledged.
      
      The graceful shutdown will wait for all outstanding TSN to
      be acknowledged before sending the SHUTDOWN request. This
      never happens due to the peer's zero window not acknowledging
      the continuously retransmitted data chunks. Although the
      error counter is incremented for each failed retransmission,
      the receiving of the SACK announcing the zero window clears
      the error count again immediately. Also heartbeat requests
      continue to be sent periodically. The peer acknowledges these
      requests causing the error counter to be reset as well.
      
      This patch changes behaviour to only reset the overall error
      counter for the above rules while not in shutdown. After
      reaching the maximum number of retransmission attempts, the
      T5 shutdown guard timer is scheduled to give the receiver
      some additional time to recover. The timer is stopped as soon
      as the receiver acknowledges any data.
      
      The issue can be easily reproduced by establishing a sctp
      association over the loopback device, constantly queueing
      data at the sender while not reading any at the receiver.
      Wait for the window to reach zero, then initiate a shutdown
      by killing both processes simultaneously. The association
      will never be freed and the chunks on the retransmission
      queue will be retransmitted indefinitely.
      Signed-off-by: NThomas Graf <tgraf@infradead.org>
      Acked-by: NVlad Yasevich <vladislav.yasevich@hp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f8d96052
    • J
      mac80211: fix TKIP replay vulnerability · 34459512
      Johannes Berg 提交于
      Unlike CCMP, the presence or absence of the QoS
      field doesn't change the encryption, only the
      TID is used. When no QoS field is present, zero
      is used as the TID value. This means that it is
      possible for an attacker to take a QoS packet
      with TID 0 and replay it as a non-QoS packet.
      
      Unfortunately, mac80211 uses different IVs for
      checking the validity of the packet's TKIP IV
      when it checks TID 0 and when it checks non-QoS
      packets. This means it is vulnerable to this
      replay attack.
      
      To fix this, use the same replay counter for
      TID 0 and non-QoS packets by overriding the
      rx->queue value to 0 if it is 16 (non-QoS).
      
      This is a minimal fix for now. I caused this
      issue in
      
      commit 1411f9b5
      Author: Johannes Berg <johannes@sipsolutions.net>
      Date:   Thu Jul 10 10:11:02 2008 +0200
      
          mac80211: fix RX sequence number check
      
      while fixing a sequence number issue (there,
      a separate counter needs to be used).
      
      Cc: stable@kernel.org
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      34459512
    • L
      mac80211: fix ie memory allocation for scheduled scans · 1186980d
      Luciano Coelho 提交于
      We were not allocating memory for the IEs passed in the scheduled_scan
      request and this was causing memory corruption (buffer overflow).
      Signed-off-by: NLuciano Coelho <coelho@ti.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      1186980d
  12. 07 7月, 2011 2 次提交
  13. 06 7月, 2011 3 次提交
  14. 05 7月, 2011 1 次提交
    • M
      net: bind() fix error return on wrong address family · c349a528
      Marcus Meissner 提交于
      Hi,
      
      Reinhard Max also pointed out that the error should EAFNOSUPPORT according
      to POSIX.
      
      The Linux manpages have it as EINVAL, some other OSes (Minix, HPUX, perhaps BSD) use
      EAFNOSUPPORT. Windows uses WSAEFAULT according to MSDN.
      
      Other protocols error values in their af bind() methods in current mainline git as far
      as a brief look shows:
      	EAFNOSUPPORT: atm, appletalk, l2tp, llc, phonet, rxrpc
      	EINVAL: ax25, bluetooth, decnet, econet, ieee802154, iucv, netlink, netrom, packet, rds, rose, unix, x25,
      	No check?: can/raw, ipv6/raw, irda, l2tp/l2tp_ip
      
      Ciao, Marcus
      Signed-off-by: NMarcus Meissner <meissner@suse.de>
      Cc: Reinhard Max <max@suse.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c349a528
  15. 02 7月, 2011 5 次提交
  16. 01 7月, 2011 3 次提交
  17. 29 6月, 2011 2 次提交
    • J
      netfilter: Fix ip_route_me_harder triggering ip_rt_bug · ed6e4ef8
      Julian Anastasov 提交于
      	Avoid creating input routes with ip_route_me_harder.
      It does not work for locally generated packets. Instead,
      restrict sockets to provide valid saddr for output route (or
      unicast saddr for transparent proxy). For other traffic
      allow saddr to be unicast or local but if callers forget
      to check saddr type use 0 for the output route.
      
      	The resulting handling should be:
      
      - REJECT TCP:
      	- in INPUT we can provide addr_type = RTN_LOCAL but
      	better allow rejecting traffic delivered with
      	local route (no IP address => use RTN_UNSPEC to
      	allow also RTN_UNICAST).
      	- FORWARD: RTN_UNSPEC => allow RTN_LOCAL/RTN_UNICAST
      	saddr, add fix to ignore RTN_BROADCAST and RTN_MULTICAST
      	- OUTPUT: RTN_UNSPEC
      
      - NAT, mangle, ip_queue, nf_ip_reroute: RTN_UNSPEC in LOCAL_OUT
      
      - IPVS:
      	- use RTN_LOCAL in LOCAL_OUT and FORWARD after SNAT
      	to restrict saddr to be local
      Signed-off-by: NJulian Anastasov <ja@ssi.bg>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ed6e4ef8
    • D
      Bluetooth: Prevent buffer overflow in l2cap config request · 7ac28817
      Dan Rosenberg 提交于
      A remote user can provide a small value for the command size field in
      the command header of an l2cap configuration request, resulting in an
      integer underflow when subtracting the size of the configuration request
      header.  This results in copying a very large amount of data via
      memcpy() and destroying the kernel heap.  Check for underflow.
      Signed-off-by: NDan Rosenberg <drosenberg@vsecurity.com>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGustavo F. Padovan <padovan@profusion.mobi>
      7ac28817
  18. 28 6月, 2011 3 次提交
  19. 25 6月, 2011 1 次提交
    • H
      bridge: Only flood unregistered groups to routers · bd4265fe
      Herbert Xu 提交于
      The bridge currently floods packets to groups that we have never
      seen before to all ports.  This is not required by RFC4541 and
      in fact it is not desirable in environment where traffic to
      unregistered group is always present.
      
      This patch changes the behaviour so that we only send traffic
      to unregistered groups to ports marked as routers.
      
      The user can always force flooding behaviour to any given port
      by marking it as a router.
      
      Note that this change does not apply to traffic to 224.0.0.X
      as traffic to those groups must always be flooded to all ports.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bd4265fe