1. 05 3月, 2011 2 次提交
    • S
      libceph: fix msgr keepalive flag · e76661d0
      Sage Weil 提交于
      There was some broken keepalive code using a dead variable.  Shift to using
      the proper bit flag.
      Signed-off-by: NSage Weil <sage@newdream.net>
      e76661d0
    • S
      libceph: fix msgr backoff · 60bf8bf8
      Sage Weil 提交于
      With commit f363e45f we replaced a bunch of hacky workqueue mutual
      exclusion logic with the WQ_NON_REENTRANT flag.  One pieces of fallout is
      that the exponential backoff breaks in certain cases:
      
       * con_work attempts to connect.
       * we get an immediate failure, and the socket state change handler queues
         immediate work.
       * con_work calls con_fault, we decide to back off, but can't queue delayed
         work.
      
      In this case, we add a BACKOFF bit to make con_work reschedule delayed work
      next time it runs (which should be immediately).
      Signed-off-by: NSage Weil <sage@newdream.net>
      60bf8bf8
  2. 04 3月, 2011 2 次提交
    • S
      libceph: retry after authorization failure · 692d20f5
      Sage Weil 提交于
      If we mark the connection CLOSED we will give up trying to reconnect to
      this server instance.  That is appropriate for things like a protocol
      version mismatch that won't change until the server is restarted, at which
      point we'll get a new addr and reconnect.  An authorization failure like
      this is probably due to the server not properly rotating it's secret keys,
      however, and should be treated as transient so that the normal backoff and
      retry behavior kicks in.
      Signed-off-by: NSage Weil <sage@newdream.net>
      692d20f5
    • S
      libceph: fix handling of short returns from get_user_pages · 38815b78
      Sage Weil 提交于
      get_user_pages() can return fewer pages than we ask for.  We were returning
      a bogus pointer/error code in that case.  Instead, loop until we get all
      the pages we want or get an error we can return to the caller.
      Signed-off-by: NSage Weil <sage@newdream.net>
      38815b78
  3. 19 2月, 2011 3 次提交
  4. 15 2月, 2011 2 次提交
  5. 14 2月, 2011 2 次提交
  6. 12 2月, 2011 4 次提交
  7. 11 2月, 2011 1 次提交
  8. 10 2月, 2011 2 次提交
    • D
      x25: Do not reference freed memory. · 96642d42
      David S. Miller 提交于
      In x25_link_free(), we destroy 'nb' before dereferencing
      'nb->dev'.  Don't do this, because 'nb' might be freed
      by then.
      Reported-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Tested-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      96642d42
    • E
      mac80211: add missing locking in ieee80211_reconfig · a7b545f7
      Eliad Peller 提交于
      When suspending an associated system, and then resuming,
      the station vif is being reconfigured without taking the
      sdata->u.mgd.mtx lock, which results in the following warning:
      
      WARNING: at net/mac80211/mlme.c:101 ieee80211_ap_probereq_get+0x58/0xb8 [mac80211]()
      Modules linked in: wl12xx_sdio wl12xx firmware_class crc7 mac80211 cfg80211 [last unloaded: crc7]
      Backtrace:
      [<c005432c>] (dump_backtrace+0x0/0x118) from [<c0376e28>] (dump_stack+0x20/0x24)
       r7:00000000 r6:bf12d6ec r5:bf154aac r4:00000065
      [<c0376e08>] (dump_stack+0x0/0x24) from [<c0079104>] (warn_slowpath_common+0x5c/0x74)
      [<c00790a8>] (warn_slowpath_common+0x0/0x74) from [<c0079148>] (warn_slowpath_null+0x2c/0x34)
       r9:000024ff r8:cd006460 r7:00000001 r6:00000000 r5:00000000
      r4:cf1394a0
      [<c007911c>] (warn_slowpath_null+0x0/0x34) from [<bf12d6ec>] (ieee80211_ap_probereq_get+0x58/0xb8 [mac80211])
      [<bf12d694>] (ieee80211_ap_probereq_get+0x0/0xb8 [mac80211]) from [<bf19cd04>] (wl1271_cmd_build_ap_probe_req+0x30/0xf8 [wl12xx])
       r4:cd007440
      [<bf19ccd4>] (wl1271_cmd_build_ap_probe_req+0x0/0xf8 [wl12xx]) from [<bf1995f4>] (wl1271_op_bss_info_changed+0x4c4/0x808 [wl12xx])
       r5:cd007440 r4:000003b4
      [<bf199130>] (wl1271_op_bss_info_changed+0x0/0x808 [wl12xx]) from [<bf122168>] (ieee80211_bss_info_change_notify+0x1a4/0x1f8 [mac80211])
      [<bf121fc4>] (ieee80211_bss_info_change_notify+0x0/0x1f8 [mac80211]) from [<bf141e80>] (ieee80211_reconfig+0x4d0/0x668 [mac80211])
       r8:cf0eeea4 r7:cd00671c r6:00000000 r5:cd006460 r4:cf1394a0
      [<bf1419b0>] (ieee80211_reconfig+0x0/0x668 [mac80211]) from [<bf137dd4>] (ieee80211_resume+0x60/0x70 [mac80211])
      [<bf137d74>] (ieee80211_resume+0x0/0x70 [mac80211]) from [<bf0eb930>] (wiphy_resume+0x6c/0x7c [cfg80211])
       r5:cd006248 r4:cd006110
      [<bf0eb8c4>] (wiphy_resume+0x0/0x7c [cfg80211]) from [<c0241024>] (legacy_resume+0x38/0x70)
       r7:00000000 r6:00000000 r5:cd006248 r4:cd0062fc
      [<c0240fec>] (legacy_resume+0x0/0x70) from [<c0241478>] (device_resume+0x168/0x1a0)
       r8:c04ca8d8 r7:cd00627c r6:00000010 r5:cd006248 r4:cd0062fc
      [<c0241310>] (device_resume+0x0/0x1a0) from [<c0241600>] (dpm_resume_end+0xf8/0x3bc)
       r7:00000000 r6:00000005 r5:cd006248 r4:cd0062fc
      [<c0241508>] (dpm_resume_end+0x0/0x3bc) from [<c00b2a24>] (suspend_devices_and_enter+0x1b0/0x204)
      [<c00b2874>] (suspend_devices_and_enter+0x0/0x204) from [<c00b2b68>] (enter_state+0xf0/0x148)
       r7:c037e978 r6:00000003 r5:c043d807 r4:00000000
      [<c00b2a78>] (enter_state+0x0/0x148) from [<c00b20a4>] (state_store+0xa4/0xcc)
       r7:c037e978 r6:00000003 r5:00000003 r4:c043d807
      [<c00b2000>] (state_store+0x0/0xcc) from [<c01fc90c>] (kobj_attr_store+0x20/0x24)
      [<c01fc8ec>] (kobj_attr_store+0x0/0x24) from [<c0157120>] (sysfs_write_file+0x11c/0x150)
      [<c0157004>] (sysfs_write_file+0x0/0x150) from [<c0100f84>] (vfs_write+0xc0/0x14c)
      [<c0100ec4>] (vfs_write+0x0/0x14c) from [<c01010e4>] (sys_write+0x4c/0x78)
       r8:40126000 r7:00000004 r6:cf1a7c80 r5:00000000 r4:00000000
      [<c0101098>] (sys_write+0x0/0x78) from [<c00500c0>] (ret_fast_syscall+0x0/0x30)
       r8:c00502c8 r7:00000004 r6:403525e8 r5:40126000 r4:00000004
      Signed-off-by: NEliad Peller <eliad@wizery.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      a7b545f7
  9. 09 2月, 2011 3 次提交
    • P
      netfilter: nf_conntrack: set conntrack templates again if we return NF_REPEAT · c3174286
      Pablo Neira Ayuso 提交于
      The TCP tracking code has a special case that allows to return
      NF_REPEAT if we receive a new SYN packet while in TIME_WAIT state.
      
      In this situation, the TCP tracking code destroys the existing
      conntrack to start a new clean session.
      
      [DESTROY] tcp      6 src=192.168.0.2 dst=192.168.1.2 sport=38925 dport=8000 src=192.168.1.2 dst=192.168.1.100 sport=8000 dport=38925 [ASSURED]
          [NEW] tcp      6 120 SYN_SENT src=192.168.0.2 dst=192.168.1.2 sport=38925 dport=8000 [UNREPLIED] src=192.168.1.2 dst=192.168.1.100 sport=8000 dport=38925
      
      However, this is a problem for the iptables' CT target event filtering
      which will not work in this case since the conntrack template will not
      be there for the new session. To fix this, we reassign the conntrack
      template to the packet if we return NF_REPEAT.
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      c3174286
    • D
      net: Fix lockdep regression caused by initializing netdev queues too early. · 8d3bdbd5
      David S. Miller 提交于
      In commit aa942104 ("net: init ingress
      queue") we moved the allocation and lock initialization of the queues
      into alloc_netdev_mq() since register_netdevice() is way too late.
      
      The problem is that dev->type is not setup until the setup()
      callback is invoked by alloc_netdev_mq(), and the dev->type is
      what determines the lockdep class to use for the locks in the
      queues.
      
      Fix this by doing the queue allocation after the setup() callback
      runs.
      
      This is safe because the setup() callback is not allowed to make any
      state changes that need to be undone on error (memory allocations,
      etc.).  It may, however, make state changes that are undone by
      free_netdev() (such as netif_napi_add(), which is done by the
      ipoib driver's setup routine).
      
      The previous code also leaked a reference to the &init_net namespace
      object on RX/TX queue allocation failures.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8d3bdbd5
    • D
      net/caif: Fix dangling list pointer in freed object on error. · b2df5a84
      David S. Miller 提交于
      rtnl_link_ops->setup(), and the "setup" callback passed to alloc_netdev*(),
      cannot make state changes which need to be undone on failure.  There is
      no cleanup mechanism available at this point.
      
      So we have to add the caif private instance to the global list once we
      are sure that register_netdev() has succedded in ->newlink().
      
      Otherwise, if register_netdev() fails, the caller will invoke free_netdev()
      and we will have a reference to freed up memory on the chnl_net_list.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b2df5a84
  10. 08 2月, 2011 3 次提交
  11. 05 2月, 2011 1 次提交
  12. 04 2月, 2011 3 次提交
  13. 03 2月, 2011 2 次提交
    • A
      gro: reset skb_iif on reuse · 6d152e23
      Andy Gospodarek 提交于
      Like Herbert's change from a few days ago:
      
      66c46d74 gro: Reset dev pointer on reuse
      
      this may not be necessary at this point, but we should still clean up
      the skb->skb_iif.  If not we may end up with an invalid valid for
      skb->skb_iif when the skb is reused and the check is done in
      __netif_receive_skb.
      Signed-off-by: NAndy Gospodarek <andy@greyhouse.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6d152e23
    • J
      mac80211: fix TX status cookie in HW offload case · 4334ec85
      Johannes Berg 提交于
      When the off-channel TX is done with remain-on-channel
      offloaded to hardware, the reported cookie is wrong as
      in that case we shouldn't use the SKB as the cookie but
      need to instead use the corresponding r-o-c cookie
      (XOR'ed with 2 to prevent API mismatches).
      
      Fix this by keeping track of the hw_roc_skb pointer
      just for the status processing and use the correct
      cookie to report in this case. We can't use the
      hw_roc_skb pointer itself because it is NULL'ed when
      the frame is transmitted to prevent it being used
      twice.
      
      This fixes a bug where the P2P state machine in the
      supplicant gets stuck because it never gets a correct
      result for its transmitted frame.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      4334ec85
  14. 02 2月, 2011 1 次提交
    • B
      Bluetooth: Set conn state to BT_DISCONN to avoid multiple responses · e733fb62
      Bao Liang 提交于
      This patch fixes a minor issue that two connection responses will be sent
      for one L2CAP connection request. If the L2CAP connection request is first
      blocked due to security reason and responded with reason "security block",
      the state of the connection remains BT_CONNECT2. If a pairing procedure
      completes successfully before the ACL connection is down, local host will
      send another connection complete response. See the following packets
      captured by hcidump.
      
      2010-12-07 22:21:24.928096 < ACL data: handle 12 flags 0x00 dlen 16
          0000: 0c 00 01 00 03 19 08 00  41 00 53 00 03 00 00 00  ........A.S.....
      ... ...
      
      2010-12-07 22:21:35.791747 > HCI Event: Auth Complete (0x06) plen 3
          status 0x00 handle 12
      ... ...
      
      2010-12-07 22:21:35.872372 > ACL data: handle 12 flags 0x02 dlen 16
          L2CAP(s): Connect rsp: dcid 0x0054 scid 0x0040 result 0 status 0
            Connection successful
      Signed-off-by: NLiang Bao <tim.bao@gmail.com>
      Acked-by: NVille Tervo <ville.tervo@nokia.com>
      Signed-off-by: NGustavo F. Padovan <padovan@profusion.mobi>
      e733fb62
  15. 01 2月, 2011 5 次提交
    • P
      netfilter: ecache: always set events bits, filter them later · 3db7e93d
      Pablo Neira Ayuso 提交于
      For the following rule:
      
      iptables -I PREROUTING -t raw -j CT --ctevents assured
      
      The event delivered looks like the following:
      
       [UPDATE] tcp      6 src=192.168.0.2 dst=192.168.1.2 sport=37041 dport=80 src=192.168.1.2 dst=192.168.1.100 sport=80 dport=37041 [ASSURED]
      
      Note that the TCP protocol state is not included. For that reason
      the CT event filtering is not very useful for conntrackd.
      
      To resolve this issue, instead of conditionally setting the CT events
      bits based on the ctmask, we always set them and perform the filtering
      in the late stage, just before the delivery.
      
      Thus, the event delivered looks like the following:
      
       [UPDATE] tcp      6 432000 ESTABLISHED src=192.168.0.2 dst=192.168.1.2 sport=37041 dport=80 src=192.168.1.2 dst=192.168.1.100 sport=80 dport=37041 [ASSURED]
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      3db7e93d
    • P
      netfilter: arpt_mangle: fix return values of checkentry · 9d0db8b6
      Pablo Neira Ayuso 提交于
      In 135367b8 "netfilter: xtables: change xt_target.checkentry return type",
      the type returned by checkentry was changed from boolean to int, but the
      return values where not adjusted.
      
      arptables: Input/output error
      
      This broke arptables with the mangle target since it returns true
      under success, which is interpreted by xtables as >0, thus
      returning EIO.
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      9d0db8b6
    • E
      net: Fix ipv6 neighbour unregister_sysctl_table warning · bf36076a
      Eric W. Biederman 提交于
      In my testing of 2.6.37 I was occassionally getting a warning about
      sysctl table entries being unregistered in the wrong order.  Digging
      in it turns out this dates back to the last great sysctl reorg done
      where Al Viro introduced the requirement that sysctl directories
      needed to be created before and destroyed after the files in them.
      
      It turns out that in that great reorg /proc/sys/net/ipv6/neigh was
      overlooked.  So this patch fixes that oversight and makes an annoying
      warning message go away.
      
      >------------[ cut here ]------------
      >WARNING: at kernel/sysctl.c:1992 unregister_sysctl_table+0x134/0x164()
      >Pid: 23951, comm: kworker/u:3 Not tainted 2.6.37-350888.2010AroraKernelBeta.fc14.x86_64 #1
      >Call Trace:
      > [<ffffffff8103e034>] warn_slowpath_common+0x80/0x98
      > [<ffffffff8103e061>] warn_slowpath_null+0x15/0x17
      > [<ffffffff810452f8>] unregister_sysctl_table+0x134/0x164
      > [<ffffffff810e7834>] ? kfree+0xc4/0xd1
      > [<ffffffff813439b2>] neigh_sysctl_unregister+0x22/0x3a
      > [<ffffffffa02cd14e>] addrconf_ifdown+0x33f/0x37b [ipv6]
      > [<ffffffff81331ec2>] ? skb_dequeue+0x5f/0x6b
      > [<ffffffffa02ce4a5>] addrconf_notify+0x69b/0x75c [ipv6]
      > [<ffffffffa02eb953>] ? ip6mr_device_event+0x98/0xa9 [ipv6]
      > [<ffffffff813d2413>] notifier_call_chain+0x32/0x5e
      > [<ffffffff8105bdea>] raw_notifier_call_chain+0xf/0x11
      > [<ffffffff8133cdac>] call_netdevice_notifiers+0x45/0x4a
      > [<ffffffff8133d2b0>] rollback_registered_many+0x118/0x201
      > [<ffffffff8133d3af>] unregister_netdevice_many+0x16/0x6d
      > [<ffffffff8133d571>] default_device_exit_batch+0xa4/0xb8
      > [<ffffffff81337c42>] ? cleanup_net+0x0/0x194
      > [<ffffffff81337a2a>] ops_exit_list+0x4e/0x56
      > [<ffffffff81337d36>] cleanup_net+0xf4/0x194
      > [<ffffffff81053318>] process_one_work+0x187/0x280
      > [<ffffffff8105441b>] worker_thread+0xff/0x19f
      > [<ffffffff8105431c>] ? worker_thread+0x0/0x19f
      > [<ffffffff8105776d>] kthread+0x7d/0x85
      > [<ffffffff81003824>] kernel_thread_helper+0x4/0x10
      > [<ffffffff810576f0>] ? kthread+0x0/0x85
      > [<ffffffff81003820>] ? kernel_thread_helper+0x0/0x10
      >---[ end trace 8a7e9310b35e9486 ]---
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bf36076a
    • T
      net: Check rps_flow_table when RPS map length is 1 · 85875236
      Tom Herbert 提交于
      In get_rps_cpu, add check that the rps_flow_table for the device is
      NULL when trying to take fast path when RPS map length is one.
      Without this, RFS is effectively disabled if map length is one which
      is not correct.
      Signed-off-by: NTom Herbert <therbert@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      85875236
    • R
      net: Add default_mtu() methods to blackhole dst_ops · ec831ea7
      Roland Dreier 提交于
      When an IPSEC SA is still being set up, __xfrm_lookup() will return
      -EREMOTE and so ip_route_output_flow() will return a blackhole route.
      This can happen in a sndmsg call, and after d33e4553 ("net: Abstract
      default MTU metric calculation behind an accessor.") this leads to a
      crash in ip_append_data() because the blackhole dst_ops have no
      default_mtu() method and so dst_mtu() calls a NULL pointer.
      
      Fix this by adding default_mtu() methods (that simply return 0, matching
      the old behavior) to the blackhole dst_ops.
      
      The IPv4 part of this patch fixes a crash that I saw when using an IPSEC
      VPN; the IPv6 part is untested because I don't have an IPv6 VPN, but it
      looks to be needed as well.
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ec831ea7
  16. 30 1月, 2011 4 次提交
    • S
      batman-adv: Make vis info stack traversal threadsafe · 1181e1da
      Sven Eckelmann 提交于
      The batman-adv vis server has to a stack which stores all information
      about packets which should be send later. This stack is protected
      with a spinlock that is used to prevent concurrent write access to it.
      
      The send_vis_packets function has to take all elements from the stack
      and send them to other hosts over the primary interface. The send will
      be initiated without the lock which protects the stack.
      
      The implementation using list_for_each_entry_safe has the problem that
      it stores the next element as "safe ptr" to allow the deletion of the
      current element in the list. The list may be modified during the
      unlock/lock pair in the loop body which may make the safe pointer
      not pointing to correct next element.
      
      It is safer to remove and use the first element from the stack until no
      elements are available. This does not need reduntant information which
      would have to be validated each time the lock was removed.
      Reported-by: NRussell Senior <russell@personaltelco.net>
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      1181e1da
    • S
      batman-adv: Remove vis info element in free_info · dda9fc6b
      Sven Eckelmann 提交于
      The free_info function will be called when no reference to the info
      object exists anymore. It must be ensured that the allocated memory
      gets freed and not only the elements which are managed by the info
      object.
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      dda9fc6b
    • S
      batman-adv: Remove vis info on hashing errors · 2674c158
      Sven Eckelmann 提交于
      A newly created vis info object must be removed when it couldn't be
      added to the hash. The old_info which has to be replaced was already
      removed and isn't related to the hash anymore.
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      2674c158
    • E
      net: Add compat ioctl support for the ipv4 multicast ioctl SIOCGETSGCNT · 709b46e8
      Eric W. Biederman 提交于
      SIOCGETSGCNT is not a unique ioctl value as it it maps tio SIOCPROTOPRIVATE +1,
      which unfortunately means the existing infrastructure for compat networking
      ioctls is insufficient.  A trivial compact ioctl implementation would conflict
      with:
      
      SIOCAX25ADDUID
      SIOCAIPXPRISLT
      SIOCGETSGCNT_IN6
      SIOCGETSGCNT
      SIOCRSSCAUSE
      SIOCX25SSUBSCRIP
      SIOCX25SDTEFACILITIES
      
      To make this work I have updated the compat_ioctl decode path to mirror the
      the normal ioctl decode path.  I have added an ipv4 inet_compat_ioctl function
      so that I can have ipv4 specific compat ioctls.   I have added a compat_ioctl
      function into struct proto so I can break out ioctls by which kind of ip socket
      I am using.  I have added a compat_raw_ioctl function because SIOCGETSGCNT only
      works on raw sockets.  I have added a ipmr_compat_ioctl that mirrors the normal
      ipmr_ioctl.
      
      This was necessary because unfortunately the struct layout for the SIOCGETSGCNT
      has unsigned longs in it so changes between 32bit and 64bit kernels.
      
      This change was sufficient to run a 32bit ip multicast routing daemon on a
      64bit kernel.
      Reported-by: NBill Fenner <fenner@aristanetworks.com>
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      709b46e8