1. 20 7月, 2009 7 次提交
  2. 18 7月, 2009 11 次提交
  3. 17 7月, 2009 11 次提交
  4. 16 7月, 2009 5 次提交
  5. 15 7月, 2009 6 次提交
    • 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