1. 24 11月, 2014 1 次提交
  2. 06 5月, 2014 1 次提交
  3. 21 11月, 2013 1 次提交
    • H
      net: rework recvmsg handler msg_name and msg_namelen logic · f3d33426
      Hannes Frederic Sowa 提交于
      This patch now always passes msg->msg_namelen as 0. recvmsg handlers must
      set msg_namelen to the proper size <= sizeof(struct sockaddr_storage)
      to return msg_name to the user.
      
      This prevents numerous uninitialized memory leaks we had in the
      recvmsg handlers and makes it harder for new code to accidentally leak
      uninitialized memory.
      
      Optimize for the case recvfrom is called with NULL as address. We don't
      need to copy the address at all, so set it to NULL before invoking the
      recvmsg handler. We can do so, because all the recvmsg handlers must
      cope with the case a plain read() is called on them. read() also sets
      msg_name to NULL.
      
      Also document these changes in include/linux/net.h as suggested by David
      Miller.
      
      Changes since RFC:
      
      Set msg->msg_name = NULL if user specified a NULL in msg_name but had a
      non-null msg_namelen in verify_iovec/verify_compat_iovec. This doesn't
      affect sendto as it would bail out earlier while trying to copy-in the
      address. It also more naturally reflects the logic by the callers of
      verify_iovec.
      
      With this change in place I could remove "
      if (!uaddr || msg_sys->msg_namelen == 0)
      	msg->msg_name = NULL
      ".
      
      This change does not alter the user visible error logic as we ignore
      msg_namelen as long as msg_name is NULL.
      
      Also remove two unnecessary curly brackets in ___sys_recvmsg and change
      comments to netdev style.
      
      Cc: David Miller <davem@davemloft.net>
      Suggested-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f3d33426
  4. 06 8月, 2013 1 次提交
  5. 28 7月, 2013 1 次提交
  6. 24 6月, 2013 2 次提交
  7. 25 4月, 2013 2 次提交
    • G
      VSOCK: Drop bogus __init annotation from vsock_init_tables() · 22ee3b57
      Geert Uytterhoeven 提交于
      If gcc (e.g. 4.1.2) decides not to inline vsock_init_tables(), this will
      cause a section mismatch:
      
      WARNING: net/vmw_vsock/vsock.o(.text+0x1bc): Section mismatch in reference from the function __vsock_core_init() to the function .init.text:vsock_init_tables()
      The function __vsock_core_init() references
      the function __init vsock_init_tables().
      This is often because __vsock_core_init lacks a __init
      annotation or the annotation of vsock_init_tables is wrong.
      
      This may cause crashes if VSOCKETS=y and VMWARE_VMCI_VSOCKETS=m.
      Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      22ee3b57
    • A
      VSOCK: Fix misc device registration · 6ad0b2f7
      Asias He 提交于
      When we call vsock_core_init to init VSOCK the second time,
      vsock_device.minor still points to the old dynamically allocated minor
      number. misc_register will allocate it for us successfully as if we were
      asking for a static one. However, when other user call misc_register to
      allocate a dynamic minor number, it will give the one used by
      vsock_core_init(), causing this:
      
        [  405.470687] WARNING: at fs/sysfs/dir.c:536 sysfs_add_one+0xcc/0xf0()
        [  405.470689] Hardware name: OptiPlex 790
        [  405.470690] sysfs: cannot create duplicate filename '/dev/char/10:54'
      
      Always set vsock_device.minor to MISC_DYNAMIC_MINOR before we
      register.
      
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Andy King <acking@vmware.com>
      Cc: Dmitry Torokhov <dtor@vmware.com>
      Cc: Reilly Grant <grantr@vmware.com>
      Cc: netdev@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NAsias He <asias@redhat.com>
      Acked-by: NDmitry Torokhov <dtor@vmware.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6ad0b2f7
  8. 08 4月, 2013 1 次提交
  9. 03 4月, 2013 1 次提交
  10. 19 2月, 2013 3 次提交
  11. 11 2月, 2013 1 次提交
    • A
      VSOCK: Introduce VM Sockets · d021c344
      Andy King 提交于
      VM Sockets allows communication between virtual machines and the hypervisor.
      User level applications both in a virtual machine and on the host can use the
      VM Sockets API, which facilitates fast and efficient communication between
      guest virtual machines and their host.  A socket address family, designed to be
      compatible with UDP and TCP at the interface level, is provided.
      
      Today, VM Sockets is used by various VMware Tools components inside the guest
      for zero-config, network-less access to VMware host services.  In addition to
      this, VMware's users are using VM Sockets for various applications, where
      network access of the virtual machine is restricted or non-existent.  Examples
      of this are VMs communicating with device proxies for proprietary hardware
      running as host applications and automated testing of applications running
      within virtual machines.
      
      The VMware VM Sockets are similar to other socket types, like Berkeley UNIX
      socket interface.  The VM Sockets module supports both connection-oriented
      stream sockets like TCP, and connectionless datagram sockets like UDP. The VM
      Sockets protocol family is defined as "AF_VSOCK" and the socket operations
      split for SOCK_DGRAM and SOCK_STREAM.
      
      For additional information about the use of VM Sockets, please refer to the
      VM Sockets Programming Guide available at:
      
      https://www.vmware.com/support/developer/vmci-sdk/Signed-off-by: NGeorge Zhang <georgezhang@vmware.com>
      Signed-off-by: NDmitry Torokhov <dtor@vmware.com>
      Signed-off-by: NAndy king <acking@vmware.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d021c344