1. 18 7月, 2009 5 次提交
  2. 17 7月, 2009 11 次提交
  3. 16 7月, 2009 5 次提交
  4. 15 7月, 2009 8 次提交
    • J
      net/compat/wext: send different messages to compat tasks · 1dacc76d
      Johannes Berg 提交于
      Wireless extensions have the unfortunate problem that events
      are multicast netlink messages, and are not independent of
      pointer size. Thus, currently 32-bit tasks on 64-bit platforms
      cannot properly receive events and fail with all kinds of
      strange problems, for instance wpa_supplicant never notices
      disassociations, due to the way the 64-bit event looks (to a
      32-bit process), the fact that the address is all zeroes is
      lost, it thinks instead it is 00:00:00:00:01:00.
      
      The same problem existed with the ioctls, until David Miller
      fixed those some time ago in an heroic effort.
      
      A different problem caused by this is that we cannot send the
      ASSOCREQIE/ASSOCRESPIE events because sending them causes a
      32-bit wpa_supplicant on a 64-bit system to overwrite its
      internal information, which is worse than it not getting the
      information at all -- so we currently resort to sending a
      custom string event that it then parses. This, however, has a
      severe size limitation we are frequently hitting with modern
      access points; this limitation would can be lifted after this
      patch by sending the correct binary, not custom, event.
      
      A similar problem apparently happens for some other netlink
      users on x86_64 with 32-bit tasks due to the alignment for
      64-bit quantities.
      
      In order to fix these problems, I have implemented a way to
      send compat messages to tasks. When sending an event, we send
      the non-compat event data together with a compat event data in
      skb_shinfo(main_skb)->frag_list. Then, when the event is read
      from the socket, the netlink code makes sure to pass out only
      the skb that is compatible with the task. This approach was
      suggested by David Miller, my original approach required
      always sending two skbs but that had various small problems.
      
      To determine whether compat is needed or not, I have used the
      MSG_CMSG_COMPAT flag, and adjusted the call path for recv and
      recvfrom to include it, even if those calls do not have a cmsg
      parameter.
      
      I have not solved one small part of the problem, and I don't
      think it is necessary to: if a 32-bit application uses read()
      rather than any form of recvmsg() it will still get the wrong
      (64-bit) event. However, neither do applications actually do
      this, nor would it be a regression.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1dacc76d
    • J
      wext: optimise, comment and fix event sending · 4f45b2cd
      Johannes Berg 提交于
      The current function for sending events first allocates the
      event stream buffer, and then an skb to copy the event stream
      into. This can be done in one go. Also, the current function
      leaks kernel data to userspace in a 4 uninitialised bytes,
      initialise those explicitly. Finally also add a few useful
      comments, as opposed to the current comments.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4f45b2cd
    • J
      wireless extensions: make netns aware · b333b3d2
      Johannes Berg 提交于
      This makes wireless extensions netns aware. The
      tasklet sending the events is converted to a work
      struct so that we can rtnl_lock() in it.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b333b3d2
    • D
      Revert "NET: Fix locking issues in PPP, 6pack, mkiss and strip line disciplines." · 252aa9d9
      David S. Miller 提交于
      This reverts commit adeab1af.
      
      As Alan Cox explained, the TTY layer changes that went recently
      to get rid of the tty->low_latency stuff fixes this already,
      and even for -stable it's the ->low_latency changes that should
      go in to fix this, rather than this patch.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      252aa9d9
    • T
      skbuff.h: Fix comment for NET_IP_ALIGN · 8660c124
      Tobias Klauser 提交于
      Use the correct function call for skb_reserve in the comment for
      NET_IP_ALIGN.
      Signed-off-by: NTobias Klauser <klto@zhaw.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8660c124
    • D
      drivers/net: using spin_lock_irqsave() in net_send_packet() · 79fbe134
      Dongdong Deng 提交于
      spin_unlock_irq() will enable interrupt in net_send_packet(),
      this patch changes it to spin_lock_irqsave/spin_lock_irqrestore,
      so that it doesn't enable interrupts when already disabled,
      and netconsole would work properly over cs89x0/isa-skeleton.
      
      Call trace:
      netconsole write_msg()
      {
       ...
       -> spin_lock_irqsave();
              -> netpoll_send_udp()
                -> netpoll_send_skb()
                  -> net_send_packet()
                    ->...
      
       -> spin_unlock_irqrestore();
       ...
      }
      Signed-off-by: NDongdong Deng <dongdong.deng@windriver.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      79fbe134
    • J
      NET: phy_device, fix lock imbalance · bc23283c
      Jiri Slaby 提交于
      Don't forget to unlock a mutex in phy_scan_fixups on a fail path.
      Signed-off-by: NJiri Slaby <jirislaby@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bc23283c
    • A
      gre: fix ToS/DiffServ inherit bug · ee686ca9
      Andreas Jaggi 提交于
      Fixes two bugs:
      - ToS/DiffServ inheritance was unintentionally activated when using impair fixed ToS values
      - ECN bit was lost during ToS/DiffServ inheritance
      Signed-off-by: NAndreas Jaggi <aj@open.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ee686ca9
  5. 14 7月, 2009 3 次提交
  6. 13 7月, 2009 8 次提交
    • R
      NET: Fix locking issues in PPP, 6pack, mkiss and strip line disciplines. · adeab1af
      Ralf Baechle 提交于
      Guido Trentalancia reports:
      
      I am trying to use the kiss driver in the Linux kernel that is being
      shipped with Fedora 10 but unfortunately I get the following oops:
      
      mkiss: AX.25 Multikiss, Hans Albas PE1AYX
      mkiss: ax0: crc mode is auto.
      ADDRCONF(NETDEV_CHANGE): ax0: link becomes ready
      ------------[ cut here ]------------
      WARNING: at kernel/softirq.c:77 __local_bh_disable+0x2f/0x83() (Not
      tainted)
      [...]
      unloaded: microcode]
      Pid: 0, comm: swapper Not tainted 2.6.27.25-170.2.72.fc10.i686 #1
       [<c042ddfb>] warn_on_slowpath+0x65/0x8b
       [<c06ab62b>] ? _spin_unlock_irqrestore+0x22/0x38
       [<c04228b4>] ? __enqueue_entity+0xe3/0xeb
       [<c042431e>] ? enqueue_entity+0x203/0x20b
       [<c0424361>] ? enqueue_task_fair+0x3b/0x3f
       [<c041f88c>] ? resched_task+0x3a/0x6e
       [<c06ab62b>] ? _spin_unlock_irqrestore+0x22/0x38
       [<c06ab4e2>] ? _spin_lock_bh+0xb/0x16
       [<c043255b>] __local_bh_disable+0x2f/0x83
       [<c04325ba>] local_bh_disable+0xb/0xd
       [<c06ab4e2>] _spin_lock_bh+0xb/0x16
       [<f8b6f600>] mkiss_receive_buf+0x2fb/0x3a6 [mkiss]
       [<c0572a30>] flush_to_ldisc+0xf7/0x198
       [<c0572b12>] tty_flip_buffer_push+0x41/0x51
       [<f89477f2>] ftdi_process_read+0x375/0x4ad [ftdi_sio]
       [<f8947a5a>] ftdi_read_bulk_callback+0x130/0x138 [ftdi_sio]
       [<c05d4bec>] usb_hcd_giveback_urb+0x63/0x93
       [<c05ea290>] uhci_giveback_urb+0xe5/0x15f
       [<c05eaabf>] uhci_scan_schedule+0x52e/0x767
       [<c05f6288>] ? psmouse_handle_byte+0xc/0xe5
       [<c054df78>] ? acpi_ev_gpe_detect+0xd6/0xe1
       [<c05ec5b0>] uhci_irq+0x110/0x125
       [<c05d4834>] usb_hcd_irq+0x40/0xa3
       [<c0465313>] handle_IRQ_event+0x2f/0x64
       [<c046642b>] handle_level_irq+0x74/0xbe
       [<c04663b7>] ? handle_level_irq+0x0/0xbe
       [<c0406e6e>] do_IRQ+0xc7/0xfe
       [<c0405668>] common_interrupt+0x28/0x30
       [<c056821a>] ? acpi_idle_enter_simple+0x162/0x19d
       [<c0617f52>] cpuidle_idle_call+0x60/0x92
       [<c0403c61>] cpu_idle+0x101/0x134
       [<c069b1ba>] rest_init+0x4e/0x50
       =======================
      ---[ end trace b7cc8076093467ad ]---
      ------------[ cut here ]------------
      WARNING: at kernel/softirq.c:136 _local_bh_enable_ip+0x3d/0xc4()
      [...]
      Pid: 0, comm: swapper Tainted: G        W 2.6.27.25-170.2.72.fc10.i686
       [<c042ddfb>] warn_on_slowpath+0x65/0x8b
       [<c06ab62b>] ? _spin_unlock_irqrestore+0x22/0x38
       [<c04228b4>] ? __enqueue_entity+0xe3/0xeb
       [<c042431e>] ? enqueue_entity+0x203/0x20b
       [<c0424361>] ? enqueue_task_fair+0x3b/0x3f
       [<c041f88c>] ? resched_task+0x3a/0x6e
       [<c06ab62b>] ? _spin_unlock_irqrestore+0x22/0x38
       [<c06ab4e2>] ? _spin_lock_bh+0xb/0x16
       [<f8b6f642>] ? mkiss_receive_buf+0x33d/0x3a6 [mkiss]
       [<c04325f9>] _local_bh_enable_ip+0x3d/0xc4
       [<c0432688>] local_bh_enable_ip+0x8/0xa
       [<c06ab54d>] _spin_unlock_bh+0x11/0x13
       [<f8b6f642>] mkiss_receive_buf+0x33d/0x3a6 [mkiss]
       [<c0572a30>] flush_to_ldisc+0xf7/0x198
       [<c0572b12>] tty_flip_buffer_push+0x41/0x51
       [<f89477f2>] ftdi_process_read+0x375/0x4ad [ftdi_sio]
       [<f8947a5a>] ftdi_read_bulk_callback+0x130/0x138 [ftdi_sio]
       [<c05d4bec>] usb_hcd_giveback_urb+0x63/0x93
       [<c05ea290>] uhci_giveback_urb+0xe5/0x15f
       [<c05eaabf>] uhci_scan_schedule+0x52e/0x767
       [<c05f6288>] ? psmouse_handle_byte+0xc/0xe5
       [<c054df78>] ? acpi_ev_gpe_detect+0xd6/0xe1
       [<c05ec5b0>] uhci_irq+0x110/0x125
       [<c05d4834>] usb_hcd_irq+0x40/0xa3
       [<c0465313>] handle_IRQ_event+0x2f/0x64
       [<c046642b>] handle_level_irq+0x74/0xbe
       [<c04663b7>] ? handle_level_irq+0x0/0xbe
       [<c0406e6e>] do_IRQ+0xc7/0xfe
       [<c0405668>] common_interrupt+0x28/0x30
       [<c056821a>] ? acpi_idle_enter_simple+0x162/0x19d
       [<c0617f52>] cpuidle_idle_call+0x60/0x92
       [<c0403c61>] cpu_idle+0x101/0x134
       [<c069b1ba>] rest_init+0x4e/0x50
       =======================
      ---[ end trace b7cc8076093467ad ]---
      mkiss: ax0: Trying crc-smack
      mkiss: ax0: Trying crc-flexnet
      
      The issue was, that the locking code in mkiss was assuming it was only
      ever being called in process or bh context.  Fixed by converting the
      involved locking code to use irq-safe locks.
      
      Review of other networking line disciplines shows that 6pack, both sync
      and async PPP and STRIP have similar issues.  The ppp_async one is the
      most interesting one as it sorts out half of the issue as far back as
      2004 in commit http://git.kernel.org/?p=linux/kernel/git/tglx/history.git;a=commitdiff;h=2996d8deaeddd01820691a872550dc0cfba0c37dSigned-off-by: NRalf Baechle <ralf@linux-mips.org>
      Reported-by: NGuido Trentalancia <guido@trentalancia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      adeab1af
    • J
      drivers/net/bonding: Adjust constant name · 8e321c4f
      Julia Lawall 提交于
      AD_SHORT_TIMEOUT and AD_STATE_LACP_ACTIVITY have the same value, but
      AD_STATE_LACP_ACTIVITY better reflects the intended semantics.
      
      [ J adds: AD_STATE_LACP_ACTIVITY is a value defined by the standard, and
      should be set here in accordance with 802.3ad 43.4.12; AD_SHORT_TIMEOUT
      is a constant specific to the Linux 802.3ad implementation that happens
      to have the same value ]
      
      The semantic match that finds this problem is as follows:
      (http://www.emn.fr/x-info/coccinelle/)
      
      // <smpl>
      @@
      struct port_params p;
      @@
      * p.port_state |= AD_SHORT_TIMEOUT
      // </smpl>
      Signed-off-by: NJulia Lawall <julia@diku.dk>
      Signed-off-by: NJay Vosburgh <fubar@us.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8e321c4f
    • H
      dropmon: remove duplicated #include · 440c1ce1
      Huang Weiyi 提交于
      Remove duplicated #include('s) in
        include/linux/net_dropmon.h
      Signed-off-by: NHuang Weiyi <weiyi.huang@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      440c1ce1
    • C
      net: remove redundant sched/ in net/Makefile · df5ede82
      Changli Gao 提交于
      Remove redundant sched/ in net/Makefile.
      
      sched/ is contained in previous:
      obj-$(CONFIG_NET) += ethernet/ 802/ sched/ netlink/,
      so the later
      obj-$(CONFIG_NET_SCHED) += sched/
      isn't necessary.
      Signed-off-by: NChangli Gao <xiaosuo@gmail.com>
      ----
      Makefile | 1 -
      1 file changed, 1 deletion(-)
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      df5ede82
    • S
      udpv6: Handle large incoming UDP/IPv6 packets and support software UFO · ba735425
      Sridhar Samudrala 提交于
      - validate and forward GSO UDP/IPv6 packets from untrusted sources.
      - do software UFO if the outgoing device doesn't support UFO.
      Signed-off-by: NSridhar Samudrala <sri@us.ibm.com>
      Acked-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ba735425
    • S
      udpv6: Remove unused skb argument of ipv6_select_ident() · 7ea2f2c5
      Sridhar Samudrala 提交于
      - move ipv6_select_ident() inline function to ipv6.h and remove the unused
        skb argument
      Signed-off-by: NSridhar Samudrala <sri@us.ibm.com>
      Acked-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7ea2f2c5
    • S
      udpv6: Fix gso_size setting in ip6_ufo_append_data · c31d5326
      Sridhar Samudrala 提交于
      - fix gso_size setting for ipv6 fragment to be a multiple of 8 bytes.
      Signed-off-by: NSridhar Samudrala <sri@us.ibm.com>
      Acked-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c31d5326
    • S
      udpv6: Fix HW checksum support for outgoing UFO packets · 493c6be3
      Sridhar Samudrala 提交于
      - add HW checksum support for outgoing large UDP/IPv6 packets destined for
        a UFO enabled device.
      Signed-off-by: NSridhar Samudrala <sri@us.ibm.com>
      Acked-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      493c6be3