1. 26 3月, 2012 4 次提交
  2. 24 3月, 2012 1 次提交
  3. 23 3月, 2012 4 次提交
    • O
      usbnet: consider device busy at each recieved packet · 8a783354
      Oliver Neukum 提交于
      usbnet should centrally handle busy reporting in the rx path
      so subdrivers need not worry. This hurts use cases which do
      rx only or predominantly.
      Signed-off-by: NOliver Neukum <oneukum@suse.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8a783354
    • A
      bonding: remove entries for master_ip and vlan_ip and query devices instead · eaddcd76
      Andy Gospodarek 提交于
      The following patch aimed to resolve an issue where secondary, tertiary,
      etc. addresses added to bond interfaces could overwrite the
      bond->master_ip and vlan_ip values.
      
              commit 917fbdb3
              Author: Henrik Saavedra Persson <henrik.e.persson@ericsson.com>
              Date:   Wed Nov 23 23:37:15 2011 +0000
      
                  bonding: only use primary address for ARP
      
      That patch was good because it prevented bonds using ARP monitoring from
      sending frames with an invalid source IP address.  Unfortunately, it
      didn't always work as expected.
      
      When using an ioctl (like ifconfig does) to set the IP address and
      netmask, 2 separate ioctls are actually called to set the IP and netmask
      if the mask chosen doesn't match the standard mask for that class of
      address.  The first ioctl did not have a mask that matched the one in
      the primary address and would still cause the device address to be
      overwritten.  The second ioctl that was called to set the mask would
      then detect as secondary and ignored, but the damage was already done.
      
      This was not an issue when using an application that used netlink
      sockets as the setting of IP and netmask came down at once.  The
      inconsistent behavior between those two interfaces was something that
      needed to be resolved.
      
      While I was thinking about how I wanted to resolve this, Ralf Zeidler
      came with a patch that resolved this on a RHEL kernel by keeping a full
      shadow of the entries in dev->ifa_list for the bonding device and vlan
      devices in the bonding driver.  I didn't like the duplication of the
      list as I want to see the 'bonding' struct and code shrink rather than
      grow, but liked the general idea.
      
      As the Subject indicates this patch drops the master_ip and vlan_ip
      elements from the 'bonding' and 'vlan_entry' structs, respectively.
      This can be done because a device's address-list is now traversed to
      determine the optimal source IP address for ARP requests and for checks
      to see if the bonding device has a particular IP address.  This code
      could have all be contained inside the bonding driver, but it made more
      sense to me to EXPORT and call inet_confirm_addr since it did exactly
      what was needed.
      
      I tested this and a backported patch and everything works as expected.
      Ralf also helped with verification of the backported patch.
      
      Thanks to Ralf for all his help on this.
      
      v2: Whitespace and organizational changes based on suggestions from Jay
      Vosburgh and Dave Miller.
      
      v3: Fixup incorrect usage of rcu_read_unlock based on Dave Miller's
      suggestion.
      Signed-off-by: NAndy Gospodarek <andy@greyhouse.net>
      CC: Ralf Zeidler <ralf.zeidler@nsn.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      eaddcd76
    • T
      usbnet: don't clear urb->dev in tx_complete · 5d5440a8
      tom.leiming@gmail.com 提交于
      URB unlinking is always racing with its completion and tx_complete
      may be called before or during running usb_unlink_urb, so tx_complete
      must not clear urb->dev since it will be used in unlink path,
      otherwise invalid memory accesses or usb device leak may be caused
      inside usb_unlink_urb.
      
      Cc: stable@kernel.org
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Oliver Neukum <oliver@neukum.org>
      Signed-off-by: NMing Lei <tom.leiming@gmail.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5d5440a8
    • T
      usbnet: increase URB reference count before usb_unlink_urb · 0956a8c2
      tom.leiming@gmail.com 提交于
      Commit 4231d47e(net/usbnet: avoid
      recursive locking in usbnet_stop()) fixes the recursive locking
      problem by releasing the skb queue lock, but it makes usb_unlink_urb
      racing with defer_bh, and the URB to being unlinked may be freed before
      or during calling usb_unlink_urb, so use-after-free problem may be
      triggerd inside usb_unlink_urb.
      
      The patch fixes the use-after-free problem by increasing URB
      reference count with skb queue lock held before calling
      usb_unlink_urb, so the URB won't be freed until return from
      usb_unlink_urb.
      
      Cc: stable@kernel.org
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Oliver Neukum <oliver@neukum.org>
      Reported-by: NDave Jones <davej@redhat.com>
      Signed-off-by: NMing Lei <tom.leiming@gmail.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0956a8c2
  4. 22 3月, 2012 3 次提交
  5. 20 3月, 2012 28 次提交