Merge lp:~rcj/ubuntu/wily/open-vm-tools/wily into lp:ubuntu/wily/open-vm-tools

Proposed by andrew blogg
Status: Rejected
Rejected by: Brian Murray
Proposed branch: lp:~rcj/ubuntu/wily/open-vm-tools/wily
Merge into: lp:ubuntu/wily/open-vm-tools
Diff against target: 385437 lines (+140485/-182457)
1170 files modified
.pc/0001-kvers.patch/modules/linux/vmblock/Makefile (+0/-171)
.pc/0001-kvers.patch/modules/linux/vmci/Makefile (+0/-171)
.pc/0001-kvers.patch/modules/linux/vmhgfs/Makefile (+0/-171)
.pc/0001-kvers.patch/modules/linux/vmsync/Makefile (+0/-171)
.pc/0001-kvers.patch/modules/linux/vmxnet/Makefile (+0/-171)
.pc/0001-kvers.patch/modules/linux/vsock/Makefile (+0/-171)
.pc/0002-dkms.patch/modules/linux/dkms.conf (+0/-39)
.pc/0004-vsock-cve.patch/modules/linux/vsock/linux/af_vsock.c (+0/-6081)
.pc/0005-dkms-vmci-remove.patch/modules/linux/dkms.conf (+0/-39)
.pc/0006-vmblock-fixes.patch/modules/linux/vmblock/linux/control.c (+0/-375)
.pc/0006-vmblock-fixes.patch/modules/linux/vmblock/linux/file.c (+0/-244)
.pc/0007-linux-311-vmhgfs-fix.patch/modules/linux/vmhgfs/inode.c (+0/-2187)
.pc/1a3eb34_Fix-AssertOnCompileFailed-for-GCC-4.8-kernel-3.10/lib/include/vm_assert.h (+0/-395)
.pc/1a3eb34_Fix-AssertOnCompileFailed-for-GCC-4.8-kernel-3.10/lib/include/vm_atomic.h (+0/-2674)
.pc/1a3eb34_Fix-AssertOnCompileFailed-for-GCC-4.8-kernel-3.10/lib/include/vm_basic_types.h (+0/-1056)
.pc/3a9f229_Harden-HostinfoOSData-against-PATH-attacks/lib/misc/hostinfoPosix.c (+0/-3597)
.pc/4a527c9_HGFS-Make-Linux-client-compile-on-kernels-3.11/modules/linux/vmhgfs/dir.c (+0/-1104)
.pc/530ef7f_OVT-do-not-build-vmblock-on-Linux-kernels-3.0/configure.ac (+0/-1227)
.pc/54780b8_Debian-guys-want-to-play-with-FreeBSD-kernels-and-Linux-userland/configure.ac (+0/-1232)
.pc/applied-patches (+7/-18)
.pc/debian/0001-kvers.patch/modules/linux/vmblock/Makefile (+150/-0)
.pc/debian/0001-kvers.patch/modules/linux/vmci/Makefile (+150/-0)
.pc/debian/0001-kvers.patch/modules/linux/vmhgfs/Makefile (+150/-0)
.pc/debian/0001-kvers.patch/modules/linux/vmsync/Makefile (+150/-0)
.pc/debian/0001-kvers.patch/modules/linux/vmxnet/Makefile (+150/-0)
.pc/debian/0001-kvers.patch/modules/linux/vsock/Makefile (+150/-0)
.pc/debian/max_nic_count/lib/guestRpc/nicinfo.x (+329/-0)
.pc/debian/pam-use-common-auth-account/scripts/linux/pam.d/vmtoolsd (+7/-0)
.pc/dh_dkms_fail_workaround.patch/modules/linux/dkms.conf (+0/-34)
.pc/dkms-do-not-build-vmsync-vmblock--remove-for-backports-to-pre-3.0/modules/linux/dkms.conf (+0/-34)
.pc/dkms-do-not-build-vsock-vmxnet.patch/modules/linux/dkms.conf (+0/-24)
.pc/dkms-module-location.patch/modules/linux/dkms.conf (+0/-34)
.pc/e55039c_HGFS-Fix-Linux-client-symlinks/modules/linux/vmhgfs/link.c (+0/-182)
.pc/from_arch/0001-Fix-vmxnet-module-on-kernels-3.16.patch/modules/linux/shared/compat_netdevice.h (+340/-0)
.pc/from_arch/0001-Fix-vmxnet-module-on-kernels-3.16.patch/modules/linux/vmxnet/vmxnet.c (+3146/-0)
.pc/from_arch/0002-Fix-d_alias-to-d_u.d_alias-for-kernel-3.18.patch/modules/linux/vmhgfs/inode.c (+2263/-0)
.pc/from_arch/0003-Fix-f_dentry-msghdr-kernel-3.19.patch/modules/linux/vmhgfs/dir.c (+1475/-0)
.pc/from_arch/0003-Fix-f_dentry-msghdr-kernel-3.19.patch/modules/linux/vmhgfs/file.c (+1521/-0)
.pc/from_arch/0003-Fix-f_dentry-msghdr-kernel-3.19.patch/modules/linux/vmhgfs/fsutil.c (+2315/-0)
.pc/glib.patch/lib/include/vmware/tools/log.h (+0/-184)
.pc/kuid_t-kgid_t-fix-for-3.12/modules/linux/vmhgfs/file.c (+0/-1285)
.pc/kuid_t-kgid_t-fix-for-3.12/modules/linux/vmhgfs/filesystem.c (+0/-751)
.pc/kuid_t-kgid_t-fix-for-3.12/modules/linux/vmhgfs/fsutil.c (+0/-1725)
.pc/kuid_t-kgid_t-fix-for-3.12/modules/linux/vmhgfs/inode.c (+0/-2196)
.pc/kuid_t-kgid_t-fix-for-3.12/modules/linux/vsock/linux/af_vsock.c (+0/-6083)
.pc/ubuntu/vgaauthlog_fix.patch/vgauth/common/VGAuthLog.c (+377/-0)
ChangeLog (+1682/-3)
INSTALL (+38/-174)
Makefile.am (+10/-1)
Makefile.in (+160/-284)
NEWS (+71/-5)
README (+126/-137)
aclocal.m4 (+230/-341)
autom4te.cache/output.0 (+0/-25514)
autom4te.cache/output.1 (+0/-25514)
autom4te.cache/output.2 (+0/-25514)
autom4te.cache/requests (+0/-517)
autom4te.cache/traces.0 (+0/-2984)
autom4te.cache/traces.1 (+0/-1319)
autom4te.cache/traces.2 (+0/-2984)
checkvm/Makefile.am (+1/-1)
checkvm/Makefile.in (+83/-167)
checkvm/checkvm.c (+2/-1)
checkvm/checkvm_version.h (+1/-1)
config/compile (+22/-222)
config/config.guess (+277/-307)
config/config.sub (+77/-243)
config/depcomp (+83/-206)
config/install-sh (+124/-144)
config/ltmain.sh (+1685/-3590)
config/missing (+110/-73)
configure (+17477/-8814)
configure.ac (+195/-76)
debian/changelog (+87/-0)
debian/control (+25/-43)
debian/copyright (+5/-5)
debian/gbp.conf (+3/-0)
debian/local/open-vm-tools.kmod (+1/-0)
debian/local/open-vm-tools.service (+0/-11)
debian/local/run-vmblock_x2dfuse.mount (+17/-0)
debian/local/vmxnet.hook (+33/-0)
debian/local/xautostart.conf (+1/-0)
debian/manpages-desktop/vmware-user-suid-wrapper.1 (+60/-0)
debian/manpages/vmhgfs.9 (+70/-0)
debian/manpages/vmware-user-suid-wrapper.1 (+0/-38)
debian/manpages/vmxnet.9 (+65/-0)
debian/open-vm-tools-desktop.lintian-overrides (+0/-1)
debian/open-vm-tools-desktop.manpages (+1/-0)
debian/open-vm-tools-desktop.prerm (+11/-0)
debian/open-vm-tools-desktop.tmpfile (+1/-0)
debian/open-vm-tools-dkms.dkms (+19/-0)
debian/open-vm-tools-dkms.modprobe (+1/-0)
debian/open-vm-tools-dkms.postinst (+31/-0)
debian/open-vm-tools-dkms.postrm (+14/-0)
debian/open-vm-tools.init (+5/-1)
debian/open-vm-tools.lintian-overrides (+0/-5)
debian/open-vm-tools.postinst (+25/-0)
debian/open-vm-tools.service (+11/-0)
debian/open-vm-tools.udev (+9/-1)
debian/patches/0001-kvers.patch (+0/-69)
debian/patches/0002-dkms.patch (+0/-17)
debian/patches/0004-vsock-cve.patch (+0/-17)
debian/patches/0005-dkms-vmci-remove.patch (+0/-51)
debian/patches/0006-vmblock-fixes.patch (+0/-126)
debian/patches/0007-linux-311-vmhgfs-fix.patch (+0/-43)
debian/patches/1a3eb34_Fix-AssertOnCompileFailed-for-GCC-4.8-kernel-3.10 (+0/-75)
debian/patches/3a9f229_Harden-HostinfoOSData-against-PATH-attacks (+0/-99)
debian/patches/4a527c9_HGFS-Make-Linux-client-compile-on-kernels-3.11 (+0/-831)
debian/patches/530ef7f_OVT-do-not-build-vmblock-on-Linux-kernels-3.0 (+0/-28)
debian/patches/54780b8_Debian-guys-want-to-play-with-FreeBSD-kernels-and-Linux-userland (+0/-46)
debian/patches/debian/0001-kvers.patch (+69/-0)
debian/patches/debian/max_nic_count (+11/-0)
debian/patches/debian/pam-use-common-auth-account (+12/-0)
debian/patches/dh_dkms_fail_workaround.patch (+0/-8)
debian/patches/dkms-do-not-build-vmsync-vmblock--remove-for-backports-to-pre-3.0 (+0/-40)
debian/patches/dkms-do-not-build-vsock-vmxnet.patch (+0/-34)
debian/patches/dkms-module-location.patch (+0/-17)
debian/patches/e55039c_HGFS-Fix-Linux-client-symlinks (+0/-111)
debian/patches/from_arch/0001-Fix-vmxnet-module-on-kernels-3.16.patch (+74/-0)
debian/patches/from_arch/0002-Fix-d_alias-to-d_u.d_alias-for-kernel-3.18.patch (+34/-0)
debian/patches/from_arch/0003-Fix-f_dentry-msghdr-kernel-3.19.patch (+429/-0)
debian/patches/from_arch/update_patches.sh (+12/-0)
debian/patches/glib.patch (+0/-17)
debian/patches/kuid_t-kgid_t-fix-for-3.12 (+0/-124)
debian/patches/series (+7/-18)
debian/patches/ubuntu/vgaauthlog_fix.patch (+14/-0)
debian/rules (+50/-9)
docs/Makefile.am (+1/-1)
docs/Makefile.in (+109/-188)
docs/api/Makefile.am (+1/-1)
docs/api/Makefile.in (+28/-77)
docs/api/services/debug.txt (+1/-4)
docs/api/services/guestrpc.txt (+1/-4)
docs/api/services/main.doxy (+1/-4)
docs/api/services/plugins.txt (+1/-4)
guestproxycerttool/COPYING (+502/-0)
guestproxycerttool/Makefile.am (+42/-0)
guestproxycerttool/Makefile.in (+616/-0)
guestproxycerttool/cert_key.c (+725/-0)
guestproxycerttool/cert_key.h (+38/-0)
guestproxycerttool/cert_tool.c (+531/-0)
guestproxycerttool/cert_tool_version.h (+39/-0)
guestproxycerttool/cert_util.c (+427/-0)
guestproxycerttool/cert_util.h (+63/-0)
hgfsclient/Makefile.am (+1/-1)
hgfsclient/Makefile.in (+85/-169)
hgfsclient/hgfsclient.c (+2/-1)
hgfsclient/hgfsclient_version.h (+1/-1)
hgfsmounter/Makefile.am (+1/-1)
hgfsmounter/Makefile.in (+74/-156)
hgfsmounter/hgfsmounter.c (+4/-1)
hgfsmounter/hgfsmounter_version.h (+1/-1)
lib/Makefile.am (+8/-1)
lib/Makefile.in (+124/-202)
lib/appUtil/Makefile.am (+1/-1)
lib/appUtil/Makefile.in (+66/-136)
lib/appUtil/appUtil.c (+1/-1)
lib/appUtil/appUtilX11.c (+1/-1)
lib/asyncsocket/Makefile.am (+24/-0)
lib/asyncsocket/Makefile.in (+533/-0)
lib/asyncsocket/asyncSocketInt.h (+362/-0)
lib/asyncsocket/asyncsocket.c (+5746/-0)
lib/auth/Makefile.am (+1/-1)
lib/auth/Makefile.in (+66/-136)
lib/auth/authPosix.c (+173/-33)
lib/backdoor/Makefile.am (+1/-1)
lib/backdoor/Makefile.in (+66/-136)
lib/backdoor/backdoor.c (+1/-1)
lib/backdoor/backdoorGcc32.c (+1/-1)
lib/backdoor/backdoorGcc64.c (+1/-1)
lib/backdoor/backdoorInt.h (+1/-1)
lib/dataMap/Makefile.am (+21/-0)
lib/dataMap/Makefile.in (+532/-0)
lib/dataMap/dataMap.c (+2490/-0)
lib/dict/Makefile.am (+1/-1)
lib/dict/Makefile.in (+66/-136)
lib/dict/dictll.c (+2/-2)
lib/dynxdr/Makefile.am (+1/-1)
lib/dynxdr/Makefile.in (+66/-136)
lib/dynxdr/dynxdr.c (+1/-1)
lib/dynxdr/xdrutil.c (+1/-1)
lib/err/Makefile.am (+1/-1)
lib/err/Makefile.in (+66/-136)
lib/err/err.c (+15/-8)
lib/err/errInt.h (+1/-1)
lib/err/errPosix.c (+1/-1)
lib/file/Makefile.am (+1/-1)
lib/file/Makefile.in (+66/-136)
lib/file/file.c (+65/-12)
lib/file/fileIO.c (+80/-63)
lib/file/fileIOPosix.c (+136/-61)
lib/file/fileInt.h (+1/-1)
lib/file/fileLockPosix.c (+1/-2)
lib/file/fileLockPrimitive.c (+1/-1)
lib/file/filePosix.c (+214/-100)
lib/file/fileStandAlone.c (+1/-1)
lib/file/fileTemp.c (+42/-2)
lib/file/fileTempPosix.c (+3/-3)
lib/foundryMsg/Makefile.am (+1/-1)
lib/foundryMsg/Makefile.in (+66/-136)
lib/foundryMsg/foundryMsg.c (+9/-12)
lib/foundryMsg/foundryPropertyListCommon.c (+305/-101)
lib/foundryMsg/vixTranslateErrOpenSource.c (+4/-1)
lib/glibUtils/Makefile.am (+1/-1)
lib/glibUtils/Makefile.in (+75/-145)
lib/glibUtils/fileLogger.c (+1/-1)
lib/glibUtils/stdLogger.c (+1/-1)
lib/glibUtils/sysLogger.c (+1/-1)
lib/guestApp/Makefile.am (+1/-1)
lib/guestApp/Makefile.in (+66/-136)
lib/guestApp/guestApp.c (+458/-19)
lib/guestRpc/Makefile.am (+1/-1)
lib/guestRpc/Makefile.in (+66/-136)
lib/guestRpc/nicinfo.x (+2/-2)
lib/hashMap/Makefile.am (+21/-0)
lib/hashMap/Makefile.in (+532/-0)
lib/hashMap/hashMap.c (+1201/-0)
lib/hgfs/Makefile.am (+1/-1)
lib/hgfs/Makefile.in (+66/-136)
lib/hgfs/cpName.c (+1/-1)
lib/hgfs/cpNameInt.h (+1/-1)
lib/hgfs/cpNameLinux.c (+1/-1)
lib/hgfs/cpNameLite.c (+1/-1)
lib/hgfs/cpNameUtil.c (+1/-1)
lib/hgfs/cpNameUtilInt.h (+1/-1)
lib/hgfs/cpNameUtilLinux.c (+1/-1)
lib/hgfs/hgfsEscape.c (+1/-1)
lib/hgfs/hgfsUtil.c (+1/-1)
lib/hgfsBd/Makefile.am (+1/-1)
lib/hgfsBd/Makefile.in (+66/-136)
lib/hgfsBd/hgfsBd.c (+1/-1)
lib/hgfsHelper/Makefile.am (+1/-1)
lib/hgfsHelper/Makefile.in (+66/-136)
lib/hgfsHelper/hgfsHelperPosix.c (+1/-1)
lib/hgfsServer/Makefile.am (+3/-1)
lib/hgfsServer/Makefile.in (+72/-138)
lib/hgfsServer/hgfsDirNotify.h (+1/-1)
lib/hgfsServer/hgfsDirNotifyStub.c (+2/-3)
lib/hgfsServer/hgfsServer.c (+1108/-1353)
lib/hgfsServer/hgfsServerInt.h (+161/-601)
lib/hgfsServer/hgfsServerLinux.c (+837/-344)
lib/hgfsServer/hgfsServerOplock.c (+377/-0)
lib/hgfsServer/hgfsServerOplock.h (+64/-0)
lib/hgfsServer/hgfsServerOplockInt.h (+74/-0)
lib/hgfsServer/hgfsServerOplockLinux.c (+377/-0)
lib/hgfsServer/hgfsServerPacketUtil.c (+438/-342)
lib/hgfsServer/hgfsServerParameters.c (+1268/-981)
lib/hgfsServer/hgfsServerParameters.h (+355/-0)
lib/hgfsServerManagerGuest/Makefile.am (+1/-1)
lib/hgfsServerManagerGuest/Makefile.in (+66/-136)
lib/hgfsServerManagerGuest/hgfsChannelGuest.c (+14/-7)
lib/hgfsServerManagerGuest/hgfsChannelGuestBd.c (+16/-16)
lib/hgfsServerManagerGuest/hgfsChannelGuestInt.h (+1/-1)
lib/hgfsServerManagerGuest/hgfsServerManagerGuest.c (+2/-1)
lib/hgfsServerPolicyGuest/Makefile.am (+1/-1)
lib/hgfsServerPolicyGuest/Makefile.in (+66/-136)
lib/hgfsServerPolicyGuest/hgfsServerPolicyGuest.c (+1/-1)
lib/impersonate/Makefile.am (+1/-1)
lib/impersonate/Makefile.in (+66/-136)
lib/impersonate/impersonate.c (+3/-3)
lib/impersonate/impersonateInt.h (+1/-1)
lib/impersonate/impersonatePosix.c (+9/-9)
lib/include/appUtil.h (+4/-1)
lib/include/asyncsocket.h (+442/-0)
lib/include/auth.h (+6/-1)
lib/include/backdoor.h (+1/-1)
lib/include/backdoor_def.h (+13/-5)
lib/include/backdoor_types.h (+1/-1)
lib/include/base64.h (+1/-1)
lib/include/bsd_output.h (+1/-1)
lib/include/bsdfmt.h (+0/-3)
lib/include/buildNumber.h (+6/-6)
lib/include/capsProvider.h (+1/-1)
lib/include/circList.h (+1/-1)
lib/include/clamped.h (+326/-0)
lib/include/codeset.h (+8/-5)
lib/include/community_source.h (+1/-2)
lib/include/compat/compat_stdarg.h (+1/-2)
lib/include/conf.h (+1/-1)
lib/include/config.h (+4/-6)
lib/include/cpName.h (+1/-1)
lib/include/cpNameLite.h (+1/-1)
lib/include/cpNameUtil.h (+1/-1)
lib/include/cpuid_info.h (+1/-1)
lib/include/cryptoError.h (+1/-1)
lib/include/dataMap.h (+177/-0)
lib/include/dbllnklst.h (+1/-4)
lib/include/debug.h (+1/-1)
lib/include/deployPkg/linuxDeployment.h (+61/-0)
lib/include/dictll.h (+1/-1)
lib/include/dynarray.h (+1/-1)
lib/include/dynbuf.h (+1/-1)
lib/include/dynxdr.h (+1/-1)
lib/include/embed_version.h (+1/-3)
lib/include/err.h (+1/-1)
lib/include/escBitvector.h (+1/-1)
lib/include/escape.h (+1/-1)
lib/include/file.h (+16/-6)
lib/include/fileIO.h (+23/-7)
lib/include/fileLock.h (+1/-1)
lib/include/file_extensions.h (+3/-1)
lib/include/glibUtils.h (+1/-1)
lib/include/guestApp.h (+1/-1)
lib/include/guestInfo.h (+1/-1)
lib/include/guestStats.h (+1/-1)
lib/include/guest_msg_def.h (+1/-1)
lib/include/guest_os.h (+59/-37)
lib/include/guest_os_tables.h (+132/-117)
lib/include/hashMap.h (+88/-0)
lib/include/hashTable.h (+4/-4)
lib/include/hgfs.h (+1/-1)
lib/include/hgfsBd.h (+1/-1)
lib/include/hgfsDevLinux.h (+1/-1)
lib/include/hgfsEscape.h (+1/-1)
lib/include/hgfsHelper.h (+1/-1)
lib/include/hgfsProto.h (+48/-31)
lib/include/hgfsServer.h (+52/-32)
lib/include/hgfsServerManager.h (+1/-1)
lib/include/hgfsServerPolicy.h (+1/-1)
lib/include/hgfsTransport.h (+54/-60)
lib/include/hgfsUtil.h (+1/-1)
lib/include/hgfsVirtualDir.h (+1/-1)
lib/include/hostType.h (+1/-1)
lib/include/hostinfo.h (+5/-1)
lib/include/imgcust-common/imgcust-api.h (+43/-0)
lib/include/imgcust-common/log.h (+41/-0)
lib/include/imgcust-common/process.h (+59/-0)
lib/include/imgcust-guest/guestcust-events.h (+35/-0)
lib/include/impersonate.h (+1/-1)
lib/include/includeCheck.h (+2/-13)
lib/include/ioplGet.h (+0/-34)
lib/include/iovector.h (+1/-1)
lib/include/libExport.hh (+1/-1)
lib/include/localconfig.h (+1/-1)
lib/include/log.h (+157/-98)
lib/include/logFixed.h (+1/-1)
lib/include/loglevel_defs.h (+1/-1)
lib/include/loglevel_user.h (+21/-2)
lib/include/memaligned.h (+5/-4)
lib/include/message.h (+1/-1)
lib/include/miscSolaris.h (+1/-1)
lib/include/mntinfo.h (+1/-1)
lib/include/msg.h (+1/-1)
lib/include/msgList.h (+1/-1)
lib/include/msgfmt.h (+1/-1)
lib/include/msgid.h (+1/-1)
lib/include/msgidDefs.h (+1/-1)
lib/include/mutexRank.h (+15/-2)
lib/include/mutexRankLib.h (+7/-10)
lib/include/netutil.h (+1/-1)
lib/include/nicInfo.h (+77/-0)
lib/include/panic.h (+1/-1)
lib/include/poll.h (+324/-0)
lib/include/pollImpl.h (+161/-0)
lib/include/posix.h (+1/-1)
lib/include/preference.h (+1/-1)
lib/include/printer.h (+1/-1)
lib/include/procMgr.h (+1/-1)
lib/include/productState.h (+109/-0)
lib/include/random.h (+1/-1)
lib/include/removable_device.h (+1/-1)
lib/include/rpcin.h (+1/-1)
lib/include/rpcout.h (+1/-1)
lib/include/rpcvmx.h (+1/-1)
lib/include/safetime.h (+5/-5)
lib/include/sha1.h (+1/-1)
lib/include/sigPosixRegs.h (+18/-1)
lib/include/slashProc.h (+1/-1)
lib/include/sslDirect.h (+63/-0)
lib/include/str.h (+5/-4)
lib/include/strutil.h (+3/-1)
lib/include/su.h (+7/-5)
lib/include/syncDriver.h (+3/-2)
lib/include/syncDriverIoc.h (+1/-1)
lib/include/syncEvent.h (+1/-1)
lib/include/system.h (+3/-1)
lib/include/timeutil.h (+5/-2)
lib/include/tracer.hh (+61/-0)
lib/include/unicode.h (+1/-1)
lib/include/unicodeBase.h (+2/-2)
lib/include/unicodeICU.h (+1/-1)
lib/include/unicodeOperations.h (+1/-1)
lib/include/unicodeTransforms.h (+1/-1)
lib/include/unicodeTypes.h (+1/-1)
lib/include/userlock.h (+10/-3)
lib/include/util.h (+69/-4)
lib/include/util_shared.h (+1/-3)
lib/include/uuid.h (+4/-3)
lib/include/vix.h (+1/-1)
lib/include/vixCommands.h (+18/-48)
lib/include/vixOpenSource.h (+61/-19)
lib/include/vmGuestLib.h (+13/-1)
lib/include/vmSessionId.h (+1/-1)
lib/include/vm_api.h (+75/-30)
lib/include/vm_assert.h (+62/-92)
lib/include/vm_atomic.h (+401/-416)
lib/include/vm_basic_asm.h (+100/-32)
lib/include/vm_basic_asm_x86.h (+70/-101)
lib/include/vm_basic_asm_x86_64.h (+138/-85)
lib/include/vm_basic_defs.h (+47/-43)
lib/include/vm_basic_math.h (+12/-2)
lib/include/vm_basic_types.h (+65/-39)
lib/include/vm_compilation_options.h (+47/-0)
lib/include/vm_ctype.h (+1/-1)
lib/include/vm_device_version.h (+20/-1)
lib/include/vm_legal.h (+16/-9)
lib/include/vm_procps.h (+1/-1)
lib/include/vm_product.h (+5/-23)
lib/include/vm_product_versions.h (+465/-0)
lib/include/vm_tools_version.h (+76/-5)
lib/include/vm_version.h (+8/-473)
lib/include/vm_vmx_type.h (+57/-0)
lib/include/vmblock.h (+1/-4)
lib/include/vmblock_user.h (+1/-4)
lib/include/vmcheck.h (+1/-1)
lib/include/vmci_defs.h (+27/-25)
lib/include/vmci_sockets.h (+39/-16)
lib/include/vmfs.h (+5/-1)
lib/include/vmk_exports.h (+1/-2)
lib/include/vmsignal.h (+1/-1)
lib/include/vmstdio.h (+1/-1)
lib/include/vmsupport.h (+1/-1)
lib/include/vmtoolsd_version.h (+1/-1)
lib/include/vmware.h (+1/-4)
lib/include/vmware/guestrpc/capabilities.h (+7/-1)
lib/include/vmware/guestrpc/deploypkg.h (+50/-0)
lib/include/vmware/guestrpc/powerops.h (+1/-1)
lib/include/vmware/guestrpc/tclodefs.h (+15/-1)
lib/include/vmware/guestrpc/timesync.h (+1/-1)
lib/include/vmware/guestrpc/vmbackup.h (+1/-1)
lib/include/vmware/tools/desktopevents.h (+1/-1)
lib/include/vmware/tools/guestrpc.h (+41/-85)
lib/include/vmware/tools/i18n.h (+1/-1)
lib/include/vmware/tools/log.h (+4/-4)
lib/include/vmware/tools/plugin.h (+1/-1)
lib/include/vmware/tools/rpcdebug.h (+1/-1)
lib/include/vmware/tools/threadPool.h (+1/-1)
lib/include/vmware/tools/utils.h (+10/-1)
lib/include/vmware/tools/vmbackup.h (+1/-1)
lib/include/vmware_pack_begin.h (+1/-1)
lib/include/vmware_pack_end.h (+1/-1)
lib/include/vmware_pack_init.h (+1/-1)
lib/include/vmxrpc.h (+1/-1)
lib/include/vthreadBase.h (+7/-6)
lib/include/win32util.h (+1/-1)
lib/include/wiper.h (+3/-1)
lib/include/x86_basic_defs.h (+0/-233)
lib/include/x86cpuid.h (+601/-458)
lib/include/x86cpuid_asm.h (+12/-12)
lib/include/x86vendor.h (+1/-1)
lib/include/xdg.h (+1/-1)
lib/include/xdrutil.h (+1/-1)
lib/lock/Makefile.am (+1/-1)
lib/lock/Makefile.in (+66/-136)
lib/lock/ul.c (+24/-59)
lib/lock/ulBarrier.c (+1/-1)
lib/lock/ulCondVar.c (+2/-2)
lib/lock/ulExcl.c (+62/-11)
lib/lock/ulInt.h (+50/-36)
lib/lock/ulIntShared.h (+4/-2)
lib/lock/ulRW.c (+7/-8)
lib/lock/ulRec.c (+20/-20)
lib/lock/ulSema.c (+71/-13)
lib/lock/ulStats.c (+22/-19)
lib/message/Makefile.am (+1/-1)
lib/message/Makefile.in (+66/-136)
lib/message/message.c (+1/-1)
lib/misc/Makefile.am (+2/-1)
lib/misc/Makefile.in (+71/-140)
lib/misc/atomic.c (+21/-5)
lib/misc/base64.c (+11/-8)
lib/misc/codeset.c (+14/-18)
lib/misc/codesetBase.c (+52/-4)
lib/misc/codesetOld.c (+9/-1)
lib/misc/codesetOld.h (+1/-1)
lib/misc/dynarray.c (+1/-1)
lib/misc/dynbuf.c (+1/-1)
lib/misc/escape.c (+1/-1)
lib/misc/hashTable.c (+3/-3)
lib/misc/hostType.c (+1/-1)
lib/misc/hostinfo.c (+5/-2)
lib/misc/hostinfoHV.c (+1/-1)
lib/misc/hostinfoInt.h (+1/-1)
lib/misc/hostinfoPosix.c (+66/-34)
lib/misc/hostname.c (+1/-1)
lib/misc/idLinux.c (+189/-3)
lib/misc/iovector.c (+8/-8)
lib/misc/logFixed.c (+1/-1)
lib/misc/machineID.c (+1/-1)
lib/misc/miscSolaris.c (+1/-1)
lib/misc/msgList.c (+1/-1)
lib/misc/msgfmt.c (+10/-14)
lib/misc/posixDlopen.c (+1/-1)
lib/misc/posixInt.h (+1/-1)
lib/misc/posixPosix.c (+2/-1074)
lib/misc/posixPwd.c (+1108/-0)
lib/misc/random.c (+7/-2)
lib/misc/sha1.c (+1/-1)
lib/misc/strutil.c (+57/-5)
lib/misc/timeutil.c (+61/-5)
lib/misc/utilMem.c (+4/-3)
lib/misc/util_misc.c (+319/-4)
lib/misc/vmstdio.c (+1/-1)
lib/misc/vthreadBase.c (+293/-349)
lib/netUtil/Makefile.am (+1/-1)
lib/netUtil/Makefile.in (+66/-136)
lib/netUtil/netUtilLinux.c (+2/-2)
lib/nicInfo/Makefile.am (+37/-0)
lib/nicInfo/Makefile.in (+572/-0)
lib/nicInfo/compareNicInfo.c (+453/-0)
lib/nicInfo/nicInfo.c (+473/-0)
lib/nicInfo/nicInfoInt.h (+68/-0)
lib/nicInfo/nicInfoPosix.c (+939/-0)
lib/nicInfo/util.c (+65/-0)
lib/panic/Makefile.am (+1/-1)
lib/panic/Makefile.in (+66/-136)
lib/panic/panic.c (+2/-5)
lib/panicDefault/Makefile.am (+1/-1)
lib/panicDefault/Makefile.in (+66/-136)
lib/panicDefault/panicDefault.c (+1/-1)
lib/poll/Makefile.am (+21/-0)
lib/poll/Makefile.in (+532/-0)
lib/poll/poll.c (+2225/-0)
lib/pollGtk/Makefile.am (+24/-0)
lib/pollGtk/Makefile.in (+533/-0)
lib/pollGtk/pollGtk.c (+1496/-0)
lib/printer/Makefile.am (+1/-1)
lib/printer/Makefile.in (+66/-136)
lib/printer/printer.c (+1/-1)
lib/procMgr/Makefile.am (+1/-1)
lib/procMgr/Makefile.in (+66/-136)
lib/procMgr/procMgrPosix.c (+17/-5)
lib/procMgr/procMgrSolaris.c (+1/-1)
lib/rpcChannel/Makefile.am (+3/-1)
lib/rpcChannel/Makefile.in (+93/-144)
lib/rpcChannel/bdoorChannel.c (+98/-92)
lib/rpcChannel/rpcChannel.c (+425/-13)
lib/rpcChannel/rpcChannelInt.h (+37/-1)
lib/rpcChannel/simpleSocket.c (+635/-0)
lib/rpcChannel/simpleSocket.h (+89/-0)
lib/rpcChannel/vsockChannel.c (+579/-0)
lib/rpcIn/Makefile.am (+1/-1)
lib/rpcIn/Makefile.in (+69/-139)
lib/rpcIn/rpcin.c (+1042/-143)
lib/rpcOut/Makefile.am (+1/-1)
lib/rpcOut/Makefile.in (+66/-136)
lib/rpcOut/rpcout.c (+9/-1)
lib/rpcVmx/Makefile.am (+1/-1)
lib/rpcVmx/Makefile.in (+66/-136)
lib/rpcVmx/rpcvmx.c (+3/-1)
lib/slashProc/Makefile.am (+1/-1)
lib/slashProc/Makefile.in (+69/-139)
lib/slashProc/net.c (+5/-5)
lib/slashProc/slashProcNetInt.h (+1/-1)
lib/sslDirect/Makefile.am (+30/-0)
lib/sslDirect/Makefile.in (+556/-0)
lib/sslDirect/sslDirect.c (+791/-0)
lib/sslDirect/sslStubs.c (+435/-0)
lib/string/Makefile.am (+1/-1)
lib/string/Makefile.in (+66/-136)
lib/string/bsd_output_int.h (+0/-3)
lib/string/bsd_output_shared.c (+0/-3)
lib/string/bsd_vsnprintf.c (+2/-8)
lib/string/bsd_vsnwprintf.c (+0/-3)
lib/string/str.c (+70/-85)
lib/stubs/Makefile.am (+1/-1)
lib/stubs/Makefile.in (+67/-137)
lib/stubs/stub-config.c (+1/-1)
lib/stubs/stub-log.c (+1/-8)
lib/stubs/stub-msgfmt-fbsd.c (+1/-1)
lib/stubs/stub-user-msg.c (+1/-1)
lib/stubs/stub-user-panic.c (+1/-1)
lib/stubs/stub-user-util.c (+1/-1)
lib/stubs/stub-warning.c (+1/-1)
lib/syncDriver/Makefile.am (+1/-1)
lib/syncDriver/Makefile.in (+66/-136)
lib/syncDriver/nullDriver.c (+1/-1)
lib/syncDriver/syncDriverInt.h (+1/-1)
lib/syncDriver/syncDriverLinux.c (+1/-1)
lib/syncDriver/syncDriverPosix.c (+69/-5)
lib/syncDriver/vmSyncDriver.c (+1/-1)
lib/system/Makefile.am (+1/-1)
lib/system/Makefile.in (+66/-136)
lib/system/systemLinux.c (+21/-2)
lib/unicode/Makefile.am (+1/-1)
lib/unicode/Makefile.in (+66/-136)
lib/unicode/unicodeCommon.c (+1/-1)
lib/unicode/unicodeICU.c (+1/-1)
lib/unicode/unicodeInt.h (+1/-1)
lib/unicode/unicodeSimpleBase.c (+7/-7)
lib/unicode/unicodeSimpleOperations.c (+1/-1)
lib/unicode/unicodeSimpleTransforms.c (+1/-1)
lib/unicode/unicodeSimpleTypes.c (+1/-1)
lib/unicode/unicodeStatic.c (+1/-1)
lib/user/Makefile.am (+2/-1)
lib/user/Makefile.in (+69/-138)
lib/user/util.c (+5/-535)
lib/user/utilBacktrace.c (+521/-0)
lib/vmCheck/Makefile.am (+1/-1)
lib/vmCheck/Makefile.in (+66/-136)
lib/vmCheck/vmcheck.c (+1/-1)
lib/vmSignal/Makefile.am (+1/-1)
lib/vmSignal/Makefile.in (+66/-136)
lib/vmSignal/vmsignal.c (+1/-1)
lib/wiper/Makefile.am (+1/-1)
lib/wiper/Makefile.in (+66/-136)
lib/wiper/wiperCommon.c (+1/-1)
lib/wiper/wiperPosix.c (+3/-1)
lib/xdg/Makefile.am (+1/-1)
lib/xdg/Makefile.in (+69/-139)
lib/xdg/xdg.c (+1/-1)
libDeployPkg/COPYING (+502/-0)
libDeployPkg/Makefile.am (+58/-0)
libDeployPkg/Makefile.in (+639/-0)
libDeployPkg/deployPkgFormat.h (+150/-0)
libDeployPkg/libDeployPkg.pc.in (+12/-0)
libDeployPkg/libDeployPkg_version.h (+37/-0)
libDeployPkg/linuxDeployment.c (+1339/-0)
libDeployPkg/mspackConfig.h (+148/-0)
libDeployPkg/mspackWrapper.c (+347/-0)
libDeployPkg/mspackWrapper.h (+136/-0)
libDeployPkg/processPosix.c (+349/-0)
libDeployPkg/toolsDeployPkg.h (+56/-0)
libguestlib/Makefile.am (+6/-1)
libguestlib/Makefile.in (+121/-196)
libguestlib/guestlibIoctl.x (+1/-1)
libguestlib/guestlibV3.x (+1/-1)
libguestlib/vmGuestLib.c (+87/-4)
libguestlib/vmGuestLibInt.h (+2/-1)
libguestlib/vmguestlib_version.h (+1/-1)
libhgfs/COPYING (+502/-0)
libhgfs/Makefile.am (+1/-1)
libhgfs/Makefile.in (+71/-165)
libhgfs/hgfslib.c (+2/-1)
libvmtools/Makefile.am (+14/-1)
libvmtools/Makefile.in (+122/-195)
libvmtools/guestSDKLog.c (+149/-0)
libvmtools/i18n.c (+1/-1)
libvmtools/monotonicTimer.c (+1/-1)
libvmtools/signalSource.c (+1/-1)
libvmtools/vmtools.c (+2/-1)
libvmtools/vmtoolsConfig.c (+1/-1)
libvmtools/vmtoolsInt.h (+13/-1)
libvmtools/vmtoolsLog.c (+185/-28)
libvmtools/vmtoolslib_version.h (+1/-1)
libvmtools/vmxLogger.c (+13/-8)
m4/libtool.m4 (+897/-1631)
m4/ltoptions.m4 (+12/-29)
m4/ltsugar.m4 (+10/-10)
m4/ltversion.m4 (+6/-6)
m4/lt~obsolete.m4 (+3/-9)
m4/vmtools.m4 (+1/-1)
modules/Makefile.in (+69/-156)
modules/freebsd/shared/compat_freebsd.h (+0/-3)
modules/freebsd/shared/compat_mount.h (+0/-3)
modules/freebsd/shared/compat_priv.h (+0/-3)
modules/freebsd/shared/compat_vop.h (+0/-3)
modules/freebsd/vmblock/COPYING (+0/-3)
modules/freebsd/vmblock/Makefile (+0/-3)
modules/freebsd/vmblock/os.h (+0/-3)
modules/freebsd/vmblock/os_panic.c (+0/-3)
modules/freebsd/vmblock/subr.c (+0/-3)
modules/freebsd/vmblock/vfsops.c (+1/-4)
modules/freebsd/vmblock/vmblock_k.h (+0/-3)
modules/freebsd/vmblock/vnops.c (+7/-9)
modules/freebsd/vmhgfs/COPYING (+0/-339)
modules/freebsd/vmhgfs/Makefile (+0/-114)
modules/freebsd/vmhgfs/bdhandler.c (+0/-236)
modules/freebsd/vmhgfs/channel.h (+0/-60)
modules/freebsd/vmhgfs/debug.c (+0/-346)
modules/freebsd/vmhgfs/debug.h (+0/-104)
modules/freebsd/vmhgfs/fsutil.c (+0/-1030)
modules/freebsd/vmhgfs/fsutil.h (+0/-196)
modules/freebsd/vmhgfs/hgfs_kernel.h (+0/-175)
modules/freebsd/vmhgfs/kernelStubs.h (+0/-149)
modules/freebsd/vmhgfs/kernelStubsBSD.c (+0/-259)
modules/freebsd/vmhgfs/os.c (+0/-928)
modules/freebsd/vmhgfs/os.h (+0/-135)
modules/freebsd/vmhgfs/request.c (+0/-868)
modules/freebsd/vmhgfs/request.h (+0/-88)
modules/freebsd/vmhgfs/requestInt.h (+0/-188)
modules/freebsd/vmhgfs/state.c (+0/-1575)
modules/freebsd/vmhgfs/state.h (+0/-213)
modules/freebsd/vmhgfs/transport.c (+0/-389)
modules/freebsd/vmhgfs/transport.h (+0/-39)
modules/freebsd/vmhgfs/vfsops.c (+0/-477)
modules/freebsd/vmhgfs/vfsopscommon.c (+0/-148)
modules/freebsd/vmhgfs/vfsopscommon.h (+0/-48)
modules/freebsd/vmhgfs/vmci.c (+0/-48)
modules/freebsd/vmhgfs/vnops.c (+0/-864)
modules/freebsd/vmhgfs/vnopscommon.c (+0/-3173)
modules/freebsd/vmhgfs/vnopscommon.h (+0/-94)
modules/freebsd/vmhgfs/worker.c (+0/-280)
modules/freebsd/vmmemctl/os.c (+20/-3)
modules/freebsd/vmxnet/net_compat.h (+4/-1)
modules/linux/dkms.conf (+35/-7)
modules/linux/dkms.sh (+3/-3)
modules/linux/shared/autoconf/dcount.c (+43/-0)
modules/linux/shared/autoconf/file_operations_flush.c (+46/-0)
modules/linux/shared/compat_cred.h (+4/-0)
modules/linux/shared/compat_dcache.h (+2/-2)
modules/linux/shared/compat_mm.h (+1/-58)
modules/linux/shared/compat_module.h (+11/-0)
modules/linux/shared/compat_netdevice.h (+4/-0)
modules/linux/shared/compat_skbuff.h (+9/-3)
modules/linux/shared/kernelStubs.h (+150/-31)
modules/linux/shared/kernelStubsLinux.c (+6/-4)
modules/linux/shared/kernelStubsSal.h (+134/-0)
modules/linux/shared/vmciKernelAPI1.h (+7/-3)
modules/linux/shared/vmci_defs.h (+27/-25)
modules/linux/shared/vmci_infrastructure.h (+9/-7)
modules/linux/shared/vmci_iocontrols.h (+6/-6)
modules/linux/shared/vmci_kernel_if.h (+32/-59)
modules/linux/vmblock/Makefile (+3/-24)
modules/linux/vmblock/linux/control.c (+5/-6)
modules/linux/vmblock/linux/file.c (+50/-7)
modules/linux/vmci/Makefile (+3/-24)
modules/linux/vmci/Makefile.kernel (+2/-2)
modules/linux/vmci/Makefile.normal (+1/-2)
modules/linux/vmci/common/vmciContext.c (+160/-14)
modules/linux/vmci/common/vmciContext.h (+4/-4)
modules/linux/vmci/common/vmciDatagram.c (+16/-12)
modules/linux/vmci/common/vmciDoorbell.c (+3/-3)
modules/linux/vmci/common/vmciDoorbell.h (+2/-2)
modules/linux/vmci/common/vmciDriver.c (+2/-2)
modules/linux/vmci/common/vmciDriver.h (+2/-2)
modules/linux/vmci/common/vmciHashtable.h (+2/-2)
modules/linux/vmci/common/vmciPageChannel.c (+0/-1736)
modules/linux/vmci/common/vmciQPair.c (+5/-17)
modules/linux/vmci/common/vmciQueuePair.c (+122/-180)
modules/linux/vmci/common/vmciResource.h (+2/-2)
modules/linux/vmci/common/vmciRoute.c (+1/-12)
modules/linux/vmci/common/vmciRoute.h (+2/-2)
modules/linux/vmci/linux/driver.c (+22/-19)
modules/linux/vmci/linux/vmciKernelIf.c (+128/-161)
modules/linux/vmci/linux/vmci_version.h (+4/-4)
modules/linux/vmci/shared/pgtbl.h (+21/-25)
modules/linux/vmci/shared/vmciQueue.h (+3/-3)
modules/linux/vmci/shared/vmci_handle_array.h (+0/-7)
modules/linux/vmci/shared/vmci_page_channel.h (+0/-733)
modules/linux/vmhgfs/Makefile (+3/-24)
modules/linux/vmhgfs/Makefile.kernel (+3/-1)
modules/linux/vmhgfs/bdhandler.c (+1/-1)
modules/linux/vmhgfs/dentry.c (+1/-1)
modules/linux/vmhgfs/dir.c (+43/-29)
modules/linux/vmhgfs/file.c (+469/-233)
modules/linux/vmhgfs/filesystem.c (+18/-114)
modules/linux/vmhgfs/filesystem.h (+1/-1)
modules/linux/vmhgfs/fsutil.c (+750/-159)
modules/linux/vmhgfs/fsutil.h (+7/-3)
modules/linux/vmhgfs/inode.c (+97/-31)
modules/linux/vmhgfs/inode.h (+1/-1)
modules/linux/vmhgfs/link.c (+19/-8)
modules/linux/vmhgfs/module.c (+1/-1)
modules/linux/vmhgfs/module.h (+17/-3)
modules/linux/vmhgfs/page.c (+93/-77)
modules/linux/vmhgfs/request.c (+3/-4)
modules/linux/vmhgfs/request.h (+1/-1)
modules/linux/vmhgfs/shared/compat_dentry.h (+10/-0)
modules/linux/vmhgfs/stubs.c (+1/-1)
modules/linux/vmhgfs/super.c (+1/-1)
modules/linux/vmhgfs/tcp.c (+0/-972)
modules/linux/vmhgfs/transport.c (+1/-32)
modules/linux/vmhgfs/transport.h (+1/-4)
modules/linux/vmhgfs/vmci.c (+0/-804)
modules/linux/vmhgfs/vmhgfs_version.h (+1/-1)
modules/linux/vmsync/Makefile (+3/-24)
modules/linux/vmxnet/Makefile (+3/-24)
modules/linux/vmxnet/vmxnet.c (+24/-26)
modules/linux/vmxnet/vmxnet_version.h (+3/-3)
modules/linux/vsock/Makefile (+3/-24)
modules/linux/vsock/Makefile.kernel (+3/-3)
modules/linux/vsock/linux/af_vsock.c (+44/-683)
modules/linux/vsock/linux/af_vsock.h (+5/-2)
modules/linux/vsock/linux/stats.h (+2/-2)
modules/linux/vsock/linux/util.c (+6/-113)
modules/linux/vsock/linux/util.h (+0/-111)
modules/linux/vsock/linux/vmci_sockets_int.h (+2/-2)
modules/linux/vsock/linux/vmci_sockets_packet.h (+2/-42)
modules/linux/vsock/linux/vsockAddr.c (+0/-34)
modules/linux/vsock/linux/vsockAddr.h (+0/-1)
modules/linux/vsock/linux/vsockCommon.h (+30/-9)
modules/linux/vsock/linux/vsockPacket.h (+8/-50)
modules/linux/vsock/linux/vsockSocketWrapper.h (+7/-2)
modules/linux/vsock/linux/vsock_version.h (+4/-4)
modules/shared/vmblock/block.c (+0/-3)
modules/shared/vmblock/block.h (+0/-3)
modules/shared/vmblock/stubs.c (+0/-3)
modules/shared/vmmemctl/backdoor_balloon.c (+20/-19)
modules/shared/vmmemctl/backdoor_balloon.h (+6/-7)
modules/shared/vmmemctl/balloonInt.h (+1/-8)
modules/shared/vmmemctl/balloon_def.h (+0/-3)
modules/shared/vmmemctl/dbllnklst.h (+1/-4)
modules/shared/vmmemctl/kernelStubs.h (+150/-34)
modules/shared/vmmemctl/os.h (+4/-4)
modules/shared/vmmemctl/vmballoon.c (+99/-106)
modules/shared/vmmemctl/vmballoon.h (+2/-5)
modules/shared/vmxnet/eth_public.h (+2/-0)
modules/shared/vmxnet/vmnet_def.h (+56/-51)
modules/shared/vmxnet/vmxnet2_def.h (+9/-23)
modules/shared/vmxnet/vmxnet3_defs.h (+24/-7)
modules/solaris/vmhgfs/Makefile (+1/-1)
modules/solaris/vmhgfs/debug.c (+1/-1)
modules/solaris/vmhgfs/debug.h (+1/-1)
modules/solaris/vmhgfs/filesystem.c (+1/-1)
modules/solaris/vmhgfs/filesystem.h (+1/-1)
modules/solaris/vmhgfs/hgfsBdGlue.c (+2/-1)
modules/solaris/vmhgfs/hgfsBdGlue.h (+1/-1)
modules/solaris/vmhgfs/hgfsSolaris.h (+2/-1)
modules/solaris/vmhgfs/hgfsState.c (+3/-2)
modules/solaris/vmhgfs/hgfsState.h (+1/-1)
modules/solaris/vmhgfs/kernelStubs.h (+150/-31)
modules/solaris/vmhgfs/kernelStubsSolaris.c (+1/-1)
modules/solaris/vmhgfs/module.c (+1/-1)
modules/solaris/vmhgfs/module.h (+1/-1)
modules/solaris/vmhgfs/request.c (+1/-1)
modules/solaris/vmhgfs/request.h (+1/-1)
modules/solaris/vmhgfs/vnode.c (+1/-1)
modules/solaris/vmhgfs/vnode.h (+1/-1)
modules/solaris/vmmemctl/kernelStubsSolaris.c (+1/-1)
modules/solaris/vmxnet3/vmxnet3_main.c (+108/-4)
modules/solaris/vmxnet3/vmxnet3_solaris.h (+2/-1)
modules/solaris/vmxnet3/vmxnet3_tx.c (+11/-10)
rpctool/Makefile.am (+1/-1)
rpctool/Makefile.in (+83/-167)
rpctool/rpctool.c (+1/-1)
scripts/Makefile.am (+3/-0)
scripts/Makefile.in (+57/-162)
scripts/build/instvmsg.sh (+1/-1)
scripts/build/rpcgen_wrapper.sh.in (+3/-2)
scripts/common/guestproxy-ssl.conf (+19/-0)
scripts/common/statechange.sh (+1/-1)
scripts/common/statechange.subr (+1/-1)
scripts/common/vm-support (+185/-113)
scripts/freebsd/network (+1/-1)
scripts/linux/network (+334/-58)
scripts/linux/pam.d/vmtoolsd (+2/-7)
scripts/solaris/network (+6/-2)
services/Makefile.am (+1/-1)
services/Makefile.in (+109/-188)
services/plugins/Makefile.am (+7/-1)
services/plugins/Makefile.in (+117/-194)
services/plugins/deployPkg/COPYING (+502/-0)
services/plugins/deployPkg/Makefile.am (+37/-0)
services/plugins/deployPkg/Makefile.in (+712/-0)
services/plugins/deployPkg/deployPkg.c (+305/-0)
services/plugins/deployPkg/deployPkgInt.h (+46/-0)
services/plugins/deployPkg/deployPkgLog.c (+144/-0)
services/plugins/deployPkg/deployPkgPlugin.c (+68/-0)
services/plugins/desktopEvents/COPYING (+502/-0)
services/plugins/desktopEvents/Makefile.am (+1/-1)
services/plugins/desktopEvents/Makefile.in (+98/-193)
services/plugins/desktopEvents/deFeatures.h (+1/-1)
services/plugins/desktopEvents/desktopEvents.c (+1/-1)
services/plugins/desktopEvents/desktopEventsInt.h (+1/-1)
services/plugins/desktopEvents/reload.c (+1/-1)
services/plugins/desktopEvents/sessionMgr.c (+46/-9)
services/plugins/desktopEvents/sessionMgrSignals.gm (+1/-1)
services/plugins/desktopEvents/x11Lock.c (+1/-1)
services/plugins/desktopEvents/xioError.c (+2/-1)
services/plugins/dndcp/COPYING (+502/-0)
services/plugins/dndcp/Makefile.am (+3/-3)
services/plugins/dndcp/Makefile.in (+201/-285)
services/plugins/dndcp/copyPasteCompat.c (+1/-1)
services/plugins/dndcp/copyPasteCompat.h (+1/-1)
services/plugins/dndcp/copyPasteCompatX11.c (+1/-1)
services/plugins/dndcp/copyPasteDnDImpl.h (+1/-1)
services/plugins/dndcp/copyPasteDnDWrapper.cpp (+1/-1)
services/plugins/dndcp/copyPasteDnDWrapper.h (+1/-1)
services/plugins/dndcp/copyPasteDnDX11.cpp (+18/-16)
services/plugins/dndcp/copyPasteDnDX11.h (+1/-1)
services/plugins/dndcp/copyPasteUIX11.cpp (+9/-8)
services/plugins/dndcp/copyPasteUIX11.h (+1/-1)
services/plugins/dndcp/cpFileContents.x (+1/-1)
services/plugins/dndcp/dnd/copyPasteRpc.hh (+1/-1)
services/plugins/dndcp/dnd/copyPasteRpcV4.hh (+1/-1)
services/plugins/dndcp/dnd/dnd.h (+1/-1)
services/plugins/dndcp/dnd/dndCPLibExport.hh (+1/-1)
services/plugins/dndcp/dnd/dndCPMsgV4.c (+1/-1)
services/plugins/dndcp/dnd/dndCPMsgV4.h (+1/-1)
services/plugins/dndcp/dnd/dndCPTransport.h (+1/-1)
services/plugins/dndcp/dnd/dndClipboard.c (+1/-1)
services/plugins/dndcp/dnd/dndClipboard.h (+1/-1)
services/plugins/dndcp/dnd/dndCommon.c (+2/-2)
services/plugins/dndcp/dnd/dndFileContentsUtil.h (+1/-1)
services/plugins/dndcp/dnd/dndInt.h (+1/-1)
services/plugins/dndcp/dnd/dndLinux.c (+9/-1)
services/plugins/dndcp/dnd/dndMsg.c (+1/-1)
services/plugins/dndcp/dnd/dndMsg.h (+1/-1)
services/plugins/dndcp/dnd/dndRpc.hh (+1/-1)
services/plugins/dndcp/dnd/dndRpcV4.hh (+1/-1)
services/plugins/dndcp/dnd/fileTransferRpc.hh (+1/-1)
services/plugins/dndcp/dnd/fileTransferRpcV4.hh (+1/-1)
services/plugins/dndcp/dnd/rpcBase.h (+1/-1)
services/plugins/dndcp/dnd/rpcV3Util.hpp (+17/-5)
services/plugins/dndcp/dndFileList.hh (+1/-1)
services/plugins/dndcp/dndGuest/copyPasteRpcV3.cc (+19/-18)
services/plugins/dndcp/dndGuest/copyPasteRpcV3.hh (+1/-1)
services/plugins/dndcp/dndGuest/copyPasteRpcV4.cc (+1/-1)
services/plugins/dndcp/dndGuest/dndCPTransportGuestRpc.cpp (+2/-2)
services/plugins/dndcp/dndGuest/dndCPTransportGuestRpc.hpp (+17/-3)
services/plugins/dndcp/dndGuest/dndFileList.cc (+1/-1)
services/plugins/dndcp/dndGuest/dndFileList.hh (+1/-1)
services/plugins/dndcp/dndGuest/dndRpcListener.hpp (+17/-3)
services/plugins/dndcp/dndGuest/dndRpcV3.cc (+32/-31)
services/plugins/dndcp/dndGuest/dndRpcV3.hh (+1/-1)
services/plugins/dndcp/dndGuest/dndRpcV4.cc (+1/-1)
services/plugins/dndcp/dndGuest/fileTransferRpcV4.cc (+1/-1)
services/plugins/dndcp/dndGuest/guestCopyPaste.hh (+4/-3)
services/plugins/dndcp/dndGuest/guestCopyPasteDest.cc (+7/-5)
services/plugins/dndcp/dndGuest/guestCopyPasteMgr.cc (+55/-25)
services/plugins/dndcp/dndGuest/guestCopyPasteSrc.cc (+10/-8)
services/plugins/dndcp/dndGuest/guestDnD.hh (+1/-1)
services/plugins/dndcp/dndGuest/guestDnDCPMgr.cc (+1/-1)
services/plugins/dndcp/dndGuest/guestDnDCPMgr.hh (+1/-1)
services/plugins/dndcp/dndGuest/guestDnDDest.cc (+21/-19)
services/plugins/dndcp/dndGuest/guestDnDMgr.cc (+81/-39)
services/plugins/dndcp/dndGuest/guestDnDSrc.cc (+22/-22)
services/plugins/dndcp/dndGuest/guestFileTransfer.cc (+1/-1)
services/plugins/dndcp/dndGuest/guestFileTransfer.hh (+1/-1)
services/plugins/dndcp/dndGuest/rpcV3Util.cpp (+1/-1)
services/plugins/dndcp/dndGuest/rpcV4Util.cpp (+1/-1)
services/plugins/dndcp/dndGuest/rpcV4Util.hpp (+17/-3)
services/plugins/dndcp/dndPluginInt.h (+1/-1)
services/plugins/dndcp/dndPluginIntX11.h (+1/-1)
services/plugins/dndcp/dndUIX11.cpp (+1093/-732)
services/plugins/dndcp/dndUIX11.h (+92/-70)
services/plugins/dndcp/dndcp.cpp (+1/-1)
services/plugins/dndcp/dragDetWndX11.cpp (+1/-1)
services/plugins/dndcp/dragDetWndX11.h (+1/-1)
services/plugins/dndcp/pointer.cpp (+1/-1)
services/plugins/dndcp/pointer.h (+1/-1)
services/plugins/dndcp/stringxx/string.cc (+5/-3)
services/plugins/dndcp/stringxx/string.hh (+1/-1)
services/plugins/dndcp/stringxx/ubstr_t.hh (+6/-6)
services/plugins/dndcp/xutils/xutils.cc (+1374/-0)
services/plugins/dndcp/xutils/xutils.hh (+117/-0)
services/plugins/grabbitmqProxy/COPYING (+502/-0)
services/plugins/grabbitmqProxy/Makefile.am (+33/-0)
services/plugins/grabbitmqProxy/Makefile.in (+577/-0)
services/plugins/grabbitmqProxy/grabbitmqProxyPlugin.c (+1943/-0)
services/plugins/grabbitmqProxy/rabbitmqProxyConst.h (+54/-0)
services/plugins/guestInfo/Makefile.am (+3/-3)
services/plugins/guestInfo/Makefile.in (+163/-254)
services/plugins/guestInfo/diskInfo.c (+144/-0)
services/plugins/guestInfo/diskInfoPosix.c (+46/-0)
services/plugins/guestInfo/getlib/Makefile.am (+0/-31)
services/plugins/guestInfo/getlib/Makefile.in (+0/-638)
services/plugins/guestInfo/getlib/compareNicInfo.c (+0/-453)
services/plugins/guestInfo/getlib/getlibInt.h (+0/-60)
services/plugins/guestInfo/getlib/guestInfo.c (+0/-519)
services/plugins/guestInfo/getlib/guestInfoPosix.c (+0/-717)
services/plugins/guestInfo/getlib/util.c (+0/-65)
services/plugins/guestInfo/guestInfoInt.h (+11/-2)
services/plugins/guestInfo/guestInfoLib.h (+0/-100)
services/plugins/guestInfo/guestInfoServer.c (+10/-11)
services/plugins/guestInfo/perfMonLinux.c (+1/-1)
services/plugins/hgfsServer/Makefile.am (+1/-1)
services/plugins/hgfsServer/Makefile.in (+82/-177)
services/plugins/hgfsServer/hgfsPlugin.c (+3/-1)
services/plugins/powerOps/Makefile.am (+1/-1)
services/plugins/powerOps/Makefile.in (+82/-177)
services/plugins/powerOps/powerOps.c (+2/-1)
services/plugins/resolutionSet/Makefile.am (+1/-1)
services/plugins/resolutionSet/Makefile.in (+91/-186)
services/plugins/resolutionSet/resolutionInt.h (+1/-1)
services/plugins/resolutionSet/resolutionRandR12.c (+1/-1)
services/plugins/resolutionSet/resolutionRandR12.h (+1/-1)
services/plugins/resolutionSet/resolutionSet.c (+2/-1)
services/plugins/resolutionSet/resolutionX11.c (+1/-1)
services/plugins/timeSync/Makefile.am (+1/-1)
services/plugins/timeSync/Makefile.in (+97/-192)
services/plugins/timeSync/pllLinux.c (+1/-1)
services/plugins/timeSync/pllNone.c (+1/-1)
services/plugins/timeSync/slewAdjtime.c (+1/-1)
services/plugins/timeSync/slewLinux.c (+1/-1)
services/plugins/timeSync/timeSync.c (+2/-1)
services/plugins/timeSync/timeSync.h (+1/-1)
services/plugins/timeSync/timeSyncPosix.c (+1/-1)
services/plugins/timeSync/timeSyncPosix.h (+1/-1)
services/plugins/vix/Makefile.am (+5/-1)
services/plugins/vix/Makefile.in (+97/-189)
services/plugins/vix/foundryToolsDaemon.c (+24/-3)
services/plugins/vix/vixPlugin.c (+57/-16)
services/plugins/vix/vixPluginInt.h (+4/-1)
services/plugins/vix/vixTools.c (+300/-100)
services/plugins/vix/vixToolsEnvVars.c (+1/-1)
services/plugins/vix/vixToolsInt.h (+8/-1)
services/plugins/vmbackup/Makefile.am (+13/-1)
services/plugins/vmbackup/Makefile.in (+117/-194)
services/plugins/vmbackup/guestQuiesce.x (+48/-0)
services/plugins/vmbackup/nullProvider.c (+1/-1)
services/plugins/vmbackup/scriptOps.c (+1/-1)
services/plugins/vmbackup/stateMachine.c (+34/-48)
services/plugins/vmbackup/syncDriverOps.c (+147/-11)
services/plugins/vmbackup/vmBackupInt.h (+7/-1)
services/plugins/vmbackup/vmBackupSignals.gm (+1/-1)
services/vmtoolsd/Makefile.am (+1/-1)
services/vmtoolsd/Makefile.in (+119/-243)
services/vmtoolsd/cmdLine.c (+27/-3)
services/vmtoolsd/l10n/de.vmsg (+1/-1)
services/vmtoolsd/l10n/ja.vmsg (+1/-1)
services/vmtoolsd/l10n/ko.vmsg (+1/-1)
services/vmtoolsd/mainLoop.c (+7/-4)
services/vmtoolsd/mainPosix.c (+12/-1)
services/vmtoolsd/pluginMgr.c (+1/-1)
services/vmtoolsd/serviceObj.c (+1/-1)
services/vmtoolsd/serviceObj.h (+1/-1)
services/vmtoolsd/svcSignals.gm (+1/-1)
services/vmtoolsd/threadPool.c (+1/-1)
services/vmtoolsd/toolsCoreInt.h (+1/-1)
services/vmtoolsd/toolsRpc.c (+19/-51)
tests/Makefile.am (+1/-1)
tests/Makefile.in (+109/-189)
tests/testDebug/Makefile.am (+1/-1)
tests/testDebug/Makefile.in (+86/-181)
tests/testDebug/testDebug.c (+1/-1)
tests/testPlugin/Makefile.am (+1/-1)
tests/testPlugin/Makefile.in (+86/-181)
tests/testPlugin/testData.x (+1/-1)
tests/testPlugin/testPlugin.c (+1/-1)
tests/testVmblock/Makefile.am (+1/-1)
tests/testVmblock/Makefile.in (+62/-131)
tests/testVmblock/manual-blocker.c (+1/-1)
tests/testVmblock/vmblocktest.c (+1/-1)
tests/vmrpcdbg/Makefile.am (+2/-1)
tests/vmrpcdbg/Makefile.in (+73/-143)
tests/vmrpcdbg/debugChannel.c (+13/-6)
tests/vmrpcdbg/vmrpcdbg.c (+2/-1)
tests/vmrpcdbg/vmrpcdbgInt.h (+1/-1)
toolbox/Makefile.am (+1/-1)
toolbox/Makefile.in (+93/-176)
toolbox/l10n/de.vmsg (+24/-112)
toolbox/l10n/ja.vmsg (+24/-112)
toolbox/l10n/ko.vmsg (+24/-112)
toolbox/l10n/zh_CN.vmsg (+24/-112)
toolbox/toolbox-cmd.c (+5/-2)
toolbox/toolboxCmdInt.h (+1/-1)
toolbox/toolboxcmd-devices.c (+1/-1)
toolbox/toolboxcmd-scripts.c (+1/-1)
toolbox/toolboxcmd-shrink.c (+3/-2)
toolbox/toolboxcmd-stat.c (+49/-1)
toolbox/toolboxcmd-time.c (+1/-1)
toolbox/toolboxcmd_version.h (+1/-1)
vgauth/COPYING (+502/-0)
vgauth/Makefile.am (+21/-0)
vgauth/Makefile.in (+581/-0)
vgauth/cli/Makefile.am (+51/-0)
vgauth/cli/Makefile.in (+591/-0)
vgauth/cli/l10n/de.vmsg (+77/-0)
vgauth/cli/l10n/en.vmsg (+77/-0)
vgauth/cli/l10n/es.vmsg (+77/-0)
vgauth/cli/l10n/fr.vmsg (+77/-0)
vgauth/cli/l10n/it.vmsg (+77/-0)
vgauth/cli/l10n/ja.vmsg (+77/-0)
vgauth/cli/l10n/ko.vmsg (+77/-0)
vgauth/cli/l10n/zh_CN.vmsg (+77/-0)
vgauth/cli/l10n/zh_TW.vmsg (+77/-0)
vgauth/cli/main.c (+661/-0)
vgauth/common/VGAuthBasicDefs.h (+114/-0)
vgauth/common/VGAuthLog.c (+382/-0)
vgauth/common/VGAuthLog.h (+100/-0)
vgauth/common/VGAuthProto.h (+640/-0)
vgauth/common/VGAuthUtil.c (+311/-0)
vgauth/common/VGAuthUtil.h (+108/-0)
vgauth/common/audit.c (+213/-0)
vgauth/common/audit.h (+39/-0)
vgauth/common/certverify.c (+816/-0)
vgauth/common/certverify.h (+59/-0)
vgauth/common/createToken.h (+36/-0)
vgauth/common/i18n.c (+856/-0)
vgauth/common/i18n.h (+82/-0)
vgauth/common/prefs.c (+292/-0)
vgauth/common/prefs.h (+194/-0)
vgauth/common/s4u2self.h (+33/-0)
vgauth/common/serviceUser.h (+37/-0)
vgauth/common/usercheck.c (+488/-0)
vgauth/common/usercheck.h (+56/-0)
vgauth/lib/Makefile.am (+66/-0)
vgauth/lib/Makefile.in (+727/-0)
vgauth/lib/VGAuthInt.h (+323/-0)
vgauth/lib/alias.c (+643/-0)
vgauth/lib/auth.c (+627/-0)
vgauth/lib/authPosix.c (+438/-0)
vgauth/lib/comm.c (+466/-0)
vgauth/lib/common.c (+582/-0)
vgauth/lib/errortext.c (+170/-0)
vgauth/lib/impersonate.c (+414/-0)
vgauth/lib/impersonateLinux.c (+244/-0)
vgauth/lib/l10n/de.vmsg (+21/-0)
vgauth/lib/l10n/en.vmsg (+21/-0)
vgauth/lib/l10n/es.vmsg (+21/-0)
vgauth/lib/l10n/fr.vmsg (+21/-0)
vgauth/lib/l10n/it.vmsg (+21/-0)
vgauth/lib/l10n/ja.vmsg (+21/-0)
vgauth/lib/l10n/ko.vmsg (+21/-0)
vgauth/lib/l10n/zh_CN.vmsg (+21/-0)
vgauth/lib/l10n/zh_TW.vmsg (+21/-0)
vgauth/lib/netPosix.c (+310/-0)
vgauth/lib/proto.c (+2137/-0)
vgauth/public/VGAuthAlias.h (+185/-0)
vgauth/public/VGAuthAuthentication.h (+217/-0)
vgauth/public/VGAuthCommon.h (+129/-0)
vgauth/public/VGAuthError.h (+221/-0)
vgauth/public/VGAuthIdProvider.h (+185/-0)
vgauth/service/Makefile.am (+87/-0)
vgauth/service/Makefile.in (+900/-0)
vgauth/service/fileLogger.c (+327/-0)
vgauth/service/gio.c (+551/-0)
vgauth/service/l10n/de.vmsg (+46/-0)
vgauth/service/l10n/en.vmsg (+46/-0)
vgauth/service/l10n/es.vmsg (+72/-0)
vgauth/service/l10n/fr.vmsg (+46/-0)
vgauth/service/l10n/it.vmsg (+72/-0)
vgauth/service/l10n/ja.vmsg (+46/-0)
vgauth/service/l10n/ko.vmsg (+46/-0)
vgauth/service/l10n/zh_CN.vmsg (+46/-0)
vgauth/service/l10n/zh_TW.vmsg (+46/-0)
vgauth/service/log.c (+477/-0)
vgauth/service/main.c (+610/-0)
vgauth/service/service.h (+102/-0)
vgauth/service/servicePosix.c (+563/-0)
vgauth/service/signalSource.c (+340/-0)
vgauth/service/vgauth.conf (+3/-0)
vgauth/service/vgauthService_version.h (+39/-0)
vgauth/serviceImpl/alias.c (+3284/-0)
vgauth/serviceImpl/file.c (+88/-0)
vgauth/serviceImpl/filePosix.c (+407/-0)
vgauth/serviceImpl/netPosix.c (+513/-0)
vgauth/serviceImpl/proto.c (+2254/-0)
vgauth/serviceImpl/random.c (+124/-0)
vgauth/serviceImpl/saml.cpp (+1262/-0)
vgauth/serviceImpl/samlInt.hpp (+141/-0)
vgauth/serviceImpl/schemas/XMLSchema-hasFacetAndProperty.xsd (+142/-0)
vgauth/serviceImpl/schemas/XMLSchema-instance.xsd (+37/-0)
vgauth/serviceImpl/schemas/XMLSchema.dtd (+402/-0)
vgauth/serviceImpl/schemas/XMLSchema.xsd (+2424/-0)
vgauth/serviceImpl/schemas/datatypes.dtd (+203/-0)
vgauth/serviceImpl/schemas/saml-schema-assertion-2.0.xsd (+283/-0)
vgauth/serviceImpl/schemas/xenc-schema.xsd (+135/-0)
vgauth/serviceImpl/schemas/xml.xsd (+287/-0)
vgauth/serviceImpl/schemas/xmldsig-core-schema.xsd (+308/-0)
vgauth/serviceImpl/service.c (+1000/-0)
vgauth/serviceImpl/serviceInt.h (+500/-0)
vgauth/serviceImpl/ticket.c (+782/-0)
vgauth/serviceImpl/verify.c (+329/-0)
vmblock-fuse/Makefile.am (+1/-1)
vmblock-fuse/Makefile.in (+87/-171)
vmblock-fuse/fsops.c (+1/-1)
vmblock-fuse/fsops.h (+1/-1)
vmblock-fuse/main.c (+1/-1)
vmblock-fuse/os.h (+1/-1)
vmblock-fuse/util.c (+1/-1)
vmblockmounter/COPYING (+502/-0)
vmblockmounter/Makefile.am (+1/-1)
vmblockmounter/Makefile.in (+74/-156)
vmblockmounter/vmblockmounter.c (+3/-1)
vmblockmounter/vmblockmounter_version.h (+1/-1)
vmware-user-suid-wrapper/Makefile.am (+1/-1)
vmware-user-suid-wrapper/Makefile.in (+92/-200)
vmware-user-suid-wrapper/main.c (+2/-1)
vmware-user-suid-wrapper/wrapper-freebsd.c (+1/-1)
vmware-user-suid-wrapper/wrapper-linux.c (+1/-1)
vmware-user-suid-wrapper/wrapper-solaris.c (+1/-1)
vmware-user-suid-wrapper/wrapper.h (+1/-1)
vmware-user-suid-wrapper/wrapper_version.h (+1/-1)
xferlogs/Makefile.am (+1/-1)
xferlogs/Makefile.in (+83/-167)
xferlogs/xferlogs.c (+2/-1)
xferlogs/xferlogs_version.h (+1/-1)
To merge this branch: bzr merge lp:~rcj/ubuntu/wily/open-vm-tools/wily
Reviewer Review Type Date Requested Status
Robert C Jennings (community) Disapprove
Ubuntu branches Pending
Review via email: mp+309562@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Robert C Jennings (rcj) wrote :

Andrew, Wily has reached End-of-Life[1] and will no longer get updates. Additionally, this tree was not ready for merging as there is an issue with silent data corruption.

[1] https://wiki.ubuntu.com/Releases

review: Disapprove

Unmerged revisions

50. By Robert C Jennings

* Rename debian/local/run-vmblock\x2dfuse.mount to remove backslash for bzr
* Merge upstream Debian (9.10.0-2476743-4) into Ubuntu
  * [d7d898c4] Update package version in dkms file.
  * [4148c544] Also fix version number in modules/linux/dkms.sh.
  * [7967f7c1] Fix version number in configure.ac.
  * [4de8ff44] Add script to update patches.
  * [52b74910] Merge tag 'upstream/9.10.0-2476743'
  * [fddc317d] Refreshing patches for new upstream version.
  * [7b53f258] Add libmspack-dev as build-dependency.
  * [6b5841da] Add libssl-dev as build-dependency.
  * [de52be8e] Add libxerces-c-dev as build-dependency.
  * [17b2788a] Add libxml-security-c-dev as build-dependency.
  * [406817b6] Add patch to move from d_alias to d_u.d_alias.
  * [8df5b4ac] Adding patch to fix CVE-2014-4199.
  * [6b514014] Fix installation of systemd services.
  * [1130d9e9] Workaround for buggy dh_systemd_start.
  * [1d43a9e7] Remove the automount feature for vmblock-fuse.
  * [b06f93e5] Add mate-panel to xautostart.conf
  * [26a5da76] Workaround open-vm-tools-desktop upgrade failures.
  * [7f362040] Create /tmp/VMwareDnD for vmblock-fuse.
  * [c5f35c1b] Revert "Fix Breaks and Replaces Fields in debian/control"
  * [34797213] Fix Breaks and Replaces Fields in debian/control
  * [aff1eb77] Add udev rule for vsock.
  * [371e5d30] Move vsock udev rules into open-vm-tools.udev.
  * [edaeb2fd] Add systemd (auto)mount units for vmblock-fuse.
  * [171276e3] Remove update-rcd-params from dh_installinit.
  * [b04735fa] Ensure LINUX_BACKPORT is defined in patches/kuid_t-kgid_t-fix-for-3.12.
  * [01aaa407] Fix initramfs hook for the vmxnet module
  * [5279fa17] Move the dkms module location patch before otehr patches
  * [b1db2b5c] Move files belonging to modules in dkms package.
  * [d0ccee4f] Run #DEBHELPER# first in open-vm-tools-dkms.postinst.
  * [f680b4fa] Run update-initramfs in open-vm-tools-dkms.postrm.
  * [ef4bd019] Remove unused DEPRECATED define.
  * [5389dd1f] Some more fixes to make dkms build on 3.16
  * [4c1f5fa7] Drop dkms.conf patches.
  * [805ccb06] Tidying patches.
  * [519191ff] Fix dh_dkms call for new dkms.conf
  * [d493d4ce] Remove vmware-user-suid-wrapper.1 from open-vm-tools.
  * [d448e841] Merge tag 'upstream/9.4.6-1770165'
  * [969fc903] Ensure that vmware-user-suid-wrapper ships a suid bit.
  * [8067da08] Add -Wno-sizeof-pointer-memaccess gcc option.
  * [b5ba8c3b] refreshing patches.
  * [36cd39c6] Updating changelog.
  * [99f43e95] Revert "Add -Wno-sizeof-pointer-memaccess gcc option."
  * [bb95d814] Adding a patch from fedora instead of
  * [d6b2ad4a] Update manpages.
  * [3768ff7f] Better startup message if not in a vm.
  * [4d5dec19] Add patch for Debian 7.X os recognition.
  * [7b3d23c9] Refreshing patches.
  * [af20a700] Make patches/kuid_t-kgid_t-fix-for-3.12 compatible with older kernels.
  * [c4df056b] PIC handling in configure is broken.
  * [eafd8723] Rise the number of supported NICs.
  * [0ecb889e] Removing old transitional packages.
  * [5e039b52] Add missing Breaks/Replaces for file moves.
  * [9d01b21d] Fix vsock removal patch, add some missing ""
  * [2ae80665] Add e55039c_HGFS-Fix-Linux-client-symlinks patch again.
  * [d7f7e40e] Fix vsock removal patch (avoid { foo;; })
  * [9960cb11] Add gbp setting for merge info in changelog.
  * [645a5350] Remove old patch for the vsock module.
  * [4c8effb7] Fix patch to avoid building vmblock on kernel >= 3.0.
  * [2cbfa96d] Refreshing patches.
  * [be59923b] Do not build vsock on kernels >= 3.9
  * [6d36f49e] Move .desktop file into the -desktop package.
  * [ef406f81] Move /lib/modules-load.d/open-vm-tools.conf to open-vm-tools-dkms.
  * [56742c8c] Revert "Use /run/VMwareDnD instead of /tmp/VMwareDnD."
  * [c6df2503] Patch pam.d/vmtoolsd to use common-auth/account.
  * [4e45e2e8] Hot apply udev rule for disk timeout
  * [527525fc] fix syntax-error-in-dep5-copyright
  * [5f6b2a47] fix malformed-override open-vm-toolbox
  * [5aabaf79] fix manpage-has-errors-from-man
  * [f867443c] fix executable-not-elf-or-script
  * [f89024a1] fix file locations in copyright
  * [76dadf83] Add patch for CVE-2013-3237.
  * [fa7d4a63] Merge pull request #1 from yastupin/master
  * [115b8c49] Better permission handling.
  * [70fa10d1] Fix vmxnet initramfs-tools hook.
  * [9d3f3c9b] Move vmware-user-suid-wrapper into desktop package.
  * [49dc599d] Use /run/VMwareDnD instead of /tmp/VMwareDnD.
  * [d9467cd9] Dropping lintian override files.
  * [a7f7e5bd] Use libprocps-dev instead of libprocps0-dev.
  * [21214012] Use manpages-desktop as source folder for -desktop.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== removed directory '.pc/0001-kvers.patch'
2=== removed directory '.pc/0001-kvers.patch/modules'
3=== removed directory '.pc/0001-kvers.patch/modules/linux'
4=== removed directory '.pc/0001-kvers.patch/modules/linux/vmblock'
5=== removed file '.pc/0001-kvers.patch/modules/linux/vmblock/Makefile'
6--- .pc/0001-kvers.patch/modules/linux/vmblock/Makefile 2014-01-08 20:28:33 +0000
7+++ .pc/0001-kvers.patch/modules/linux/vmblock/Makefile 1970-01-01 00:00:00 +0000
8@@ -1,171 +0,0 @@
9-#!/usr/bin/make -f
10-##########################################################
11-# Copyright (C) 1998 VMware, Inc. All rights reserved.
12-#
13-# This program is free software; you can redistribute it and/or modify it
14-# under the terms of the GNU General Public License as published by the
15-# Free Software Foundation version 2 and no later version.
16-#
17-# This program is distributed in the hope that it will be useful, but
18-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20-# for more details.
21-#
22-# You should have received a copy of the GNU General Public License along
23-# with this program; if not, write to the Free Software Foundation, Inc.,
24-# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25-#
26-##########################################################
27-
28-####
29-#### VMware kernel module Makefile to be distributed externally
30-####
31-
32-####
33-#### SRCROOT _must_ be a relative path.
34-####
35-SRCROOT = .
36-
37-#
38-# open-vm-tools doesn't replicate shared source files for different modules;
39-# instead, files are kept in shared locations. So define a few useful macros
40-# to be able to handle both cases cleanly.
41-#
42-INCLUDE :=
43-ifdef OVT_SOURCE_DIR
44-AUTOCONF_DIR := $(OVT_SOURCE_DIR)/modules/linux/shared/autoconf
45-VMLIB_PATH = $(OVT_SOURCE_DIR)/lib/$(1)
46-INCLUDE += -I$(OVT_SOURCE_DIR)/modules/linux/shared
47-INCLUDE += -I$(OVT_SOURCE_DIR)/lib/include
48-else
49-AUTOCONF_DIR := $(SRCROOT)/shared/autoconf
50-INCLUDE += -I$(SRCROOT)/shared
51-endif
52-
53-
54-VM_UNAME = $(shell uname -r)
55-
56-# Header directory for the running kernel
57-ifdef LINUXINCLUDE
58-HEADER_DIR = $(LINUXINCLUDE)
59-else
60-HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include
61-endif
62-
63-BUILD_DIR = $(HEADER_DIR)/..
64-
65-DRIVER := vmblock
66-PRODUCT := tools-source
67-
68-# Grep program
69-GREP = /bin/grep
70-
71-vm_check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \
72- > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi)
73-vm_check_file = $(shell if test -f $(1); then echo "yes"; else echo "no"; fi)
74-
75-ifndef VM_KBUILD
76-VM_KBUILD := no
77-ifeq ($(call vm_check_file,$(BUILD_DIR)/Makefile), yes)
78-ifneq ($(call vm_check_file,$(BUILD_DIR)/Rules.make), yes)
79-VM_KBUILD := 26
80-endif
81-endif
82-export VM_KBUILD
83-endif
84-
85-ifndef VM_KBUILD_SHOWN
86-ifeq ($(VM_KBUILD), no)
87-VM_DUMMY := $(shell echo >&2 "Using standalone build system.")
88-else
89-ifeq ($(VM_KBUILD), 24)
90-VM_DUMMY := $(shell echo >&2 "Using 2.4.x kernel build system.")
91-else
92-VM_DUMMY := $(shell echo >&2 "Using 2.6.x kernel build system.")
93-endif
94-endif
95-VM_KBUILD_SHOWN := yes
96-export VM_KBUILD_SHOWN
97-endif
98-
99-ifneq ($(VM_KBUILD), no)
100-
101-VMCCVER := $(shell $(CC) -dumpversion)
102-
103-# If there is no version defined, we are in toplevel pass, not yet in kernel makefiles...
104-ifeq ($(VERSION),)
105-
106-ifeq ($(VM_KBUILD), 24)
107-DRIVER_KO := $(DRIVER).o
108-else
109-DRIVER_KO := $(DRIVER).ko
110-endif
111-
112-.PHONY: $(DRIVER_KO)
113-
114-auto-build: $(DRIVER_KO)
115- cp -f $< $(SRCROOT)/../$(DRIVER).o
116-
117-# $(DRIVER_KO) is a phony target, so compare file times explicitly
118-$(DRIVER): $(DRIVER_KO)
119- if [ $< -nt $@ ] || [ ! -e $@ ] ; then cp -f $< $@; fi
120-
121-# Pass gcc version down the chain, so we can detect if kernel attempts to use unapproved compiler
122-VM_CCVER := $(VMCCVER)
123-export VM_CCVER
124-VM_CC := $(CC)
125-export VM_CC
126-
127-MAKEOVERRIDES := $(filter-out CC=%,$(MAKEOVERRIDES))
128-
129-#
130-# Define a setup target that gets built before the actual driver.
131-# This target may not be used at all, but if it is then it will be defined
132-# in Makefile.kernel
133-#
134-prebuild:: ;
135-postbuild:: ;
136-
137-$(DRIVER_KO): prebuild
138- $(MAKE) -C $(BUILD_DIR) SUBDIRS=$$PWD SRCROOT=$$PWD/$(SRCROOT) \
139- MODULEBUILDDIR=$(MODULEBUILDDIR) modules
140- $(MAKE) -C $$PWD SRCROOT=$$PWD/$(SRCROOT) \
141- MODULEBUILDDIR=$(MODULEBUILDDIR) postbuild
142-endif
143-
144-vm_check_build = $(shell if $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \
145- $(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL) $(LINUXINCLUDE) \
146- $(EXTRA_CFLAGS) -Iinclude2/asm/mach-default \
147- -DKBUILD_BASENAME=\"$(DRIVER)\" \
148- -Werror -S -o /dev/null -xc $(1) \
149- > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)
150-
151-CC_WARNINGS := -Wall -Wstrict-prototypes
152-CC_OPTS := $(GLOBAL_DEFS) $(CC_WARNINGS) -DVMW_USING_KBUILD
153-ifdef VMX86_DEVEL
154-CC_OPTS += -DVMX86_DEVEL
155-endif
156-ifdef VMX86_DEBUG
157-CC_OPTS += -DVMX86_DEBUG
158-endif
159-
160-include $(SRCROOT)/Makefile.kernel
161-
162-ifdef TOPDIR
163-ifeq ($(VM_KBUILD), 24)
164-
165-O_TARGET := $(DRIVER).o
166-
167-obj-y := $($(DRIVER)-y)
168-
169-include $(TOPDIR)/Rules.make
170-endif
171-endif
172-
173-else
174-
175-include $(SRCROOT)/Makefile.normal
176-
177-endif
178-
179-#.SILENT:
180
181=== removed directory '.pc/0001-kvers.patch/modules/linux/vmci'
182=== removed file '.pc/0001-kvers.patch/modules/linux/vmci/Makefile'
183--- .pc/0001-kvers.patch/modules/linux/vmci/Makefile 2014-01-08 20:28:33 +0000
184+++ .pc/0001-kvers.patch/modules/linux/vmci/Makefile 1970-01-01 00:00:00 +0000
185@@ -1,171 +0,0 @@
186-#!/usr/bin/make -f
187-##########################################################
188-# Copyright (C) 1998 VMware, Inc. All rights reserved.
189-#
190-# This program is free software; you can redistribute it and/or modify it
191-# under the terms of the GNU General Public License as published by the
192-# Free Software Foundation version 2 and no later version.
193-#
194-# This program is distributed in the hope that it will be useful, but
195-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
196-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
197-# for more details.
198-#
199-# You should have received a copy of the GNU General Public License along
200-# with this program; if not, write to the Free Software Foundation, Inc.,
201-# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
202-#
203-##########################################################
204-
205-####
206-#### VMware kernel module Makefile to be distributed externally
207-####
208-
209-####
210-#### SRCROOT _must_ be a relative path.
211-####
212-SRCROOT = .
213-
214-#
215-# open-vm-tools doesn't replicate shared source files for different modules;
216-# instead, files are kept in shared locations. So define a few useful macros
217-# to be able to handle both cases cleanly.
218-#
219-INCLUDE :=
220-ifdef OVT_SOURCE_DIR
221-AUTOCONF_DIR := $(OVT_SOURCE_DIR)/modules/linux/shared/autoconf
222-VMLIB_PATH = $(OVT_SOURCE_DIR)/lib/$(1)
223-INCLUDE += -I$(OVT_SOURCE_DIR)/modules/linux/shared
224-INCLUDE += -I$(OVT_SOURCE_DIR)/lib/include
225-else
226-AUTOCONF_DIR := $(SRCROOT)/shared/autoconf
227-INCLUDE += -I$(SRCROOT)/shared
228-endif
229-
230-
231-VM_UNAME = $(shell uname -r)
232-
233-# Header directory for the running kernel
234-ifdef LINUXINCLUDE
235-HEADER_DIR = $(LINUXINCLUDE)
236-else
237-HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include
238-endif
239-
240-BUILD_DIR = $(HEADER_DIR)/..
241-
242-DRIVER := vmci
243-PRODUCT := tools-source
244-
245-# Grep program
246-GREP = /bin/grep
247-
248-vm_check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \
249- > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi)
250-vm_check_file = $(shell if test -f $(1); then echo "yes"; else echo "no"; fi)
251-
252-ifndef VM_KBUILD
253-VM_KBUILD := no
254-ifeq ($(call vm_check_file,$(BUILD_DIR)/Makefile), yes)
255-ifneq ($(call vm_check_file,$(BUILD_DIR)/Rules.make), yes)
256-VM_KBUILD := 26
257-endif
258-endif
259-export VM_KBUILD
260-endif
261-
262-ifndef VM_KBUILD_SHOWN
263-ifeq ($(VM_KBUILD), no)
264-VM_DUMMY := $(shell echo >&2 "Using standalone build system.")
265-else
266-ifeq ($(VM_KBUILD), 24)
267-VM_DUMMY := $(shell echo >&2 "Using 2.4.x kernel build system.")
268-else
269-VM_DUMMY := $(shell echo >&2 "Using 2.6.x kernel build system.")
270-endif
271-endif
272-VM_KBUILD_SHOWN := yes
273-export VM_KBUILD_SHOWN
274-endif
275-
276-ifneq ($(VM_KBUILD), no)
277-
278-VMCCVER := $(shell $(CC) -dumpversion)
279-
280-# If there is no version defined, we are in toplevel pass, not yet in kernel makefiles...
281-ifeq ($(VERSION),)
282-
283-ifeq ($(VM_KBUILD), 24)
284-DRIVER_KO := $(DRIVER).o
285-else
286-DRIVER_KO := $(DRIVER).ko
287-endif
288-
289-.PHONY: $(DRIVER_KO)
290-
291-auto-build: $(DRIVER_KO)
292- cp -f $< $(SRCROOT)/../$(DRIVER).o
293-
294-# $(DRIVER_KO) is a phony target, so compare file times explicitly
295-$(DRIVER): $(DRIVER_KO)
296- if [ $< -nt $@ ] || [ ! -e $@ ] ; then cp -f $< $@; fi
297-
298-# Pass gcc version down the chain, so we can detect if kernel attempts to use unapproved compiler
299-VM_CCVER := $(VMCCVER)
300-export VM_CCVER
301-VM_CC := $(CC)
302-export VM_CC
303-
304-MAKEOVERRIDES := $(filter-out CC=%,$(MAKEOVERRIDES))
305-
306-#
307-# Define a setup target that gets built before the actual driver.
308-# This target may not be used at all, but if it is then it will be defined
309-# in Makefile.kernel
310-#
311-prebuild:: ;
312-postbuild:: ;
313-
314-$(DRIVER_KO): prebuild
315- $(MAKE) -C $(BUILD_DIR) SUBDIRS=$$PWD SRCROOT=$$PWD/$(SRCROOT) \
316- MODULEBUILDDIR=$(MODULEBUILDDIR) modules
317- $(MAKE) -C $$PWD SRCROOT=$$PWD/$(SRCROOT) \
318- MODULEBUILDDIR=$(MODULEBUILDDIR) postbuild
319-endif
320-
321-vm_check_build = $(shell if $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \
322- $(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL) $(LINUXINCLUDE) \
323- $(EXTRA_CFLAGS) -Iinclude2/asm/mach-default \
324- -DKBUILD_BASENAME=\"$(DRIVER)\" \
325- -Werror -S -o /dev/null -xc $(1) \
326- > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)
327-
328-CC_WARNINGS := -Wall -Wstrict-prototypes
329-CC_OPTS := $(GLOBAL_DEFS) $(CC_WARNINGS) -DVMW_USING_KBUILD
330-ifdef VMX86_DEVEL
331-CC_OPTS += -DVMX86_DEVEL
332-endif
333-ifdef VMX86_DEBUG
334-CC_OPTS += -DVMX86_DEBUG
335-endif
336-
337-include $(SRCROOT)/Makefile.kernel
338-
339-ifdef TOPDIR
340-ifeq ($(VM_KBUILD), 24)
341-
342-O_TARGET := $(DRIVER).o
343-
344-obj-y := $($(DRIVER)-y)
345-
346-include $(TOPDIR)/Rules.make
347-endif
348-endif
349-
350-else
351-
352-include $(SRCROOT)/Makefile.normal
353-
354-endif
355-
356-#.SILENT:
357
358=== removed directory '.pc/0001-kvers.patch/modules/linux/vmhgfs'
359=== removed file '.pc/0001-kvers.patch/modules/linux/vmhgfs/Makefile'
360--- .pc/0001-kvers.patch/modules/linux/vmhgfs/Makefile 2014-01-08 20:28:33 +0000
361+++ .pc/0001-kvers.patch/modules/linux/vmhgfs/Makefile 1970-01-01 00:00:00 +0000
362@@ -1,171 +0,0 @@
363-#!/usr/bin/make -f
364-##########################################################
365-# Copyright (C) 1998 VMware, Inc. All rights reserved.
366-#
367-# This program is free software; you can redistribute it and/or modify it
368-# under the terms of the GNU General Public License as published by the
369-# Free Software Foundation version 2 and no later version.
370-#
371-# This program is distributed in the hope that it will be useful, but
372-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
373-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
374-# for more details.
375-#
376-# You should have received a copy of the GNU General Public License along
377-# with this program; if not, write to the Free Software Foundation, Inc.,
378-# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
379-#
380-##########################################################
381-
382-####
383-#### VMware kernel module Makefile to be distributed externally
384-####
385-
386-####
387-#### SRCROOT _must_ be a relative path.
388-####
389-SRCROOT = .
390-
391-#
392-# open-vm-tools doesn't replicate shared source files for different modules;
393-# instead, files are kept in shared locations. So define a few useful macros
394-# to be able to handle both cases cleanly.
395-#
396-INCLUDE :=
397-ifdef OVT_SOURCE_DIR
398-AUTOCONF_DIR := $(OVT_SOURCE_DIR)/modules/linux/shared/autoconf
399-VMLIB_PATH = $(OVT_SOURCE_DIR)/lib/$(1)
400-INCLUDE += -I$(OVT_SOURCE_DIR)/modules/linux/shared
401-INCLUDE += -I$(OVT_SOURCE_DIR)/lib/include
402-else
403-AUTOCONF_DIR := $(SRCROOT)/shared/autoconf
404-INCLUDE += -I$(SRCROOT)/shared
405-endif
406-
407-
408-VM_UNAME = $(shell uname -r)
409-
410-# Header directory for the running kernel
411-ifdef LINUXINCLUDE
412-HEADER_DIR = $(LINUXINCLUDE)
413-else
414-HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include
415-endif
416-
417-BUILD_DIR = $(HEADER_DIR)/..
418-
419-DRIVER := vmhgfs
420-PRODUCT := tools
421-
422-# Grep program
423-GREP = /bin/grep
424-
425-vm_check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \
426- > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi)
427-vm_check_file = $(shell if test -f $(1); then echo "yes"; else echo "no"; fi)
428-
429-ifndef VM_KBUILD
430-VM_KBUILD := no
431-ifeq ($(call vm_check_file,$(BUILD_DIR)/Makefile), yes)
432-ifneq ($(call vm_check_file,$(BUILD_DIR)/Rules.make), yes)
433-VM_KBUILD := 26
434-endif
435-endif
436-export VM_KBUILD
437-endif
438-
439-ifndef VM_KBUILD_SHOWN
440-ifeq ($(VM_KBUILD), no)
441-VM_DUMMY := $(shell echo >&2 "Using standalone build system.")
442-else
443-ifeq ($(VM_KBUILD), 24)
444-VM_DUMMY := $(shell echo >&2 "Using 2.4.x kernel build system.")
445-else
446-VM_DUMMY := $(shell echo >&2 "Using 2.6.x kernel build system.")
447-endif
448-endif
449-VM_KBUILD_SHOWN := yes
450-export VM_KBUILD_SHOWN
451-endif
452-
453-ifneq ($(VM_KBUILD), no)
454-
455-VMCCVER := $(shell $(CC) -dumpversion)
456-
457-# If there is no version defined, we are in toplevel pass, not yet in kernel makefiles...
458-ifeq ($(VERSION),)
459-
460-ifeq ($(VM_KBUILD), 24)
461-DRIVER_KO := $(DRIVER).o
462-else
463-DRIVER_KO := $(DRIVER).ko
464-endif
465-
466-.PHONY: $(DRIVER_KO)
467-
468-auto-build: $(DRIVER_KO)
469- cp -f $< $(SRCROOT)/../$(DRIVER).o
470-
471-# $(DRIVER_KO) is a phony target, so compare file times explicitly
472-$(DRIVER): $(DRIVER_KO)
473- if [ $< -nt $@ ] || [ ! -e $@ ] ; then cp -f $< $@; fi
474-
475-# Pass gcc version down the chain, so we can detect if kernel attempts to use unapproved compiler
476-VM_CCVER := $(VMCCVER)
477-export VM_CCVER
478-VM_CC := $(CC)
479-export VM_CC
480-
481-MAKEOVERRIDES := $(filter-out CC=%,$(MAKEOVERRIDES))
482-
483-#
484-# Define a setup target that gets built before the actual driver.
485-# This target may not be used at all, but if it is then it will be defined
486-# in Makefile.kernel
487-#
488-prebuild:: ;
489-postbuild:: ;
490-
491-$(DRIVER_KO): prebuild
492- $(MAKE) -C $(BUILD_DIR) SUBDIRS=$$PWD SRCROOT=$$PWD/$(SRCROOT) \
493- MODULEBUILDDIR=$(MODULEBUILDDIR) modules
494- $(MAKE) -C $$PWD SRCROOT=$$PWD/$(SRCROOT) \
495- MODULEBUILDDIR=$(MODULEBUILDDIR) postbuild
496-endif
497-
498-vm_check_build = $(shell if $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \
499- $(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL) $(LINUXINCLUDE) \
500- $(EXTRA_CFLAGS) -Iinclude2/asm/mach-default \
501- -DKBUILD_BASENAME=\"$(DRIVER)\" \
502- -Werror -S -o /dev/null -xc $(1) \
503- > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)
504-
505-CC_WARNINGS := -Wall -Wstrict-prototypes
506-CC_OPTS := $(GLOBAL_DEFS) $(CC_WARNINGS) -DVMW_USING_KBUILD
507-ifdef VMX86_DEVEL
508-CC_OPTS += -DVMX86_DEVEL
509-endif
510-ifdef VMX86_DEBUG
511-CC_OPTS += -DVMX86_DEBUG
512-endif
513-
514-include $(SRCROOT)/Makefile.kernel
515-
516-ifdef TOPDIR
517-ifeq ($(VM_KBUILD), 24)
518-
519-O_TARGET := $(DRIVER).o
520-
521-obj-y := $($(DRIVER)-y)
522-
523-include $(TOPDIR)/Rules.make
524-endif
525-endif
526-
527-else
528-
529-include $(SRCROOT)/Makefile.normal
530-
531-endif
532-
533-#.SILENT:
534
535=== removed directory '.pc/0001-kvers.patch/modules/linux/vmsync'
536=== removed file '.pc/0001-kvers.patch/modules/linux/vmsync/Makefile'
537--- .pc/0001-kvers.patch/modules/linux/vmsync/Makefile 2014-01-08 20:28:33 +0000
538+++ .pc/0001-kvers.patch/modules/linux/vmsync/Makefile 1970-01-01 00:00:00 +0000
539@@ -1,171 +0,0 @@
540-#!/usr/bin/make -f
541-##########################################################
542-# Copyright (C) 1998 VMware, Inc. All rights reserved.
543-#
544-# This program is free software; you can redistribute it and/or modify it
545-# under the terms of the GNU General Public License as published by the
546-# Free Software Foundation version 2 and no later version.
547-#
548-# This program is distributed in the hope that it will be useful, but
549-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
550-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
551-# for more details.
552-#
553-# You should have received a copy of the GNU General Public License along
554-# with this program; if not, write to the Free Software Foundation, Inc.,
555-# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
556-#
557-##########################################################
558-
559-####
560-#### VMware kernel module Makefile to be distributed externally
561-####
562-
563-####
564-#### SRCROOT _must_ be a relative path.
565-####
566-SRCROOT = .
567-
568-#
569-# open-vm-tools doesn't replicate shared source files for different modules;
570-# instead, files are kept in shared locations. So define a few useful macros
571-# to be able to handle both cases cleanly.
572-#
573-INCLUDE :=
574-ifdef OVT_SOURCE_DIR
575-AUTOCONF_DIR := $(OVT_SOURCE_DIR)/modules/linux/shared/autoconf
576-VMLIB_PATH = $(OVT_SOURCE_DIR)/lib/$(1)
577-INCLUDE += -I$(OVT_SOURCE_DIR)/modules/linux/shared
578-INCLUDE += -I$(OVT_SOURCE_DIR)/lib/include
579-else
580-AUTOCONF_DIR := $(SRCROOT)/shared/autoconf
581-INCLUDE += -I$(SRCROOT)/shared
582-endif
583-
584-
585-VM_UNAME = $(shell uname -r)
586-
587-# Header directory for the running kernel
588-ifdef LINUXINCLUDE
589-HEADER_DIR = $(LINUXINCLUDE)
590-else
591-HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include
592-endif
593-
594-BUILD_DIR = $(HEADER_DIR)/..
595-
596-DRIVER := vmsync
597-PRODUCT := tools
598-
599-# Grep program
600-GREP = /bin/grep
601-
602-vm_check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \
603- > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi)
604-vm_check_file = $(shell if test -f $(1); then echo "yes"; else echo "no"; fi)
605-
606-ifndef VM_KBUILD
607-VM_KBUILD := no
608-ifeq ($(call vm_check_file,$(BUILD_DIR)/Makefile), yes)
609-ifneq ($(call vm_check_file,$(BUILD_DIR)/Rules.make), yes)
610-VM_KBUILD := 26
611-endif
612-endif
613-export VM_KBUILD
614-endif
615-
616-ifndef VM_KBUILD_SHOWN
617-ifeq ($(VM_KBUILD), no)
618-VM_DUMMY := $(shell echo >&2 "Using standalone build system.")
619-else
620-ifeq ($(VM_KBUILD), 24)
621-VM_DUMMY := $(shell echo >&2 "Using 2.4.x kernel build system.")
622-else
623-VM_DUMMY := $(shell echo >&2 "Using 2.6.x kernel build system.")
624-endif
625-endif
626-VM_KBUILD_SHOWN := yes
627-export VM_KBUILD_SHOWN
628-endif
629-
630-ifneq ($(VM_KBUILD), no)
631-
632-VMCCVER := $(shell $(CC) -dumpversion)
633-
634-# If there is no version defined, we are in toplevel pass, not yet in kernel makefiles...
635-ifeq ($(VERSION),)
636-
637-ifeq ($(VM_KBUILD), 24)
638-DRIVER_KO := $(DRIVER).o
639-else
640-DRIVER_KO := $(DRIVER).ko
641-endif
642-
643-.PHONY: $(DRIVER_KO)
644-
645-auto-build: $(DRIVER_KO)
646- cp -f $< $(SRCROOT)/../$(DRIVER).o
647-
648-# $(DRIVER_KO) is a phony target, so compare file times explicitly
649-$(DRIVER): $(DRIVER_KO)
650- if [ $< -nt $@ ] || [ ! -e $@ ] ; then cp -f $< $@; fi
651-
652-# Pass gcc version down the chain, so we can detect if kernel attempts to use unapproved compiler
653-VM_CCVER := $(VMCCVER)
654-export VM_CCVER
655-VM_CC := $(CC)
656-export VM_CC
657-
658-MAKEOVERRIDES := $(filter-out CC=%,$(MAKEOVERRIDES))
659-
660-#
661-# Define a setup target that gets built before the actual driver.
662-# This target may not be used at all, but if it is then it will be defined
663-# in Makefile.kernel
664-#
665-prebuild:: ;
666-postbuild:: ;
667-
668-$(DRIVER_KO): prebuild
669- $(MAKE) -C $(BUILD_DIR) SUBDIRS=$$PWD SRCROOT=$$PWD/$(SRCROOT) \
670- MODULEBUILDDIR=$(MODULEBUILDDIR) modules
671- $(MAKE) -C $$PWD SRCROOT=$$PWD/$(SRCROOT) \
672- MODULEBUILDDIR=$(MODULEBUILDDIR) postbuild
673-endif
674-
675-vm_check_build = $(shell if $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \
676- $(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL) $(LINUXINCLUDE) \
677- $(EXTRA_CFLAGS) -Iinclude2/asm/mach-default \
678- -DKBUILD_BASENAME=\"$(DRIVER)\" \
679- -Werror -S -o /dev/null -xc $(1) \
680- > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)
681-
682-CC_WARNINGS := -Wall -Wstrict-prototypes
683-CC_OPTS := $(GLOBAL_DEFS) $(CC_WARNINGS) -DVMW_USING_KBUILD
684-ifdef VMX86_DEVEL
685-CC_OPTS += -DVMX86_DEVEL
686-endif
687-ifdef VMX86_DEBUG
688-CC_OPTS += -DVMX86_DEBUG
689-endif
690-
691-include $(SRCROOT)/Makefile.kernel
692-
693-ifdef TOPDIR
694-ifeq ($(VM_KBUILD), 24)
695-
696-O_TARGET := $(DRIVER).o
697-
698-obj-y := $($(DRIVER)-y)
699-
700-include $(TOPDIR)/Rules.make
701-endif
702-endif
703-
704-else
705-
706-include $(SRCROOT)/Makefile.normal
707-
708-endif
709-
710-#.SILENT:
711
712=== removed directory '.pc/0001-kvers.patch/modules/linux/vmxnet'
713=== removed file '.pc/0001-kvers.patch/modules/linux/vmxnet/Makefile'
714--- .pc/0001-kvers.patch/modules/linux/vmxnet/Makefile 2014-01-08 20:28:33 +0000
715+++ .pc/0001-kvers.patch/modules/linux/vmxnet/Makefile 1970-01-01 00:00:00 +0000
716@@ -1,171 +0,0 @@
717-#!/usr/bin/make -f
718-##########################################################
719-# Copyright (C) 1998 VMware, Inc. All rights reserved.
720-#
721-# This program is free software; you can redistribute it and/or modify it
722-# under the terms of the GNU General Public License as published by the
723-# Free Software Foundation version 2 and no later version.
724-#
725-# This program is distributed in the hope that it will be useful, but
726-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
727-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
728-# for more details.
729-#
730-# You should have received a copy of the GNU General Public License along
731-# with this program; if not, write to the Free Software Foundation, Inc.,
732-# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
733-#
734-##########################################################
735-
736-####
737-#### VMware kernel module Makefile to be distributed externally
738-####
739-
740-####
741-#### SRCROOT _must_ be a relative path.
742-####
743-SRCROOT = .
744-
745-#
746-# open-vm-tools doesn't replicate shared source files for different modules;
747-# instead, files are kept in shared locations. So define a few useful macros
748-# to be able to handle both cases cleanly.
749-#
750-INCLUDE :=
751-ifdef OVT_SOURCE_DIR
752-AUTOCONF_DIR := $(OVT_SOURCE_DIR)/modules/linux/shared/autoconf
753-VMLIB_PATH = $(OVT_SOURCE_DIR)/lib/$(1)
754-INCLUDE += -I$(OVT_SOURCE_DIR)/modules/linux/shared
755-INCLUDE += -I$(OVT_SOURCE_DIR)/lib/include
756-else
757-AUTOCONF_DIR := $(SRCROOT)/shared/autoconf
758-INCLUDE += -I$(SRCROOT)/shared
759-endif
760-
761-
762-VM_UNAME = $(shell uname -r)
763-
764-# Header directory for the running kernel
765-ifdef LINUXINCLUDE
766-HEADER_DIR = $(LINUXINCLUDE)
767-else
768-HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include
769-endif
770-
771-BUILD_DIR = $(HEADER_DIR)/..
772-
773-DRIVER := vmxnet
774-PRODUCT := tools-source
775-
776-# Grep program
777-GREP = /bin/grep
778-
779-vm_check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \
780- > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi)
781-vm_check_file = $(shell if test -f $(1); then echo "yes"; else echo "no"; fi)
782-
783-ifndef VM_KBUILD
784-VM_KBUILD := no
785-ifeq ($(call vm_check_file,$(BUILD_DIR)/Makefile), yes)
786-ifneq ($(call vm_check_file,$(BUILD_DIR)/Rules.make), yes)
787-VM_KBUILD := 26
788-endif
789-endif
790-export VM_KBUILD
791-endif
792-
793-ifndef VM_KBUILD_SHOWN
794-ifeq ($(VM_KBUILD), no)
795-VM_DUMMY := $(shell echo >&2 "Using standalone build system.")
796-else
797-ifeq ($(VM_KBUILD), 24)
798-VM_DUMMY := $(shell echo >&2 "Using 2.4.x kernel build system.")
799-else
800-VM_DUMMY := $(shell echo >&2 "Using 2.6.x kernel build system.")
801-endif
802-endif
803-VM_KBUILD_SHOWN := yes
804-export VM_KBUILD_SHOWN
805-endif
806-
807-ifneq ($(VM_KBUILD), no)
808-
809-VMCCVER := $(shell $(CC) -dumpversion)
810-
811-# If there is no version defined, we are in toplevel pass, not yet in kernel makefiles...
812-ifeq ($(VERSION),)
813-
814-ifeq ($(VM_KBUILD), 24)
815-DRIVER_KO := $(DRIVER).o
816-else
817-DRIVER_KO := $(DRIVER).ko
818-endif
819-
820-.PHONY: $(DRIVER_KO)
821-
822-auto-build: $(DRIVER_KO)
823- cp -f $< $(SRCROOT)/../$(DRIVER).o
824-
825-# $(DRIVER_KO) is a phony target, so compare file times explicitly
826-$(DRIVER): $(DRIVER_KO)
827- if [ $< -nt $@ ] || [ ! -e $@ ] ; then cp -f $< $@; fi
828-
829-# Pass gcc version down the chain, so we can detect if kernel attempts to use unapproved compiler
830-VM_CCVER := $(VMCCVER)
831-export VM_CCVER
832-VM_CC := $(CC)
833-export VM_CC
834-
835-MAKEOVERRIDES := $(filter-out CC=%,$(MAKEOVERRIDES))
836-
837-#
838-# Define a setup target that gets built before the actual driver.
839-# This target may not be used at all, but if it is then it will be defined
840-# in Makefile.kernel
841-#
842-prebuild:: ;
843-postbuild:: ;
844-
845-$(DRIVER_KO): prebuild
846- $(MAKE) -C $(BUILD_DIR) SUBDIRS=$$PWD SRCROOT=$$PWD/$(SRCROOT) \
847- MODULEBUILDDIR=$(MODULEBUILDDIR) modules
848- $(MAKE) -C $$PWD SRCROOT=$$PWD/$(SRCROOT) \
849- MODULEBUILDDIR=$(MODULEBUILDDIR) postbuild
850-endif
851-
852-vm_check_build = $(shell if $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \
853- $(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL) $(LINUXINCLUDE) \
854- $(EXTRA_CFLAGS) -Iinclude2/asm/mach-default \
855- -DKBUILD_BASENAME=\"$(DRIVER)\" \
856- -Werror -S -o /dev/null -xc $(1) \
857- > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)
858-
859-CC_WARNINGS := -Wall -Wstrict-prototypes
860-CC_OPTS := $(GLOBAL_DEFS) $(CC_WARNINGS) -DVMW_USING_KBUILD
861-ifdef VMX86_DEVEL
862-CC_OPTS += -DVMX86_DEVEL
863-endif
864-ifdef VMX86_DEBUG
865-CC_OPTS += -DVMX86_DEBUG
866-endif
867-
868-include $(SRCROOT)/Makefile.kernel
869-
870-ifdef TOPDIR
871-ifeq ($(VM_KBUILD), 24)
872-
873-O_TARGET := $(DRIVER).o
874-
875-obj-y := $($(DRIVER)-y)
876-
877-include $(TOPDIR)/Rules.make
878-endif
879-endif
880-
881-else
882-
883-include $(SRCROOT)/Makefile.normal
884-
885-endif
886-
887-#.SILENT:
888
889=== removed directory '.pc/0001-kvers.patch/modules/linux/vsock'
890=== removed file '.pc/0001-kvers.patch/modules/linux/vsock/Makefile'
891--- .pc/0001-kvers.patch/modules/linux/vsock/Makefile 2014-01-08 20:28:33 +0000
892+++ .pc/0001-kvers.patch/modules/linux/vsock/Makefile 1970-01-01 00:00:00 +0000
893@@ -1,171 +0,0 @@
894-#!/usr/bin/make -f
895-##########################################################
896-# Copyright (C) 1998 VMware, Inc. All rights reserved.
897-#
898-# This program is free software; you can redistribute it and/or modify it
899-# under the terms of the GNU General Public License as published by the
900-# Free Software Foundation version 2 and no later version.
901-#
902-# This program is distributed in the hope that it will be useful, but
903-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
904-# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
905-# for more details.
906-#
907-# You should have received a copy of the GNU General Public License along
908-# with this program; if not, write to the Free Software Foundation, Inc.,
909-# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
910-#
911-##########################################################
912-
913-####
914-#### VMware kernel module Makefile to be distributed externally
915-####
916-
917-####
918-#### SRCROOT _must_ be a relative path.
919-####
920-SRCROOT = .
921-
922-#
923-# open-vm-tools doesn't replicate shared source files for different modules;
924-# instead, files are kept in shared locations. So define a few useful macros
925-# to be able to handle both cases cleanly.
926-#
927-INCLUDE :=
928-ifdef OVT_SOURCE_DIR
929-AUTOCONF_DIR := $(OVT_SOURCE_DIR)/modules/linux/shared/autoconf
930-VMLIB_PATH = $(OVT_SOURCE_DIR)/lib/$(1)
931-INCLUDE += -I$(OVT_SOURCE_DIR)/modules/linux/shared
932-INCLUDE += -I$(OVT_SOURCE_DIR)/lib/include
933-else
934-AUTOCONF_DIR := $(SRCROOT)/shared/autoconf
935-INCLUDE += -I$(SRCROOT)/shared
936-endif
937-
938-
939-VM_UNAME = $(shell uname -r)
940-
941-# Header directory for the running kernel
942-ifdef LINUXINCLUDE
943-HEADER_DIR = $(LINUXINCLUDE)
944-else
945-HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include
946-endif
947-
948-BUILD_DIR = $(HEADER_DIR)/..
949-
950-DRIVER := vsock
951-PRODUCT := tools-source
952-
953-# Grep program
954-GREP = /bin/grep
955-
956-vm_check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \
957- > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi)
958-vm_check_file = $(shell if test -f $(1); then echo "yes"; else echo "no"; fi)
959-
960-ifndef VM_KBUILD
961-VM_KBUILD := no
962-ifeq ($(call vm_check_file,$(BUILD_DIR)/Makefile), yes)
963-ifneq ($(call vm_check_file,$(BUILD_DIR)/Rules.make), yes)
964-VM_KBUILD := 26
965-endif
966-endif
967-export VM_KBUILD
968-endif
969-
970-ifndef VM_KBUILD_SHOWN
971-ifeq ($(VM_KBUILD), no)
972-VM_DUMMY := $(shell echo >&2 "Using standalone build system.")
973-else
974-ifeq ($(VM_KBUILD), 24)
975-VM_DUMMY := $(shell echo >&2 "Using 2.4.x kernel build system.")
976-else
977-VM_DUMMY := $(shell echo >&2 "Using 2.6.x kernel build system.")
978-endif
979-endif
980-VM_KBUILD_SHOWN := yes
981-export VM_KBUILD_SHOWN
982-endif
983-
984-ifneq ($(VM_KBUILD), no)
985-
986-VMCCVER := $(shell $(CC) -dumpversion)
987-
988-# If there is no version defined, we are in toplevel pass, not yet in kernel makefiles...
989-ifeq ($(VERSION),)
990-
991-ifeq ($(VM_KBUILD), 24)
992-DRIVER_KO := $(DRIVER).o
993-else
994-DRIVER_KO := $(DRIVER).ko
995-endif
996-
997-.PHONY: $(DRIVER_KO)
998-
999-auto-build: $(DRIVER_KO)
1000- cp -f $< $(SRCROOT)/../$(DRIVER).o
1001-
1002-# $(DRIVER_KO) is a phony target, so compare file times explicitly
1003-$(DRIVER): $(DRIVER_KO)
1004- if [ $< -nt $@ ] || [ ! -e $@ ] ; then cp -f $< $@; fi
1005-
1006-# Pass gcc version down the chain, so we can detect if kernel attempts to use unapproved compiler
1007-VM_CCVER := $(VMCCVER)
1008-export VM_CCVER
1009-VM_CC := $(CC)
1010-export VM_CC
1011-
1012-MAKEOVERRIDES := $(filter-out CC=%,$(MAKEOVERRIDES))
1013-
1014-#
1015-# Define a setup target that gets built before the actual driver.
1016-# This target may not be used at all, but if it is then it will be defined
1017-# in Makefile.kernel
1018-#
1019-prebuild:: ;
1020-postbuild:: ;
1021-
1022-$(DRIVER_KO): prebuild
1023- $(MAKE) -C $(BUILD_DIR) SUBDIRS=$$PWD SRCROOT=$$PWD/$(SRCROOT) \
1024- MODULEBUILDDIR=$(MODULEBUILDDIR) modules
1025- $(MAKE) -C $$PWD SRCROOT=$$PWD/$(SRCROOT) \
1026- MODULEBUILDDIR=$(MODULEBUILDDIR) postbuild
1027-endif
1028-
1029-vm_check_build = $(shell if $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \
1030- $(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL) $(LINUXINCLUDE) \
1031- $(EXTRA_CFLAGS) -Iinclude2/asm/mach-default \
1032- -DKBUILD_BASENAME=\"$(DRIVER)\" \
1033- -Werror -S -o /dev/null -xc $(1) \
1034- > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)
1035-
1036-CC_WARNINGS := -Wall -Wstrict-prototypes
1037-CC_OPTS := $(GLOBAL_DEFS) $(CC_WARNINGS) -DVMW_USING_KBUILD
1038-ifdef VMX86_DEVEL
1039-CC_OPTS += -DVMX86_DEVEL
1040-endif
1041-ifdef VMX86_DEBUG
1042-CC_OPTS += -DVMX86_DEBUG
1043-endif
1044-
1045-include $(SRCROOT)/Makefile.kernel
1046-
1047-ifdef TOPDIR
1048-ifeq ($(VM_KBUILD), 24)
1049-
1050-O_TARGET := $(DRIVER).o
1051-
1052-obj-y := $($(DRIVER)-y)
1053-
1054-include $(TOPDIR)/Rules.make
1055-endif
1056-endif
1057-
1058-else
1059-
1060-include $(SRCROOT)/Makefile.normal
1061-
1062-endif
1063-
1064-#.SILENT:
1065
1066=== removed directory '.pc/0002-dkms.patch'
1067=== removed directory '.pc/0002-dkms.patch/modules'
1068=== removed directory '.pc/0002-dkms.patch/modules/linux'
1069=== removed file '.pc/0002-dkms.patch/modules/linux/dkms.conf'
1070--- .pc/0002-dkms.patch/modules/linux/dkms.conf 2014-01-08 20:28:33 +0000
1071+++ .pc/0002-dkms.patch/modules/linux/dkms.conf 1970-01-01 00:00:00 +0000
1072@@ -1,39 +0,0 @@
1073-PACKAGE_NAME=open-vm-tools
1074-PACKAGE_VERSION=9.4.0
1075-MAKE_CMD_TMPL="make VM_UNAME=\$kernelver \
1076- MODULEBUILDDIR=$dkms_tree/$PACKAGE_NAME/$PACKAGE_VERSION/build"
1077-
1078-# The vsock module depends on symbols exported by the vmci module, so it
1079-# needs to be built afterwards; the MODULEBUILDDIR variable tells the makefiles
1080-# where to store / retrive those symbol files.
1081-MAKE[0]="$MAKE_CMD_TMPL -C vmblock; \
1082- $MAKE_CMD_TMPL -C vmci; \
1083- $MAKE_CMD_TMPL -C vmhgfs; \
1084- $MAKE_CMD_TMPL -C vmsync; \
1085- $MAKE_CMD_TMPL -C vmxnet; \
1086- $MAKE_CMD_TMPL -C vsock"
1087-CLEAN[0]="$MAKE_CMD_TMPL -C vmblock clean; \
1088- $MAKE_CMD_TMPL -C vmci clean; \
1089- $MAKE_CMD_TMPL -C vmhgfs clean; \
1090- $MAKE_CMD_TMPL -C vmsync clean"; \
1091- $MAKE_CMD_TMPL -C vmxnet clean; \
1092- $MAKE_CMD_TMPL -C vsock clean
1093-BUILT_MODULE_NAME[0]="vmblock"
1094-BUILT_MODULE_NAME[1]="vmci"
1095-BUILT_MODULE_NAME[2]="vmhgfs"
1096-BUILT_MODULE_NAME[3]="vmsync"
1097-BUILT_MODULE_NAME[4]="vmxnet"
1098-BUILT_MODULE_NAME[5]="vsock"
1099-BUILT_MODULE_LOCATION[0]="vmblock/"
1100-BUILT_MODULE_LOCATION[1]="vmci/"
1101-BUILT_MODULE_LOCATION[2]="vmhgfs/"
1102-BUILT_MODULE_LOCATION[3]="vmsync/"
1103-BUILT_MODULE_LOCATION[4]="vmxnet/"
1104-BUILT_MODULE_LOCATION[5]="vsock/"
1105-DEST_MODULE_LOCATION[0]="/kernel/fs/vmblock"
1106-DEST_MODULE_LOCATION[1]="/kernel/drivers/misc"
1107-DEST_MODULE_LOCATION[2]="/kernel/fs/vmhgfs"
1108-DEST_MODULE_LOCATION[3]="/kernel/drivers/misc"
1109-DEST_MODULE_LOCATION[4]="/kernel/drivers/net"
1110-DEST_MODULE_LOCATION[5]="/kernel/net/vsock"
1111-AUTOINSTALL="YES"
1112
1113=== removed directory '.pc/0004-vsock-cve.patch'
1114=== removed directory '.pc/0004-vsock-cve.patch/modules'
1115=== removed directory '.pc/0004-vsock-cve.patch/modules/linux'
1116=== removed directory '.pc/0004-vsock-cve.patch/modules/linux/vsock'
1117=== removed directory '.pc/0004-vsock-cve.patch/modules/linux/vsock/linux'
1118=== removed file '.pc/0004-vsock-cve.patch/modules/linux/vsock/linux/af_vsock.c'
1119--- .pc/0004-vsock-cve.patch/modules/linux/vsock/linux/af_vsock.c 2014-01-08 20:28:33 +0000
1120+++ .pc/0004-vsock-cve.patch/modules/linux/vsock/linux/af_vsock.c 1970-01-01 00:00:00 +0000
1121@@ -1,6081 +0,0 @@
1122-/*********************************************************
1123- * Copyright (C) 2007-2011 VMware, Inc. All rights reserved.
1124- *
1125- * This program is free software; you can redistribute it and/or modify it
1126- * under the terms of the GNU General Public License as published by the
1127- * Free Software Foundation version 2 and no later version.
1128- *
1129- * This program is distributed in the hope that it will be useful, but
1130- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
1131- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1132- * for more details.
1133- *
1134- * You should have received a copy of the GNU General Public License along
1135- * with this program; if not, write to the Free Software Foundation, Inc.,
1136- * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1137- *
1138- *********************************************************/
1139-
1140-/*
1141- * af_vsock.c --
1142- *
1143- * Linux socket module for the VMCI Sockets protocol family.
1144- */
1145-
1146-
1147-/*
1148- * Implementation notes:
1149- *
1150- * - There are two kinds of sockets: those created by user action (such as
1151- * calling socket(2)) and those created by incoming connection request
1152- * packets.
1153- *
1154- * - There are two "global" tables, one for bound sockets (sockets that have
1155- * specified an address that they are responsible for) and one for connected
1156- * sockets (sockets that have established a connection with another socket).
1157- * These tables are "global" in that all sockets on the system are placed
1158- * within them.
1159- * - Note, though, that the bound table contains an extra entry for a list of
1160- * unbound sockets and SOCK_DGRAM sockets will always remain in that list.
1161- * The bound table is used solely for lookup of sockets when packets are
1162- * received and that's not necessary for SOCK_DGRAM sockets since we create
1163- * a datagram handle for each and need not perform a lookup. Keeping
1164- * SOCK_DGRAM sockets out of the bound hash buckets will reduce the chance
1165- * of collisions when looking for SOCK_STREAM sockets and prevents us from
1166- * having to check the socket type in the hash table lookups.
1167- *
1168- * - Sockets created by user action will either be "client" sockets that
1169- * initiate a connection or "server" sockets that listen for connections; we
1170- * do not support simultaneous connects (two "client" sockets connecting).
1171- *
1172- * - "Server" sockets are referred to as listener sockets throughout this
1173- * implementation because they are in the SS_LISTEN state. When a connection
1174- * request is received (the second kind of socket mentioned above), we create
1175- * a new socket and refer to it as a pending socket. These pending sockets
1176- * are placed on the pending connection list of the listener socket. When
1177- * future packets are received for the address the listener socket is bound
1178- * to, we check if the source of the packet is from one that has an existing
1179- * pending connection. If it does, we process the packet for the pending
1180- * socket. When that socket reaches the connected state, it is removed from
1181- * the listener socket's pending list and enqueued in the listener socket's
1182- * accept queue. Callers of accept(2) will accept connected sockets from the
1183- * listener socket's accept queue. If the socket cannot be accepted for some
1184- * reason then it is marked rejected. Once the connection is accepted, it is
1185- * owned by the user process and the responsibility for cleanup falls with
1186- * that user process.
1187- *
1188- * - It is possible that these pending sockets will never reach the connected
1189- * state; in fact, we may never receive another packet after the connection
1190- * request. Because of this, we must schedule a cleanup function to run in
1191- * the future, after some amount of time passes where a connection should
1192- * have been established. This function ensures that the socket is off all
1193- * lists so it cannot be retrieved, then drops all references to the socket
1194- * so it is cleaned up (sock_put() -> sk_free() -> our sk_destruct
1195- * implementation). Note this function will also cleanup rejected sockets,
1196- * those that reach the connected state but leave it before they have been
1197- * accepted.
1198- *
1199- * - Sockets created by user action will be cleaned up when the user
1200- * process calls close(2), causing our release implementation to be called.
1201- * Our release implementation will perform some cleanup then drop the
1202- * last reference so our sk_destruct implementation is invoked. Our
1203- * sk_destruct implementation will perform additional cleanup that's common
1204- * for both types of sockets.
1205- *
1206- * - A socket's reference count is what ensures that the structure won't be
1207- * freed. Each entry in a list (such as the "global" bound and connected
1208- * tables and the listener socket's pending list and connected queue) ensures
1209- * a reference. When we defer work until process context and pass a socket
1210- * as our argument, we must ensure the reference count is increased to ensure
1211- * the socket isn't freed before the function is run; the deferred function
1212- * will then drop the reference.
1213- *
1214- */
1215-
1216-#include "driver-config.h"
1217-
1218-#define EXPORT_SYMTAB
1219-#include <linux/kmod.h>
1220-#include <linux/socket.h>
1221-#include <linux/net.h>
1222-#include <linux/skbuff.h>
1223-#include <linux/miscdevice.h>
1224-#include <linux/poll.h>
1225-#include <linux/smp.h>
1226-#include <linux/bitops.h>
1227-#include <linux/list.h>
1228-#include <linux/wait.h>
1229-#include <linux/init.h>
1230-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14)
1231-# include <net/tcp_states.h>
1232-#else
1233-# include <linux/tcp.h>
1234-#endif
1235-#include <asm/io.h>
1236-#if defined(__x86_64__) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 12)
1237-# include <linux/ioctl32.h>
1238-/* Use weak: not all kernels export sys_ioctl for use by modules */
1239-asmlinkage __attribute__((weak)) long
1240-sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg);
1241-#endif
1242-
1243-#include "compat_cred.h"
1244-#include "compat_module.h"
1245-#include "compat_kernel.h"
1246-#include "compat_sock.h"
1247-#include "compat_version.h"
1248-#include "compat_workqueue.h"
1249-#include "compat_mutex.h"
1250-
1251-#include "vmware.h"
1252-
1253-#include "vsockCommon.h"
1254-#include "vsockPacket.h"
1255-#include "vsockVmci.h"
1256-
1257-#include "vmci_iocontrols.h"
1258-
1259-#include "af_vsock.h"
1260-#include "stats.h"
1261-#include "util.h"
1262-#include "vsock_version.h"
1263-#include "driverLog.h"
1264-
1265-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 9)
1266-# error "Linux kernels before 2.6.9 are not supported."
1267-#endif
1268-
1269-/*
1270- * All kernels above 2.6.33 have the kern parameter for the create
1271- * call in struct net_proto_family.
1272- */
1273-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33) && \
1274- !defined(VMW_NETCREATE_KERNARG)
1275-# define VMW_NETCREATE_KERNARG
1276-#endif
1277-
1278-#define VSOCK_INVALID_FAMILY NPROTO
1279-#define VSOCK_AF_IS_REGISTERED(val) ((val) >= 0 && (val) < NPROTO)
1280-
1281-/* Some kernel versions don't define __user. Define it ourself if so. */
1282-#ifndef __user
1283-#define __user
1284-#endif
1285-
1286-
1287-/*
1288- * Prototypes
1289- */
1290-int VSockVmci_GetAFValue(void);
1291-
1292-/* Internal functions. */
1293-static Bool VSockVmciProtoToNotifyStruct(struct sock *sk,
1294- VSockProtoVersion *proto,
1295- Bool oldPktProto);
1296-static int VSockVmciGetAFValue(void);
1297-static int VSockVmciRecvDgramCB(void *data, VMCIDatagram *dg);
1298-static int VSockVmciRecvSeqCB(void *data, VMCIDatagram *dg);
1299-static int VSockVmciRecvStreamCB(void *data, VMCIDatagram *dg);
1300-static void VSockVmciPeerAttachCB(VMCIId subId,
1301- VMCI_EventData *ed, void *clientData);
1302-static void VSockVmciPeerDetachCB(VMCIId subId,
1303- VMCI_EventData *ed, void *clientData);
1304-static void VSockVmciRecvPktWork(compat_work_arg work);
1305-static int VSockVmciRecvListen(struct sock *sk, VSockPacket *pkt);
1306-static int VSockVmciRecvConnectingServer(struct sock *sk,
1307- struct sock *pending, VSockPacket *pkt);
1308-static int VSockVmciRecvConnectingClient(struct sock *sk, VSockPacket *pkt);
1309-static int VSockVmciRecvConnectingClientNegotiate(struct sock *sk,
1310- VSockPacket *pkt);
1311-static int VSockVmciRecvConnectingClientInvalid(struct sock *sk,
1312- VSockPacket *pkt);
1313-static int VSockVmciRecvConnected(struct sock *sk, VSockPacket *pkt);
1314-static int __VSockVmciBind(struct sock *sk, struct sockaddr_vm *addr);
1315-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 14)
1316-static struct sock *__VSockVmciCreate(struct socket *sock, struct sock *parent,
1317- unsigned int priority, unsigned short type);
1318-#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)
1319-static struct sock *__VSockVmciCreate(struct socket *sock, struct sock *parent,
1320- gfp_t priority, unsigned short type);
1321-#else
1322-static struct sock *__VSockVmciCreate(struct net *net,
1323- struct socket *sock, struct sock *parent,
1324- gfp_t priority, unsigned short type);
1325-#endif
1326-static void VSockVmciTestUnregister(void);
1327-static int VSockVmciRegisterWithVmci(void);
1328-static void VSockVmciUnregisterWithVmci(void);
1329-static int VSockVmciRegisterAddressFamily(void);
1330-static void VSockVmciUnregisterAddressFamily(void);
1331-
1332-/* Socket operations. */
1333-static void VSockVmciSkDestruct(struct sock *sk);
1334-static int VSockVmciQueueRcvSkb(struct sock *sk, struct sk_buff *skb);
1335-static int VSockVmciRelease(struct socket *sock);
1336-static int VSockVmciBind(struct socket *sock,
1337- struct sockaddr *addr, int addrLen);
1338-static int VSockVmciDgramConnect(struct socket *sock,
1339- struct sockaddr *addr, int addrLen, int flags);
1340-static int VSockVmciSeqConnect(struct socket *sock,
1341- struct sockaddr *addr, int addrLen, int flags);
1342-static int VSockVmciStreamConnect(struct socket *sock,
1343- struct sockaddr *addr, int addrLen, int flags);
1344-static int VSockVmciAccept(struct socket *sock, struct socket *newsock, int flags);
1345-static int VSockVmciGetname(struct socket *sock,
1346- struct sockaddr *addr, int *addrLen, int peer);
1347-static unsigned int VSockVmciPoll(struct file *file,
1348- struct socket *sock, poll_table *wait);
1349-static int VSockVmciListen(struct socket *sock, int backlog);
1350-static int VSockVmciShutdown(struct socket *sock, int mode);
1351-
1352-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 32)
1353-typedef int VSockSetsockoptLenType;
1354-#else
1355-typedef unsigned int VSockSetsockoptLenType;
1356-#endif
1357-static int VSockVmciStreamSetsockopt(struct socket *sock, int level, int optname,
1358- char __user *optval,
1359- VSockSetsockoptLenType optlen);
1360-
1361-static int VSockVmciStreamGetsockopt(struct socket *sock, int level, int optname,
1362- char __user *optval, int __user * optlen);
1363-
1364-static int VSockVmciDgramSendmsg(struct kiocb *kiocb,
1365- struct socket *sock, struct msghdr *msg, size_t len);
1366-static int VSockVmciDgramRecvmsg(struct kiocb *kiocb, struct socket *sock,
1367- struct msghdr *msg, size_t len, int flags);
1368-static int VSockVmciSeqSendmsg(struct kiocb *kiocb,
1369- struct socket *sock, struct msghdr *msg, size_t len);
1370-static int VSockVmciSeqRecvmsg(struct kiocb *kiocb, struct socket *sock,
1371- struct msghdr *msg, size_t len, int flags);
1372-static int VSockVmciStreamSendmsg(struct kiocb *kiocb,
1373- struct socket *sock, struct msghdr *msg, size_t len);
1374-static int VSockVmciStreamRecvmsg(struct kiocb *kiocb, struct socket *sock,
1375- struct msghdr *msg, size_t len, int flags);
1376-
1377-static int VSockVmciCreate(
1378-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)
1379- struct net *net,
1380-#endif
1381- struct socket *sock, int protocol
1382-#ifdef VMW_NETCREATE_KERNARG
1383- , int kern
1384-#endif
1385- );
1386-
1387-
1388-/*
1389- * Device operations.
1390- */
1391-int VSockVmciDevOpen(struct inode *inode, struct file *file);
1392-int VSockVmciDevRelease(struct inode *inode, struct file *file);
1393-static int VSockVmciDevIoctl(struct inode *inode, struct file *filp,
1394- u_int iocmd, unsigned long ioarg);
1395-#if defined(HAVE_COMPAT_IOCTL) || defined(HAVE_UNLOCKED_IOCTL)
1396-static long VSockVmciDevUnlockedIoctl(struct file *filp,
1397- u_int iocmd, unsigned long ioarg);
1398-#endif
1399-
1400-/*
1401- * Variables.
1402- */
1403-
1404-/* Protocol family. */
1405-static struct proto vsockVmciProto = {
1406- .name = "AF_VMCI",
1407-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 10)
1408- /* Added in 2.6.10. */
1409- .owner = THIS_MODULE,
1410-#endif
1411- /*
1412- * From 2.6.9 until 2.6.11, these address families called sk_alloc_slab()
1413- * and the allocated slab was assigned to the slab variable in the proto
1414- * struct and was created of size slab_obj_size.
1415- * As of 2.6.12 and later, this slab allocation was moved into
1416- * proto_register() and only done if you specified a non-zero value for
1417- * the second argument (alloc_slab); the size of the slab element was
1418- * changed to obj_size.
1419- */
1420-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 12)
1421- .slab_obj_size = sizeof (VSockVmciSock),
1422-#else
1423- .obj_size = sizeof (VSockVmciSock),
1424-#endif
1425-};
1426-
1427-static struct net_proto_family vsockVmciFamilyOps = {
1428- .family = VSOCK_INVALID_FAMILY,
1429- .create = VSockVmciCreate,
1430- .owner = THIS_MODULE,
1431-};
1432-
1433-/* Socket operations, split for DGRAM, STREAM and SEQPACKET sockets. */
1434-static struct proto_ops vsockVmciDgramOps = {
1435- .family = VSOCK_INVALID_FAMILY,
1436- .owner = THIS_MODULE,
1437- .release = VSockVmciRelease,
1438- .bind = VSockVmciBind,
1439- .connect = VSockVmciDgramConnect,
1440- .socketpair = sock_no_socketpair,
1441- .accept = sock_no_accept,
1442- .getname = VSockVmciGetname,
1443- .poll = VSockVmciPoll,
1444- .ioctl = sock_no_ioctl,
1445- .listen = sock_no_listen,
1446- .shutdown = VSockVmciShutdown,
1447- .setsockopt = sock_no_setsockopt,
1448- .getsockopt = sock_no_getsockopt,
1449- .sendmsg = VSockVmciDgramSendmsg,
1450- .recvmsg = VSockVmciDgramRecvmsg,
1451- .mmap = sock_no_mmap,
1452- .sendpage = sock_no_sendpage,
1453-};
1454-
1455-static struct proto_ops vsockVmciSeqOps = {
1456- .family = VSOCK_INVALID_FAMILY,
1457- .owner = THIS_MODULE,
1458- .release = VSockVmciRelease,
1459- .bind = VSockVmciBind,
1460- .connect = VSockVmciSeqConnect,
1461- .socketpair = sock_no_socketpair,
1462- .accept = sock_no_accept,
1463- .getname = VSockVmciGetname,
1464- .poll = VSockVmciPoll,
1465- .ioctl = sock_no_ioctl,
1466- .listen = sock_no_listen,
1467- .shutdown = VSockVmciShutdown,
1468- .setsockopt = sock_no_setsockopt,
1469- .getsockopt = sock_no_getsockopt,
1470- .sendmsg = VSockVmciSeqSendmsg,
1471- .recvmsg = VSockVmciSeqRecvmsg,
1472- .mmap = sock_no_mmap,
1473- .sendpage = sock_no_sendpage,
1474-};
1475-
1476-static struct proto_ops vsockVmciStreamOps = {
1477- .family = VSOCK_INVALID_FAMILY,
1478- .owner = THIS_MODULE,
1479- .release = VSockVmciRelease,
1480- .bind = VSockVmciBind,
1481- .connect = VSockVmciStreamConnect,
1482- .socketpair = sock_no_socketpair,
1483- .accept = VSockVmciAccept,
1484- .getname = VSockVmciGetname,
1485- .poll = VSockVmciPoll,
1486- .ioctl = sock_no_ioctl,
1487- .listen = VSockVmciListen,
1488- .shutdown = VSockVmciShutdown,
1489- .setsockopt = VSockVmciStreamSetsockopt,
1490- .getsockopt = VSockVmciStreamGetsockopt,
1491- .sendmsg = VSockVmciStreamSendmsg,
1492- .recvmsg = VSockVmciStreamRecvmsg,
1493- .mmap = sock_no_mmap,
1494- .sendpage = sock_no_sendpage,
1495-};
1496-
1497-static struct file_operations vsockVmciDeviceOps = {
1498- .owner = THIS_MODULE,
1499-#ifdef HAVE_UNLOCKED_IOCTL
1500- .unlocked_ioctl = VSockVmciDevUnlockedIoctl,
1501-#else
1502- .ioctl = VSockVmciDevIoctl,
1503-#endif
1504-#ifdef HAVE_COMPAT_IOCTL
1505- .compat_ioctl = VSockVmciDevUnlockedIoctl,
1506-#endif
1507- .open = VSockVmciDevOpen,
1508- .release = VSockVmciDevRelease,
1509-};
1510-
1511-static struct miscdevice vsockVmciDevice = {
1512- .name = "vsock",
1513- .minor = MISC_DYNAMIC_MINOR,
1514- .fops = &vsockVmciDeviceOps,
1515-};
1516-
1517-typedef struct VSockRecvPktInfo {
1518- compat_work work;
1519- struct sock *sk;
1520- VSockPacket pkt;
1521-} VSockRecvPktInfo;
1522-
1523-static compat_define_mutex(registrationMutex);
1524-static int devOpenCount = 0;
1525-static int vsockVmciSocketCount = 0;
1526-static int vsockVmciKernClientCount = 0;
1527-static Bool vmciDevicePresent = FALSE;
1528-static VMCIHandle vmciStreamHandle = { VMCI_INVALID_ID, VMCI_INVALID_ID };
1529-static VMCIId qpResumedSubId = VMCI_INVALID_ID;
1530-static VMCIId ctxUpdatedSubId = VMCI_INVALID_ID;
1531-
1532-static int PROTOCOL_OVERRIDE = -1;
1533-
1534-/*
1535- * Netperf benchmarks have shown significant throughput improvements when the
1536- * QP size is bumped from 64k to 256k. These measurements were taken during the
1537- * K/L.next timeframe. Give users better performance by default.
1538- */
1539-#define VSOCK_DEFAULT_QP_SIZE_MIN 128
1540-#define VSOCK_DEFAULT_QP_SIZE 262144
1541-#define VSOCK_DEFAULT_QP_SIZE_MAX 262144
1542-
1543-/*
1544- * The default peer timeout indicates how long we will wait for a peer
1545- * response to a control message.
1546- */
1547-#define VSOCK_DEFAULT_CONNECT_TIMEOUT (2 * HZ)
1548-
1549-#define VSOCK_SEND_SEQ_CLOSE(_vsk, _err) \
1550- VSockVmciSendSeqPacket((_vsk), VSOCK_SEQ_PACKET_TYPE_CLOSE, (_err))
1551-#define VSOCK_SEND_SEQ_SHUTDOWN(_vsk, _mode) \
1552- VSockVmciSendSeqPacket((_vsk), VSOCK_SEQ_PACKET_TYPE_SHUTDOWN, (_mode))
1553-
1554-#ifdef VMX86_DEVEL
1555-# define LOG_PACKET(_pkt) VSockVmciLogPkt(__FUNCTION__, __LINE__, _pkt)
1556-#else
1557-# define LOG_PACKET(_pkt)
1558-#endif
1559-
1560-
1561-/*
1562- *----------------------------------------------------------------------------
1563- *
1564- * VSockVmciOldProtoOverride --
1565- *
1566- * Check to see if the user has asked us to override all sockets to use
1567- * the vsock notify protocol.
1568- *
1569- * Results:
1570- * TRUE if there is a protocol override in effect.
1571- * - oldPktProto is TRUE the original protocol should be used.
1572- * FALSE if there is no override in effect.
1573- *
1574- * Side effects:
1575- * None.
1576- *
1577- *----------------------------------------------------------------------------
1578- */
1579-
1580-static Bool
1581-VSockVmciOldProtoOverride(Bool *oldPktProto) // IN
1582-{
1583- ASSERT(oldPktProto);
1584-
1585- if (PROTOCOL_OVERRIDE != -1) {
1586- if (PROTOCOL_OVERRIDE == 0) {
1587- *oldPktProto = TRUE;
1588- } else {
1589- *oldPktProto = FALSE;
1590- }
1591- Warning("Proto override in use.\n");
1592- return TRUE;
1593- }
1594-
1595- return FALSE;
1596-}
1597-
1598-
1599-/*
1600- *----------------------------------------------------------------------------
1601- *
1602- * VSockVmciProtoToNotifyStruct --
1603- *
1604- * Given a particular notify protocol version, setup the socket's notify
1605- * struct correctly.
1606- *
1607- * Results:
1608- * TRUE on success. FALSE otherwise.
1609- *
1610- * Side effects:
1611- * None.
1612- *
1613- *----------------------------------------------------------------------------
1614- */
1615-
1616-static Bool
1617-VSockVmciProtoToNotifyStruct(struct sock *sk, // IN
1618- VSockProtoVersion *proto, // IN
1619- Bool oldPktProto) // IN
1620-{
1621- VSockVmciSock *vsk;
1622-
1623- ASSERT(sk);
1624- ASSERT(proto);
1625-
1626- vsk = vsock_sk(sk);
1627-
1628- if (oldPktProto) {
1629- if (*proto != VSOCK_PROTO_INVALID) {
1630- Warning("Can't set both an old and new protocol\n");
1631- return FALSE;
1632- }
1633- vsk->notifyOps = &vSockVmciNotifyPktOps;
1634- goto exit;
1635- }
1636-
1637- switch(*proto) {
1638- case VSOCK_PROTO_PKT_ON_NOTIFY:
1639- vsk->notifyOps= &vSockVmciNotifyPktQStateOps;
1640- break;
1641- default:
1642- Warning("Unknown notify protocol version\n");
1643- return FALSE;
1644- }
1645-
1646-exit:
1647- NOTIFYCALL(vsk, socketInit, sk);
1648- return TRUE;
1649-}
1650-
1651-
1652-/*
1653- *----------------------------------------------------------------------------
1654- *
1655- * VSockVmciNewProtoSupportedVersions
1656- *
1657- * Gets the supported REQUEST2/NEGOTIATE2 vsock protocol versions.
1658- *
1659- * Results:
1660- * Either 1 specific protocol version (override mode) or
1661- * VSOCK_PROTO_ALL_SUPPORTED.
1662- *
1663- * Side effects:
1664- * None.
1665- *
1666- *----------------------------------------------------------------------------
1667- */
1668-
1669-static VSockProtoVersion
1670-VSockVmciNewProtoSupportedVersions(void) // IN
1671-{
1672- if (PROTOCOL_OVERRIDE != -1) {
1673- return PROTOCOL_OVERRIDE;
1674- }
1675-
1676- return VSOCK_PROTO_ALL_SUPPORTED;
1677-}
1678-
1679-
1680-/*
1681- *----------------------------------------------------------------------------
1682- *
1683- * VSockSocket_Trusted --
1684- *
1685- * We allow two kinds of sockets to communicate with a restricted VM:
1686- * 1) trusted sockets
1687- * 2) sockets from applications running as the same user as the VM (this
1688- * is only true for the host side and only when using hosted products)
1689- *
1690- * Results:
1691- * TRUE if trusted communication is allowed to peerCid, FALSE otherwise.
1692- *
1693- * Side effects:
1694- * None.
1695- *
1696- *----------------------------------------------------------------------------
1697- */
1698-
1699-Bool
1700-VSockVmciTrusted(VSockVmciSock *vsock, // IN: Local socket
1701- VMCIId peerCid) // IN: Context ID of peer
1702-{
1703- return vsock->trusted || vmci_is_context_owner(peerCid, vsock->owner);
1704-}
1705-
1706-
1707-/*
1708- *----------------------------------------------------------------------------
1709- *
1710- * VSockSocket_AllowDgram --
1711- *
1712- * We allow sending datagrams to and receiving datagrams from a
1713- * restricted VM only if it is trusted as described in
1714- * VSockVmciTrusted.
1715- *
1716- * Results:
1717- * TRUE if datagram communication is allowed to peerCid, FALSE otherwise.
1718- *
1719- * Side effects:
1720- * None.
1721- *
1722- *----------------------------------------------------------------------------
1723- */
1724-
1725-Bool
1726-VSockVmciAllowDgram(VSockVmciSock *vsock, // IN: Local socket
1727- VMCIId peerCid) // IN: Context ID of peer
1728-{
1729- if (vsock->cachedPeer != peerCid) {
1730- vsock->cachedPeer = peerCid;
1731- if (!VSockVmciTrusted(vsock, peerCid) &&
1732- (vmci_context_get_priv_flags(peerCid) &
1733- VMCI_PRIVILEGE_FLAG_RESTRICTED)) {
1734- vsock->cachedPeerAllowDgram = FALSE;
1735- } else {
1736- vsock->cachedPeerAllowDgram = TRUE;
1737- }
1738- }
1739-
1740- return vsock->cachedPeerAllowDgram;
1741-}
1742-
1743-
1744-/*
1745- *----------------------------------------------------------------------------
1746- *
1747- * VMCISock_GetAFValue --
1748- *
1749- * Kernel interface that allows external kernel modules to get the current
1750- * VMCI Sockets address family.
1751- * This version of the function is exported to kernel clients and should not
1752- * change.
1753- *
1754- * Results:
1755- * The address family on success, a negative error on failure.
1756- *
1757- * Side effects:
1758- * None.
1759- *
1760- *----------------------------------------------------------------------------
1761- */
1762-
1763-int
1764-VMCISock_GetAFValue(void)
1765-{
1766- int afvalue;
1767-
1768- compat_mutex_lock(&registrationMutex);
1769-
1770- /*
1771- * Kernel clients are required to explicitly register themselves before they
1772- * can use VMCI Sockets.
1773- */
1774- if (vsockVmciKernClientCount <= 0) {
1775- afvalue = -1;
1776- goto exit;
1777- }
1778-
1779- afvalue = VSockVmciGetAFValue();
1780-
1781-exit:
1782- compat_mutex_unlock(&registrationMutex);
1783- return afvalue;
1784-}
1785-EXPORT_SYMBOL(VMCISock_GetAFValue);
1786-
1787-
1788-/*
1789- *----------------------------------------------------------------------------
1790- *
1791- * VMCISock_GetLocalCID --
1792- *
1793- * Kernel interface that allows external kernel modules to get the current
1794- * VMCI context id.
1795- * This version of the function is exported to kernel clients and should not
1796- * change.
1797- *
1798- * Results:
1799- * The context id on success, a negative error on failure.
1800- *
1801- * Side effects:
1802- * None.
1803- *
1804- *----------------------------------------------------------------------------
1805- */
1806-
1807-int
1808-VMCISock_GetLocalCID(void)
1809-{
1810- int cid;
1811-
1812- compat_mutex_lock(&registrationMutex);
1813-
1814- /*
1815- * Kernel clients are required to explicitly register themselves before they
1816- * can use VMCI Sockets.
1817- */
1818- if (vsockVmciKernClientCount <= 0) {
1819- cid = -1;
1820- goto exit;
1821- }
1822-
1823- cid = vmci_get_context_id();
1824-
1825-exit:
1826- compat_mutex_unlock(&registrationMutex);
1827- return cid;
1828-}
1829-EXPORT_SYMBOL(VMCISock_GetLocalCID);
1830-
1831-
1832-/*
1833- *----------------------------------------------------------------------------
1834- *
1835- * VMCISock_KernelRegister --
1836- *
1837- * Allows a kernel client to register with VMCI Sockets. Must be called
1838- * before VMCISock_GetAFValue within a kernel module. Note that we don't
1839- * actually register the address family until the first time the module
1840- * needs to use it.
1841- *
1842- * Results:
1843- * None.
1844- *
1845- * Side effects:
1846- * None.
1847- *
1848- *----------------------------------------------------------------------------
1849- */
1850-
1851-void
1852-VMCISock_KernelRegister(void)
1853-{
1854- compat_mutex_lock(&registrationMutex);
1855- vsockVmciKernClientCount++;
1856- compat_mutex_unlock(&registrationMutex);
1857-}
1858-EXPORT_SYMBOL(VMCISock_KernelRegister);
1859-
1860-
1861-/*
1862- *----------------------------------------------------------------------------
1863- *
1864- * VMCISock_KernelDeregister --
1865- *
1866- * Allows a kernel client to unregister with VMCI Sockets. Every call
1867- * to VMCISock_KernRegister must be matched with a call to
1868- * VMCISock_KernUnregister.
1869- *
1870- * Results:
1871- None.
1872- *
1873- * Side effects:
1874- * None.
1875- *
1876- *----------------------------------------------------------------------------
1877- */
1878-
1879-void
1880-VMCISock_KernelDeregister(void)
1881-{
1882- compat_mutex_lock(&registrationMutex);
1883- vsockVmciKernClientCount--;
1884- VSockVmciTestUnregister();
1885- compat_mutex_unlock(&registrationMutex);
1886-}
1887-EXPORT_SYMBOL(VMCISock_KernelDeregister);
1888-
1889-
1890-/*
1891- *----------------------------------------------------------------------------
1892- *
1893- * VSockVmciGetAFValue --
1894- *
1895- * Returns the address family value being used.
1896- * Note: The registration mutex must be held when calling this function.
1897- *
1898- * Results:
1899- * The address family on success, a negative error on failure.
1900- *
1901- * Side effects:
1902- * None.
1903- *
1904- *----------------------------------------------------------------------------
1905- */
1906-
1907-static int
1908-VSockVmciGetAFValue(void)
1909-{
1910- int afvalue;
1911-
1912- afvalue = vsockVmciFamilyOps.family;
1913- if (!VSOCK_AF_IS_REGISTERED(afvalue)) {
1914- afvalue = VSockVmciRegisterAddressFamily();
1915- }
1916-
1917- return afvalue;
1918-}
1919-
1920-/*
1921- *----------------------------------------------------------------------------
1922- *
1923- * VSockVmci_GetAFValue --
1924- *
1925- * Returns the address family value being used.
1926- *
1927- * Results:
1928- * The address family on success, a negative error on failure.
1929- *
1930- * Side effects:
1931- * None.
1932- *
1933- *----------------------------------------------------------------------------
1934- */
1935-
1936-int
1937-VSockVmci_GetAFValue(void)
1938-{
1939- int afvalue;
1940-
1941- compat_mutex_lock(&registrationMutex);
1942- afvalue = VSockVmciGetAFValue();
1943- compat_mutex_unlock(&registrationMutex);
1944-
1945- return afvalue;
1946-}
1947-
1948-
1949-/*
1950- * Helper functions.
1951- */
1952-
1953-/*
1954- *----------------------------------------------------------------------------
1955- *
1956- * VSockVmciQueuePairAlloc --
1957- *
1958- * Allocates or attaches to a queue pair. Tries to register with trusted
1959- * status if requested but does not fail if the queuepair could not be
1960- * allocate as trusted (running in the guest)
1961- *
1962- * Results:
1963- * 0 on success. A VSock error on error.
1964- *
1965- * Side effects:
1966- * None.
1967- *
1968- *----------------------------------------------------------------------------
1969- */
1970-
1971-static int
1972-VSockVmciQueuePairAlloc(VMCIQPair **qpair, // OUT
1973- VMCIHandle *handle, // IN/OUT
1974- uint64 produceSize, // IN
1975- uint64 consumeSize, // IN
1976- VMCIId peer, // IN
1977- uint32 flags, // IN
1978- Bool trusted) // IN
1979-{
1980- int err = 0;
1981-
1982- if (trusted) {
1983- /*
1984- * Try to allocate our queue pair as trusted. This will only work
1985- * if vsock is running in the host.
1986- */
1987-
1988- err = vmci_qpair_alloc(qpair, handle, produceSize, consumeSize,
1989- peer, flags, VMCI_PRIVILEGE_FLAG_TRUSTED);
1990- if (err != VMCI_ERROR_NO_ACCESS) {
1991- goto out;
1992- }
1993- }
1994-
1995- err = vmci_qpair_alloc(qpair, handle, produceSize, consumeSize,
1996- peer, flags, VMCI_NO_PRIVILEGE_FLAGS);
1997-out:
1998- if (err < 0) {
1999- Log("Could not attach to queue pair with %d\n", err);
2000- err = VSockVmci_ErrorToVSockError(err);
2001- }
2002-
2003- return err;
2004-}
2005-
2006-
2007-/*
2008- *----------------------------------------------------------------------------
2009- *
2010- * VSockVmciDatagramCreateHnd --
2011- *
2012- * Creates a datagram handle. Tries to register with trusted
2013- * status but does not fail if the handler could not be allocated
2014- * as trusted (running in the guest).
2015- *
2016- * Results:
2017- * 0 on success. A VMCI error on error.
2018- *
2019- * Side effects:
2020- * None.
2021- *
2022- *----------------------------------------------------------------------------
2023- */
2024-
2025-static int
2026-VSockVmciDatagramCreateHnd(VMCIId resourceID, // IN
2027- uint32 flags, // IN
2028- VMCIDatagramRecvCB recvCB, // IN
2029- void *clientData, // IN
2030- VMCIHandle *outHandle) // OUT
2031-{
2032- int err = 0;
2033-
2034- /*
2035- * Try to allocate our datagram handler as trusted. This will only work
2036- * if vsock is running in the host.
2037- */
2038-
2039- err = vmci_datagram_create_handle_priv(resourceID, flags,
2040- VMCI_PRIVILEGE_FLAG_TRUSTED,
2041- recvCB, clientData, outHandle);
2042-
2043- if (err == VMCI_ERROR_NO_ACCESS) {
2044- err = vmci_datagram_create_handle(resourceID, flags, recvCB, clientData,
2045- outHandle);
2046- }
2047-
2048- return err;
2049-}
2050-
2051-
2052-/*
2053- *----------------------------------------------------------------------------
2054- *
2055- * VSockVmciTestUnregister --
2056- *
2057- * Tests if it's necessary to unregister the socket family, and does so.
2058- *
2059- * Note that this assumes the registration lock is held.
2060- *
2061- * Results:
2062- * None.
2063- *
2064- * Side effects:
2065- * None.
2066- *
2067- *----------------------------------------------------------------------------
2068- */
2069-
2070-static void
2071-VSockVmciTestUnregister(void)
2072-{
2073- if (devOpenCount <= 0 && vsockVmciSocketCount <= 0 &&
2074- vsockVmciKernClientCount <= 0) {
2075- if (VSOCK_AF_IS_REGISTERED(vsockVmciFamilyOps.family)) {
2076- VSockVmciUnregisterAddressFamily();
2077- }
2078- }
2079-}
2080-
2081-
2082-/*
2083- *----------------------------------------------------------------------------
2084- *
2085- * VSockVmciRecvDgramCB --
2086- *
2087- * VMCI Datagram receive callback. This function is used specifically for
2088- * SOCK_DGRAM sockets.
2089- *
2090- * This is invoked as part of a tasklet that's scheduled when the VMCI
2091- * interrupt fires. This is run in bottom-half context and if it ever needs
2092- * to sleep it should defer that work to a work queue.
2093- *
2094- * Results:
2095- * Zero on success, negative error code on failure.
2096- *
2097- * Side effects:
2098- * An sk_buff is created and queued with this socket.
2099- *
2100- *----------------------------------------------------------------------------
2101- */
2102-
2103-static int
2104-VSockVmciRecvDgramCB(void *data, // IN
2105- VMCIDatagram *dg) // IN
2106-{
2107- struct sock *sk;
2108- size_t size;
2109- struct sk_buff *skb;
2110- VSockVmciSock *vsk;
2111-
2112- ASSERT(dg);
2113- ASSERT(dg->payloadSize <= VMCI_MAX_DG_PAYLOAD_SIZE);
2114-
2115- sk = (struct sock *)data;
2116-
2117- ASSERT(sk);
2118- /* XXX Figure out why sk->sk_socket can be NULL. */
2119- ASSERT(sk->sk_socket ? sk->sk_socket->type == SOCK_DGRAM : 1);
2120-
2121- /*
2122- * This handler is privileged when this module is running on the
2123- * host. We will get datagrams from all endpoints (even VMs that
2124- * are in a restricted context). If we get one from a restricted
2125- * context then the destination socket must be trusted.
2126- *
2127- * NOTE: We access the socket struct without holding the lock here. This
2128- * is ok because the field we are interested is never modified outside
2129- * of the create and destruct socket functions.
2130- */
2131- vsk = vsock_sk(sk);
2132- if (!VSockVmciAllowDgram(vsk, VMCI_HANDLE_TO_CONTEXT_ID(dg->src))) {
2133- return VMCI_ERROR_NO_ACCESS;
2134- }
2135-
2136- size = VMCI_DG_SIZE(dg);
2137-
2138- /*
2139- * Attach the packet to the socket's receive queue as an sk_buff.
2140- */
2141- skb = alloc_skb(size, GFP_ATOMIC);
2142- if (skb) {
2143- /* compat_sk_receive_skb() will do a sock_put(), so hold here. */
2144- sock_hold(sk);
2145- skb_put(skb, size);
2146- memcpy(skb->data, dg, size);
2147- compat_sk_receive_skb(sk, skb, 0);
2148- }
2149-
2150- return VMCI_SUCCESS;
2151-}
2152-
2153-
2154-/*
2155- *----------------------------------------------------------------------------
2156- *
2157- * VSockVmciSendSeqPacket --
2158- *
2159- * Send a sequential packet. This uses a stack-allocated packet, i.e.,
2160- * it isn't meant for DATA packets, but it works fine for the other packet
2161- * types.
2162- *
2163- * Results:
2164- * Zero on success, negative error code on failure.
2165- *
2166- * Side effects:
2167- * None.
2168- *
2169- *----------------------------------------------------------------------------
2170- */
2171-
2172-static int
2173-VSockVmciSendSeqPacket(VSockVmciSock *vsk, // IN
2174- VSockSeqPacketType type, // IN
2175- uint32 mode) // IN
2176-{
2177- int err;
2178- VSockSeqPacket pkt;
2179-
2180- ASSERT(vsk);
2181-
2182- VSockSeqPacket_Init(&pkt, &vsk->localAddr, &vsk->remoteAddr, type, mode);
2183-
2184- err = vmci_datagram_send(&pkt.hdr.dg);
2185- if (err < 0) {
2186- err = VSockVmci_ErrorToVSockError(err);
2187- }
2188-
2189- return err;
2190-}
2191-
2192-
2193-/*
2194- *----------------------------------------------------------------------------
2195- *
2196- * VSockVmciRecvSeqCB --
2197- *
2198- * VMCI Datagram receive callback. This function is used specifically for
2199- * SOCK_SEQPACKET sockets.
2200- *
2201- * This is invoked as part of a tasklet that's scheduled when the VMCI
2202- * interrupt fires. This is run in bottom-half context and if it ever needs
2203- * to sleep it should defer that work to a work queue.
2204- *
2205- * Results:
2206- * Zero on success, negative error code on failure.
2207- *
2208- * Side effects:
2209- * An sk_buff is created and queued with this socket.
2210- *
2211- *----------------------------------------------------------------------------
2212- */
2213-
2214-static int
2215-VSockVmciRecvSeqCB(void *data, // IN
2216- VMCIDatagram *dg) // IN
2217-{
2218- struct sock *sk;
2219- size_t size;
2220- VSockVmciSock *vsk;
2221- VSockSeqPacket *pkt;
2222-
2223- ASSERT(dg);
2224- ASSERT(dg->payloadSize <= VMCI_MAX_DG_PAYLOAD_SIZE);
2225-
2226- sk = (struct sock *)data;
2227-
2228- ASSERT(sk);
2229-
2230- /* XXX, figure out why sk->sk_socket can be NULL. */
2231- if (!sk->sk_socket) {
2232- return EINVAL;
2233- }
2234-
2235- ASSERT(sk->sk_socket->type == SOCK_SEQPACKET);
2236-
2237- if (VMCI_HYPERVISOR_CONTEXT_ID != dg->src.context) {
2238- return VMCI_ERROR_NO_ACCESS;
2239- }
2240-
2241- if (VMCI_RPC_PRIVILEGED != dg->src.resource &&
2242- VMCI_RPC_UNPRIVILEGED != dg->src.resource) {
2243- return VMCI_ERROR_NO_ACCESS;
2244- }
2245-
2246- size = VMCI_DG_SIZE(dg);
2247- if (size < sizeof *pkt) {
2248- return VMCI_ERROR_INVALID_ARGS;
2249- }
2250-
2251- vsk = vsock_sk(sk);
2252- pkt = (VSockSeqPacket *)dg;
2253-
2254- /*
2255- * After this point, if we fail to handle the packet, we need to send a
2256- * close to the peer with an error. Otherwise it might hang, waiting for a
2257- * response to a packet that we discarded.
2258- */
2259-
2260- if (VSOCK_SEQ_PACKET_VERSION_1 != pkt->hdr.version) {
2261- VSOCK_SEND_SEQ_CLOSE(vsk, EINVAL);
2262- return VMCI_ERROR_INVALID_ARGS;
2263- }
2264-
2265- if (SS_CONNECTED != sk->sk_socket->state) {
2266- VSOCK_SEND_SEQ_CLOSE(vsk, ENOTCONN);
2267- return VMCI_ERROR_DST_UNREACHABLE;
2268- }
2269-
2270- switch (pkt->hdr.type) {
2271- case VSOCK_SEQ_PACKET_TYPE_DATA: {
2272- struct sk_buff *skb;
2273- /*
2274- * Attach the packet to the socket's receive queue as an sk_buff.
2275- */
2276-
2277- size -= sizeof *pkt;
2278- skb = alloc_skb(size, GFP_ATOMIC);
2279- if (!skb) {
2280- VSOCK_SEND_SEQ_CLOSE(vsk, ENOMEM);
2281- return VMCI_ERROR_NO_MEM;
2282- }
2283-
2284- /* compat_sk_receive_skb() will do a sock_put(), so hold here. */
2285- sock_hold(sk);
2286- skb_put(skb, size);
2287- memcpy(skb->data, VSOCK_SEQ_PACKET_PAYLOAD(pkt), size);
2288-
2289- /*
2290- * XXX, this can drop the skb. We need to find an alternative that
2291- * will return an error if that happens, so that we can send a reset
2292- * to the peer, i.e.,
2293- *
2294- * if (!receive_skb(sk, skb)) {
2295- * VSOCK_SEND_SEQ_CLOSE(vsk, ENOMEM);
2296- * return VMCI_ERROR_NO_MEM;
2297- * }
2298- */
2299-
2300- compat_sk_receive_skb(sk, skb, 0);
2301- break;
2302- }
2303- case VSOCK_SEQ_PACKET_TYPE_CLOSE:
2304- bh_lock_sock(sk);
2305-
2306- sock_set_flag(sk, SOCK_DONE);
2307- vsk->peerShutdown = SHUTDOWN_MASK;
2308- sk->sk_state = TCP_CLOSE;
2309-
2310- /*
2311- * A close packet with an error code means a forceful reset, whereas
2312- * no error means a graceful close.
2313- */
2314- if (pkt->hdr.val) {
2315- sk->sk_socket->state = SS_UNCONNECTED;
2316- sk->sk_err = pkt->hdr.val;
2317- sk->sk_error_report(sk);
2318- } else {
2319- if (skb_queue_empty(&sk->sk_receive_queue)) {
2320- sk->sk_socket->state = SS_DISCONNECTING;
2321- }
2322- sk->sk_state_change(sk);
2323- }
2324-
2325- bh_unlock_sock(sk);
2326- break;
2327- /*
2328- * There's no reason for us to receive a shutdown packet in this direction,
2329- * or any other packet for that matter. Inform the peer that the packet
2330- * is invalid.
2331- */
2332- default:
2333- VSOCK_SEND_SEQ_CLOSE(vsk, EINVAL);
2334- return VMCI_ERROR_INVALID_ARGS;
2335- }
2336-
2337- return VMCI_SUCCESS;
2338-}
2339-
2340-
2341-/*
2342- *----------------------------------------------------------------------------
2343- *
2344- * VSockVmciRecvStreamCB --
2345- *
2346- * VMCI stream receive callback for control datagrams. This function is
2347- * used specifically for SOCK_STREAM sockets.
2348- *
2349- * This is invoked as part of a tasklet that's scheduled when the VMCI
2350- * interrupt fires. This is run in bottom-half context but it defers most
2351- * of its work to the packet handling work queue.
2352- *
2353- * Results:
2354- * Zero on success, negative error code on failure.
2355- *
2356- * Side effects:
2357- * None.
2358- *
2359- *----------------------------------------------------------------------------
2360- */
2361-
2362-static int
2363-VSockVmciRecvStreamCB(void *data, // IN
2364- VMCIDatagram *dg) // IN
2365-{
2366- struct sock *sk;
2367- struct sockaddr_vm dst;
2368- struct sockaddr_vm src;
2369- VSockPacket *pkt;
2370- VSockVmciSock *vsk;
2371- Bool bhProcessPkt;
2372- int err;
2373-
2374- ASSERT(dg);
2375- ASSERT(dg->payloadSize <= VMCI_MAX_DG_PAYLOAD_SIZE);
2376-
2377- sk = NULL;
2378- err = VMCI_SUCCESS;
2379- bhProcessPkt = FALSE;
2380-
2381- /*
2382- * Ignore incoming packets from contexts without sockets, or resources that
2383- * aren't vsock implementations.
2384- */
2385-
2386- if (!VSockAddr_SocketContextStream(VMCI_HANDLE_TO_CONTEXT_ID(dg->src)) ||
2387- VSOCK_PACKET_RID != VMCI_HANDLE_TO_RESOURCE_ID(dg->src)) {
2388- return VMCI_ERROR_NO_ACCESS;
2389- }
2390-
2391- if (VMCI_DG_SIZE(dg) < sizeof *pkt) {
2392- /* Drop datagrams that do not contain full VSock packets. */
2393- return VMCI_ERROR_INVALID_ARGS;
2394- }
2395-
2396- pkt = (VSockPacket *)dg;
2397-
2398- LOG_PACKET(pkt);
2399-
2400- /*
2401- * Find the socket that should handle this packet. First we look for
2402- * a connected socket and if there is none we look for a socket bound to
2403- * the destintation address.
2404- *
2405- * Note that we don't initialize the family member of the src and dst
2406- * sockaddr_vm since we don't want to call VMCISock_GetAFValue() and
2407- * possibly register the address family.
2408- */
2409- VSockAddr_InitNoFamily(&src,
2410- VMCI_HANDLE_TO_CONTEXT_ID(pkt->dg.src),
2411- pkt->srcPort);
2412-
2413- VSockAddr_InitNoFamily(&dst,
2414- VMCI_HANDLE_TO_CONTEXT_ID(pkt->dg.dst),
2415- pkt->dstPort);
2416-
2417- sk = VSockVmciFindConnectedSocket(&src, &dst);
2418- if (!sk) {
2419- sk = VSockVmciFindBoundSocket(&dst);
2420- if (!sk) {
2421- /*
2422- * We could not find a socket for this specified address. If this
2423- * packet is a RST, we just drop it. If it is another packet, we send
2424- * a RST. Note that we do not send a RST reply to RSTs so that we do
2425- * not continually send RSTs between two endpoints.
2426- *
2427- * Note that since this is a reply, dst is src and src is dst.
2428- */
2429- if (VSOCK_SEND_RESET_BH(&dst, &src, pkt) < 0) {
2430- Log("unable to send reset.\n");
2431- }
2432- err = VMCI_ERROR_NOT_FOUND;
2433- goto out;
2434- }
2435- }
2436-
2437- /*
2438- * If the received packet type is beyond all types known to this
2439- * implementation, reply with an invalid message. Hopefully this will help
2440- * when implementing backwards compatibility in the future.
2441- */
2442- if (pkt->type >= VSOCK_PACKET_TYPE_MAX) {
2443- VSOCK_SEND_INVALID_BH(&dst, &src);
2444- err = VMCI_ERROR_INVALID_ARGS;
2445- goto out;
2446- }
2447-
2448- /*
2449- * This handler is privileged when this module is running on the host.
2450- * We will get datagram connect requests from all endpoints (even VMs that
2451- * are in a restricted context). If we get one from a restricted context
2452- * then the destination socket must be trusted.
2453- *
2454- * NOTE: We access the socket struct without holding the lock here. This
2455- * is ok because the field we are interested is never modified outside
2456- * of the create and destruct socket functions.
2457- */
2458- vsk = vsock_sk(sk);
2459- if (!VSockVmciAllowDgram(vsk, VMCI_HANDLE_TO_CONTEXT_ID(pkt->dg.src))) {
2460- err = VMCI_ERROR_NO_ACCESS;
2461- goto out;
2462- }
2463-
2464- /*
2465- * We do most everything in a work queue, but let's fast path the
2466- * notification of reads and writes to help data transfer performance. We
2467- * can only do this if there is no process context code executing for this
2468- * socket since that may change the state.
2469- */
2470- bh_lock_sock(sk);
2471-
2472- if (!sock_owned_by_user(sk) && sk->sk_state == SS_CONNECTED) {
2473- NOTIFYCALL(vsk, handleNotifyPkt, sk, pkt, TRUE, &dst, &src, &bhProcessPkt);
2474- }
2475-
2476- bh_unlock_sock(sk);
2477-
2478- if (!bhProcessPkt) {
2479- VSockRecvPktInfo *recvPktInfo;
2480-
2481- recvPktInfo = kmalloc(sizeof *recvPktInfo, GFP_ATOMIC);
2482- if (!recvPktInfo) {
2483- if (VSOCK_SEND_RESET_BH(&dst, &src, pkt) < 0) {
2484- Warning("unable to send reset\n");
2485- }
2486- err = VMCI_ERROR_NO_MEM;
2487- goto out;
2488- }
2489-
2490- recvPktInfo->sk = sk;
2491- memcpy(&recvPktInfo->pkt, pkt, sizeof recvPktInfo->pkt);
2492- COMPAT_INIT_WORK(&recvPktInfo->work, VSockVmciRecvPktWork, recvPktInfo);
2493-
2494- compat_schedule_work(&recvPktInfo->work);
2495- /*
2496- * Clear sk so that the reference count incremented by one of the Find
2497- * functions above is not decremented below. We need that reference
2498- * count for the packet handler we've scheduled to run.
2499- */
2500- sk = NULL;
2501- }
2502-
2503-out:
2504- if (sk) {
2505- sock_put(sk);
2506- }
2507- return err;
2508-}
2509-
2510-
2511-/*
2512- *----------------------------------------------------------------------------
2513- *
2514- * VSockVmciPeerAttachCB --
2515- *
2516- * Invoked when a peer attaches to a queue pair.
2517- *
2518- * Right now this does not do anything.
2519- *
2520- * Results:
2521- * None.
2522- *
2523- * Side effects:
2524- * May modify socket state and signal socket.
2525- *
2526- *----------------------------------------------------------------------------
2527- */
2528-
2529-static void
2530-VSockVmciPeerAttachCB(VMCIId subId, // IN
2531- VMCI_EventData *eData, // IN
2532- void *clientData) // IN
2533-{
2534- struct sock *sk;
2535- VMCIEventPayload_QP *ePayload;
2536- VSockVmciSock *vsk;
2537-
2538- ASSERT(eData);
2539- ASSERT(clientData);
2540-
2541- sk = (struct sock *)clientData;
2542- ePayload = VMCIEventDataPayload(eData);
2543-
2544- vsk = vsock_sk(sk);
2545-
2546- /*
2547- * We don't ask for delayed CBs when we subscribe to this event (we pass 0
2548- * as flags to VMCIEvent_Subscribe()). VMCI makes no guarantees in that
2549- * case about what context we might be running in, so it could be BH or
2550- * process, blockable or non-blockable. And bh_lock_sock() is very
2551- * particular about how it gets called (it's *not* the same as
2552- * spin_lock_bh(), it expands directly into a spin_lock()). So we need to
2553- * account for all possible contexts here.
2554- */
2555- local_bh_disable();
2556- bh_lock_sock(sk);
2557-
2558- /*
2559- * XXX This is lame, we should provide a way to lookup sockets by qpHandle.
2560- */
2561- if (VMCI_HANDLE_EQUAL(vsk->qpHandle, ePayload->handle)) {
2562- /*
2563- * XXX This doesn't do anything, but in the future we may want to set
2564- * a flag here to verify the attach really did occur and we weren't just
2565- * sent a datagram claiming it was.
2566- */
2567- goto out;
2568- }
2569-
2570-out:
2571- bh_unlock_sock(sk);
2572- local_bh_enable();
2573-}
2574-
2575-
2576-/*
2577- *----------------------------------------------------------------------------
2578- *
2579- * VSockVmciHandleDetach --
2580- *
2581- * Perform the work necessary when the peer has detached.
2582- *
2583- * Note that this assumes the socket lock is held.
2584- *
2585- * Results:
2586- * None.
2587- *
2588- * Side effects:
2589- * The socket's and its peer's shutdown mask will be set appropriately,
2590- * and any callers waiting on this socket will be awoken.
2591- *
2592- *----------------------------------------------------------------------------
2593- */
2594-
2595-static void
2596-VSockVmciHandleDetach(struct sock *sk) // IN
2597-{
2598- VSockVmciSock *vsk;
2599-
2600- ASSERT(sk);
2601-
2602- vsk = vsock_sk(sk);
2603- if (!VMCI_HANDLE_INVALID(vsk->qpHandle)) {
2604- ASSERT(vsk->qpair);
2605-
2606- sock_set_flag(sk, SOCK_DONE);
2607-
2608- /* On a detach the peer will not be sending or receiving anymore. */
2609- vsk->peerShutdown = SHUTDOWN_MASK;
2610-
2611- /*
2612- * We should not be sending anymore since the peer won't be there to
2613- * receive, but we can still receive if there is data left in our consume
2614- * queue.
2615- */
2616- if (VSockVmciStreamHasData(vsk) <= 0) {
2617- if (sk->sk_state == SS_CONNECTING) {
2618- /*
2619- * The peer may detach from a queue pair while we are
2620- * still in the connecting state, i.e., if the peer VM is
2621- * killed after attaching to a queue pair, but before we
2622- * complete the handshake. In that case, we treat the
2623- * detach event like a reset.
2624- */
2625-
2626- sk->sk_state = SS_UNCONNECTED;
2627- sk->sk_err = ECONNRESET;
2628- sk->sk_error_report(sk);
2629- return;
2630- }
2631- sk->sk_state = SS_UNCONNECTED;
2632- }
2633- sk->sk_state_change(sk);
2634- }
2635-}
2636-
2637-
2638-/*
2639- *----------------------------------------------------------------------------
2640- *
2641- * VSockVmciPeerDetachCB --
2642- *
2643- * Invoked when a peer detaches from a queue pair.
2644- *
2645- * Results:
2646- * None.
2647- *
2648- * Side effects:
2649- * May modify socket state and signal socket.
2650- *
2651- *----------------------------------------------------------------------------
2652- */
2653-
2654-static void
2655-VSockVmciPeerDetachCB(VMCIId subId, // IN
2656- VMCI_EventData *eData, // IN
2657- void *clientData) // IN
2658-{
2659- struct sock *sk;
2660- VMCIEventPayload_QP *ePayload;
2661- VSockVmciSock *vsk;
2662-
2663- ASSERT(eData);
2664- ASSERT(clientData);
2665-
2666- sk = (struct sock *)clientData;
2667- ePayload = VMCIEventDataPayload(eData);
2668- vsk = vsock_sk(sk);
2669- if (VMCI_HANDLE_INVALID(ePayload->handle)) {
2670- return;
2671- }
2672-
2673- /* Same rules for locking as for PeerAttachCB(). */
2674- local_bh_disable();
2675- bh_lock_sock(sk);
2676-
2677- /*
2678- * XXX This is lame, we should provide a way to lookup sockets by qpHandle.
2679- */
2680- if (VMCI_HANDLE_EQUAL(vsk->qpHandle, ePayload->handle)) {
2681- VSockVmciHandleDetach(sk);
2682- }
2683-
2684- bh_unlock_sock(sk);
2685- local_bh_enable();
2686-}
2687-
2688-
2689-/*
2690- *----------------------------------------------------------------------------
2691- *
2692- * VSockVmciQPResumedCB --
2693- *
2694- * Invoked when a VM is resumed. We must mark all connected stream sockets
2695- * as detached.
2696- *
2697- * Results:
2698- * None.
2699- *
2700- * Side effects:
2701- * May modify socket state and signal socket.
2702- *
2703- *----------------------------------------------------------------------------
2704- */
2705-
2706-static void
2707-VSockVmciQPResumedCB(VMCIId subId, // IN
2708- VMCI_EventData *eData, // IN
2709- void *clientData) // IN
2710-{
2711- uint32 i;
2712-
2713- spin_lock_bh(&vsockTableLock);
2714-
2715- /*
2716- * XXX This loop should probably be provided by util.{h,c}, but that's for
2717- * another day.
2718- */
2719- for (i = 0; i < ARRAYSIZE(vsockConnectedTable); i++) {
2720- VSockVmciSock *vsk;
2721-
2722- list_for_each_entry(vsk, &vsockConnectedTable[i], connectedTable) {
2723- struct sock *sk = sk_vsock(vsk);
2724-
2725- /*
2726- * XXX Technically this is racy but the resulting outcome from such
2727- * a race is relatively harmless. My next change will be a fix to
2728- * this.
2729- */
2730- VSockVmciHandleDetach(sk);
2731- }
2732- }
2733-
2734- spin_unlock_bh(&vsockTableLock);
2735-}
2736-
2737-
2738-/*
2739- *----------------------------------------------------------------------------
2740- *
2741- * VSockVmciContextUpdatedCB --
2742- *
2743- * Invoked when a VM is resumed (technically when the context ID changes,
2744- * but the event is actually sent even when it does not, so this works
2745- * well for catching resumes). We must mark all connected sequential
2746- * sockets as detached.
2747- *
2748- * Results:
2749- * None.
2750- *
2751- * Side effects:
2752- * May modify socket state and signal socket.
2753- *
2754- *----------------------------------------------------------------------------
2755- */
2756-
2757-static void
2758-VSockVmciContextUpdatedCB(VMCIId subId, // IN
2759- VMCI_EventData *eData, // IN
2760- void *clientData) // IN
2761-{
2762- uint32 i;
2763-
2764- spin_lock_bh(&vsockSeqTableLock);
2765-
2766- for (i = 0; i < ARRAYSIZE(vsockSeqTable); i++) {
2767- VSockVmciSock *vsk;
2768-
2769- list_for_each_entry(vsk, &vsockSeqTable[i], seqTable) {
2770- struct sock *sk = sk_vsock(vsk);
2771-
2772- sock_set_flag(sk, SOCK_DONE);
2773- vsk->peerShutdown = SHUTDOWN_MASK;
2774- sk->sk_state = TCP_CLOSE;
2775-
2776- if (skb_queue_empty(&sk->sk_receive_queue)) {
2777- sk->sk_socket->state = SS_DISCONNECTING;
2778- }
2779- sk->sk_state_change(sk);
2780- }
2781- }
2782-
2783- spin_unlock_bh(&vsockSeqTableLock);
2784-}
2785-
2786-
2787-/*
2788- *----------------------------------------------------------------------------
2789- *
2790- * VSockVmciPendingWork --
2791- *
2792- * Releases the resources for a pending socket if it has not reached the
2793- * connected state and been accepted by a user process.
2794- *
2795- * Results:
2796- * None.
2797- *
2798- * Side effects:
2799- * The socket may be removed from the connected list and all its resources
2800- * freed.
2801- *
2802- *----------------------------------------------------------------------------
2803- */
2804-
2805-static void
2806-VSockVmciPendingWork(compat_delayed_work_arg work) // IN
2807-{
2808- struct sock *sk;
2809- struct sock *listener;
2810- VSockVmciSock *vsk;
2811- Bool cleanup;
2812-
2813- vsk = COMPAT_DELAYED_WORK_GET_DATA(work, VSockVmciSock, dwork);
2814- ASSERT(vsk);
2815-
2816- sk = sk_vsock(vsk);
2817- listener = vsk->listener;
2818- cleanup = TRUE;
2819-
2820- ASSERT(listener);
2821-
2822- lock_sock(listener);
2823- lock_sock(sk);
2824-
2825- /*
2826- * The socket should be on the pending list or the accept queue, but not
2827- * both. It's also possible that the socket isn't on either.
2828- */
2829- ASSERT( ( VSockVmciIsPending(sk) && !VSockVmciInAcceptQueue(sk))
2830- || (!VSockVmciIsPending(sk) && VSockVmciInAcceptQueue(sk))
2831- || (!VSockVmciIsPending(sk) && !VSockVmciInAcceptQueue(sk)));
2832-
2833- if (VSockVmciIsPending(sk)) {
2834- VSockVmciRemovePending(listener, sk);
2835- } else if (!vsk->rejected) {
2836- /*
2837- * We are not on the pending list and accept() did not reject us, so we
2838- * must have been accepted by our user process. We just need to drop our
2839- * references to the sockets and be on our way.
2840- */
2841- cleanup = FALSE;
2842- goto out;
2843- }
2844-
2845- listener->sk_ack_backlog--;
2846-
2847- /*
2848- * We need to remove ourself from the global connected sockets list so
2849- * incoming packets can't find this socket, and to reduce the reference
2850- * count.
2851- */
2852- if (VSockVmciInConnectedTable(sk)) {
2853- VSockVmciRemoveConnected(sk);
2854- }
2855-
2856- sk->sk_state = SS_FREE;
2857-
2858-out:
2859- release_sock(sk);
2860- release_sock(listener);
2861- if (cleanup) {
2862- sock_put(sk);
2863- }
2864- sock_put(sk);
2865- sock_put(listener);
2866-}
2867-
2868-
2869-/*
2870- *----------------------------------------------------------------------------
2871- *
2872- * VSockVmciRecvPktWork --
2873- *
2874- * Handles an incoming control packet for the provided socket. This is the
2875- * state machine for our stream sockets.
2876- *
2877- * Results:
2878- * None.
2879- *
2880- * Side effects:
2881- * May set state and wakeup threads waiting for socket state to change.
2882- *
2883- *----------------------------------------------------------------------------
2884- */
2885-
2886-static void
2887-VSockVmciRecvPktWork(compat_work_arg work) // IN
2888-{
2889- VSockRecvPktInfo *recvPktInfo;
2890- VSockPacket *pkt;
2891- struct sock *sk;
2892-
2893- recvPktInfo = COMPAT_WORK_GET_DATA(work, VSockRecvPktInfo, work);
2894- ASSERT(recvPktInfo);
2895-
2896- sk = recvPktInfo->sk;
2897- pkt = &recvPktInfo->pkt;
2898-
2899- ASSERT(pkt);
2900- ASSERT(pkt->type < VSOCK_PACKET_TYPE_MAX);
2901-
2902- lock_sock(sk);
2903-
2904- switch (sk->sk_state) {
2905- case SS_LISTEN:
2906- VSockVmciRecvListen(sk, pkt);
2907- break;
2908- case SS_CONNECTING:
2909- /*
2910- * Processing of pending connections for servers goes through the
2911- * listening socket, so see VSockVmciRecvListen() for that path.
2912- */
2913- VSockVmciRecvConnectingClient(sk, pkt);
2914- break;
2915- case SS_CONNECTED:
2916- VSockVmciRecvConnected(sk, pkt);
2917- break;
2918- default:
2919- /*
2920- * Because this function does not run in the same context as
2921- * VSockVmciRecvStreamCB it is possible that the socket
2922- * has closed. We need to let the other side know or it could
2923- * be sitting in a connect and hang forever. Send a reset to prevent
2924- * that.
2925- */
2926- VSOCK_SEND_RESET(sk, pkt);
2927- goto out;
2928- }
2929-
2930-out:
2931- release_sock(sk);
2932- kfree(recvPktInfo);
2933- /*
2934- * Release reference obtained in the stream callback when we fetched this
2935- * socket out of the bound or connected list.
2936- */
2937- sock_put(sk);
2938-}
2939-
2940-
2941-/*
2942- *----------------------------------------------------------------------------
2943- *
2944- * VSockVmciRecvListen --
2945- *
2946- * Receives packets for sockets in the listen state.
2947- *
2948- * Note that this assumes the socket lock is held.
2949- *
2950- * Results:
2951- * Zero on success, negative error code on failure.
2952- *
2953- * Side effects:
2954- * A new socket may be created and a negotiate control packet is sent.
2955- *
2956- *----------------------------------------------------------------------------
2957- */
2958-
2959-static int
2960-VSockVmciRecvListen(struct sock *sk, // IN
2961- VSockPacket *pkt) // IN
2962-{
2963- struct sock *pending;
2964- VSockVmciSock *vpending;
2965- int err;
2966- uint64 qpSize;
2967- Bool oldRequest = FALSE;
2968- Bool oldPktProto = FALSE;
2969-
2970- ASSERT(sk);
2971- ASSERT(pkt);
2972- ASSERT(sk->sk_state == SS_LISTEN);
2973-
2974- err = 0;
2975-
2976- /*
2977- * Because we are in the listen state, we could be receiving a packet for
2978- * ourself or any previous connection requests that we received. If it's
2979- * the latter, we try to find a socket in our list of pending connections
2980- * and, if we do, call the appropriate handler for the state that that
2981- * socket is in. Otherwise we try to service the connection request.
2982- */
2983- pending = VSockVmciGetPending(sk, pkt);
2984- if (pending) {
2985- lock_sock(pending);
2986- switch (pending->sk_state) {
2987- case SS_CONNECTING:
2988- err = VSockVmciRecvConnectingServer(sk, pending, pkt);
2989- break;
2990- default:
2991- VSOCK_SEND_RESET(pending, pkt);
2992- err = -EINVAL;
2993- }
2994-
2995- if (err < 0) {
2996- VSockVmciRemovePending(sk, pending);
2997- }
2998-
2999- release_sock(pending);
3000- VSockVmciReleasePending(pending);
3001-
3002- return err;
3003- }
3004-
3005- /*
3006- * The listen state only accepts connection requests. Reply with a reset
3007- * unless we received a reset.
3008- */
3009-
3010- if (!(pkt->type == VSOCK_PACKET_TYPE_REQUEST ||
3011- pkt->type == VSOCK_PACKET_TYPE_REQUEST2)) {
3012- VSOCK_REPLY_RESET(pkt);
3013- return -EINVAL;
3014- }
3015-
3016- if (pkt->u.size == 0) {
3017- VSOCK_REPLY_RESET(pkt);
3018- return -EINVAL;
3019- }
3020-
3021- /*
3022- * If this socket can't accommodate this connection request, we send
3023- * a reset. Otherwise we create and initialize a child socket and reply
3024- * with a connection negotiation.
3025- */
3026- if (sk->sk_ack_backlog >= sk->sk_max_ack_backlog) {
3027- VSOCK_REPLY_RESET(pkt);
3028- return -ECONNREFUSED;
3029- }
3030-
3031-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)
3032- pending = __VSockVmciCreate(NULL, sk, GFP_KERNEL, sk->sk_type);
3033-#else
3034- pending = __VSockVmciCreate(compat_sock_net(sk), NULL, sk, GFP_KERNEL,
3035- sk->sk_type);
3036-#endif
3037- if (!pending) {
3038- VSOCK_SEND_RESET(sk, pkt);
3039- return -ENOMEM;
3040- }
3041-
3042- vpending = vsock_sk(pending);
3043- ASSERT(vpending);
3044- ASSERT(vsock_sk(sk)->localAddr.svm_port == pkt->dstPort);
3045-
3046- VSockAddr_Init(&vpending->localAddr,
3047- VMCI_HANDLE_TO_CONTEXT_ID(pkt->dg.dst),
3048- pkt->dstPort);
3049- VSockAddr_Init(&vpending->remoteAddr,
3050- VMCI_HANDLE_TO_CONTEXT_ID(pkt->dg.src),
3051- pkt->srcPort);
3052-
3053- /*
3054- * If the proposed size fits within our min/max, accept
3055- * it. Otherwise propose our own size.
3056- */
3057- if (pkt->u.size >= vpending->queuePairMinSize &&
3058- pkt->u.size <= vpending->queuePairMaxSize) {
3059- qpSize = pkt->u.size;
3060- } else {
3061- qpSize = vpending->queuePairSize;
3062- }
3063-
3064- /*
3065- * Figure out if we are using old or new requests based on the overrides
3066- * pkt types sent by our peer.
3067- */
3068- if (VSockVmciOldProtoOverride(&oldPktProto)) {
3069- oldRequest = oldPktProto;
3070- } else {
3071- if (pkt->type == VSOCK_PACKET_TYPE_REQUEST) {
3072- oldRequest = TRUE;
3073- } else if (pkt->type == VSOCK_PACKET_TYPE_REQUEST2) {
3074- oldRequest = FALSE;
3075- }
3076- }
3077-
3078- if (oldRequest) {
3079- /* Handle a REQUEST (or override) */
3080- VSockProtoVersion version = VSOCK_PROTO_INVALID;
3081- if (VSockVmciProtoToNotifyStruct(pending, &version, TRUE)) {
3082- err = VSOCK_SEND_NEGOTIATE(pending, qpSize);
3083- } else {
3084- err = -EINVAL;
3085- }
3086- } else {
3087- /* Handle a REQUEST2 (or override) */
3088- int protoInt = pkt->proto;
3089- int pos;
3090- uint16 activeProtoVersion = 0;
3091-
3092- /*
3093- * The list of possible protocols is the intersection of all protocols
3094- * the client supports ... plus all the protocols we support.
3095- */
3096- protoInt &= VSockVmciNewProtoSupportedVersions();
3097-
3098- /* We choose the highest possible protocol version and use that one. */
3099- pos = mssb32(protoInt);
3100- if (pos) {
3101- activeProtoVersion = (1 << (pos - 1));
3102- if (VSockVmciProtoToNotifyStruct(pending, &activeProtoVersion, FALSE)) {
3103- err = VSOCK_SEND_NEGOTIATE2(pending, qpSize,
3104- activeProtoVersion);
3105- } else {
3106- err = -EINVAL;
3107- }
3108- } else {
3109- err = -EINVAL;
3110- }
3111- }
3112-
3113- if (err < 0) {
3114- VSOCK_SEND_RESET(sk, pkt);
3115- sock_put(pending);
3116- err = VSockVmci_ErrorToVSockError(err);
3117- goto out;
3118- }
3119-
3120- VSockVmciAddPending(sk, pending);
3121- sk->sk_ack_backlog++;
3122-
3123- pending->sk_state = SS_CONNECTING;
3124- vpending->produceSize = vpending->consumeSize = qpSize;
3125- vpending->queuePairSize = qpSize;
3126-
3127- NOTIFYCALL(vpending, processRequest, pending);
3128-
3129- /*
3130- * We might never receive another message for this socket and it's not
3131- * connected to any process, so we have to ensure it gets cleaned up
3132- * ourself. Our delayed work function will take care of that. Note that we
3133- * do not ever cancel this function since we have few guarantees about its
3134- * state when calling cancel_delayed_work(). Instead we hold a reference on
3135- * the socket for that function and make it capable of handling cases where
3136- * it needs to do nothing but release that reference.
3137- */
3138- vpending->listener = sk;
3139- sock_hold(sk);
3140- sock_hold(pending);
3141- COMPAT_INIT_DELAYED_WORK(&vpending->dwork, VSockVmciPendingWork, vpending);
3142- compat_schedule_delayed_work(&vpending->dwork, HZ);
3143-
3144-out:
3145- return err;
3146-}
3147-
3148-
3149-/*
3150- *----------------------------------------------------------------------------
3151- *
3152- * VSockVmciRecvConnectingServer --
3153- *
3154- * Receives packets for sockets in the connecting state on the server side.
3155- *
3156- * Connecting sockets on the server side can only receive queue pair offer
3157- * packets. All others should be treated as cause for closing the
3158- * connection.
3159- *
3160- * Note that this assumes the socket lock is held for both sk and pending.
3161- *
3162- * Results:
3163- * Zero on success, negative error code on failure.
3164- *
3165- * Side effects:
3166- * A queue pair may be created, an attach control packet may be sent, the
3167- * socket may transition to the connected state, and a pending caller in
3168- * accept() may be woken up.
3169- *
3170- *----------------------------------------------------------------------------
3171- */
3172-
3173-static int
3174-VSockVmciRecvConnectingServer(struct sock *listener, // IN: the listening socket
3175- struct sock *pending, // IN: the pending connection
3176- VSockPacket *pkt) // IN: current packet
3177-{
3178- VSockVmciSock *vpending;
3179- VMCIHandle handle;
3180- VMCIQPair *qpair;
3181- Bool isLocal;
3182- uint32 flags;
3183- VMCIId detachSubId;
3184- int err;
3185- int skerr;
3186-
3187- ASSERT(listener);
3188- ASSERT(pkt);
3189- ASSERT(listener->sk_state == SS_LISTEN);
3190- ASSERT(pending->sk_state == SS_CONNECTING);
3191-
3192- vpending = vsock_sk(pending);
3193- detachSubId = VMCI_INVALID_ID;
3194-
3195- switch (pkt->type) {
3196- case VSOCK_PACKET_TYPE_OFFER:
3197- if (VMCI_HANDLE_INVALID(pkt->u.handle)) {
3198- VSOCK_SEND_RESET(pending, pkt);
3199- skerr = EPROTO;
3200- err = -EINVAL;
3201- goto destroy;
3202- }
3203- break;
3204- default:
3205- /* Close and cleanup the connection. */
3206- VSOCK_SEND_RESET(pending, pkt);
3207- skerr = EPROTO;
3208- err = pkt->type == VSOCK_PACKET_TYPE_RST ?
3209- 0 :
3210- -EINVAL;
3211- goto destroy;
3212- }
3213-
3214- ASSERT(pkt->type == VSOCK_PACKET_TYPE_OFFER);
3215-
3216- /*
3217- * In order to complete the connection we need to attach to the offered
3218- * queue pair and send an attach notification. We also subscribe to the
3219- * detach event so we know when our peer goes away, and we do that before
3220- * attaching so we don't miss an event. If all this succeeds, we update our
3221- * state and wakeup anything waiting in accept() for a connection.
3222- */
3223-
3224- /*
3225- * We don't care about attach since we ensure the other side has attached by
3226- * specifying the ATTACH_ONLY flag below.
3227- */
3228- err = vmci_event_subscribe(VMCI_EVENT_QP_PEER_DETACH,
3229- VSockVmciPeerDetachCB,
3230- pending,
3231- &detachSubId);
3232- if (err < VMCI_SUCCESS) {
3233- VSOCK_SEND_RESET(pending, pkt);
3234- err = VSockVmci_ErrorToVSockError(err);
3235- skerr = -err;
3236- goto destroy;
3237- }
3238-
3239- vpending->detachSubId = detachSubId;
3240-
3241- /* Now attach to the queue pair the client created. */
3242- handle = pkt->u.handle;
3243-
3244- /*
3245- * vpending->localAddr always has a context id so we do not
3246- * need to worry about VMADDR_CID_ANY in this case.
3247- */
3248- isLocal = vpending->remoteAddr.svm_cid == vpending->localAddr.svm_cid;
3249- flags = VMCI_QPFLAG_ATTACH_ONLY;
3250- flags |= isLocal ? VMCI_QPFLAG_LOCAL : 0;
3251-
3252- err = VSockVmciQueuePairAlloc(&qpair,
3253- &handle,
3254- vpending->produceSize,
3255- vpending->consumeSize,
3256- VMCI_HANDLE_TO_CONTEXT_ID(pkt->dg.src),
3257- flags,
3258- VSockVmciTrusted(vpending,
3259- vpending->remoteAddr.svm_cid));
3260- if (err < 0) {
3261- VSOCK_SEND_RESET(pending, pkt);
3262- skerr = -err;
3263- goto destroy;
3264- }
3265-
3266- ASSERT(VMCI_HANDLE_EQUAL(handle, pkt->u.handle));
3267- vpending->qpHandle = handle;
3268- vpending->qpair = qpair;
3269-
3270- /*
3271- * When we send the attach message, we must be ready to handle
3272- * incoming control messages on the newly connected socket. So we
3273- * move the pending socket to the connected state before sending
3274- * the attach message. Otherwise, an incoming packet triggered by
3275- * the attach being received by the peer may be processed
3276- * concurrently with what happens below after sending the attach
3277- * message, and that incoming packet will find the listening socket
3278- * instead of the (currently) pending socket. Note that enqueueing
3279- * the socket increments the reference count, so even if a reset
3280- * comes before the connection is accepted, the socket will be
3281- * valid until it is removed from the queue.
3282- *
3283- * If we fail sending the attach below, we remove the socket from
3284- * the connected list and move the socket to SS_UNCONNECTED before
3285- * releasing the lock, so a pending slow path processing of an
3286- * incoming packet will not see the socket in the connected state
3287- * in that case.
3288- */
3289- pending->sk_state = SS_CONNECTED;
3290-
3291- VSockVmciInsertConnected(vsockConnectedSocketsVsk(vpending), pending);
3292-
3293- /* Notify our peer of our attach. */
3294- err = VSOCK_SEND_ATTACH(pending, handle);
3295- if (err < 0) {
3296- VSockVmciRemoveConnected(pending);
3297- Log("Could not send attach\n");
3298- VSOCK_SEND_RESET(pending, pkt);
3299- err = VSockVmci_ErrorToVSockError(err);
3300- skerr = -err;
3301- goto destroy;
3302- }
3303-
3304- /*
3305- * We have a connection. Move the now connected socket from the
3306- * listener's pending list to the accept queue so callers of
3307- * accept() can find it.
3308- */
3309- VSockVmciRemovePending(listener, pending);
3310- VSockVmciEnqueueAccept(listener, pending);
3311-
3312- /*
3313- * Callers of accept() will be be waiting on the listening socket, not the
3314- * pending socket.
3315- */
3316- listener->sk_state_change(listener);
3317-
3318- return 0;
3319-
3320-destroy:
3321- pending->sk_err = skerr;
3322- pending->sk_state = SS_UNCONNECTED;
3323- /*
3324- * As long as we drop our reference, all necessary cleanup will handle when
3325- * the cleanup function drops its reference and our destruct implementation
3326- * is called. Note that since the listen handler will remove pending from
3327- * the pending list upon our failure, the cleanup function won't drop the
3328- * additional reference, which is why we do it here.
3329- */
3330- sock_put(pending);
3331-
3332- return err;
3333-}
3334-
3335-
3336-/*
3337- *----------------------------------------------------------------------------
3338- *
3339- * VSockVmciRecvConnectingClient --
3340- *
3341- * Receives packets for sockets in the connecting state on the client side.
3342- *
3343- * Connecting sockets on the client side should only receive attach packets.
3344- * All others should be treated as cause for closing the connection.
3345- *
3346- * Note that this assumes the socket lock is held for both sk and pending.
3347- *
3348- * Results:
3349- * Zero on success, negative error code on failure.
3350- *
3351- * Side effects:
3352- * The socket may transition to the connected state and wakeup the pending
3353- * caller of connect().
3354- *
3355- *----------------------------------------------------------------------------
3356- */
3357-
3358-static int
3359-VSockVmciRecvConnectingClient(struct sock *sk, // IN: socket
3360- VSockPacket *pkt) // IN: current packet
3361-{
3362- VSockVmciSock *vsk;
3363- int err;
3364- int skerr;
3365-
3366- ASSERT(sk);
3367- ASSERT(pkt);
3368- ASSERT(sk->sk_state == SS_CONNECTING);
3369-
3370- vsk = vsock_sk(sk);
3371-
3372- switch (pkt->type) {
3373- case VSOCK_PACKET_TYPE_ATTACH:
3374- if (VMCI_HANDLE_INVALID(pkt->u.handle) ||
3375- !VMCI_HANDLE_EQUAL(pkt->u.handle, vsk->qpHandle)) {
3376- skerr = EPROTO;
3377- err = -EINVAL;
3378- goto destroy;
3379- }
3380-
3381- /*
3382- * Signify the socket is connected and wakeup the waiter in connect().
3383- * Also place the socket in the connected table for accounting (it can
3384- * already be found since it's in the bound table).
3385- */
3386- sk->sk_state = SS_CONNECTED;
3387- sk->sk_socket->state = SS_CONNECTED;
3388- VSockVmciInsertConnected(vsockConnectedSocketsVsk(vsk), sk);
3389- sk->sk_state_change(sk);
3390-
3391- break;
3392- case VSOCK_PACKET_TYPE_NEGOTIATE:
3393- case VSOCK_PACKET_TYPE_NEGOTIATE2:
3394- if (pkt->u.size == 0 ||
3395- VMCI_HANDLE_TO_CONTEXT_ID(pkt->dg.src) != vsk->remoteAddr.svm_cid ||
3396- pkt->srcPort != vsk->remoteAddr.svm_port ||
3397- !VMCI_HANDLE_INVALID(vsk->qpHandle) ||
3398- vsk->qpair ||
3399- vsk->produceSize != 0 ||
3400- vsk->consumeSize != 0 ||
3401- vsk->attachSubId != VMCI_INVALID_ID ||
3402- vsk->detachSubId != VMCI_INVALID_ID) {
3403- skerr = EPROTO;
3404- err = -EINVAL;
3405-
3406- goto destroy;
3407- }
3408-
3409- err = VSockVmciRecvConnectingClientNegotiate(sk, pkt);
3410- if (err) {
3411- skerr = -err;
3412- goto destroy;
3413- }
3414-
3415- break;
3416- case VSOCK_PACKET_TYPE_INVALID:
3417- err = VSockVmciRecvConnectingClientInvalid(sk, pkt);
3418- if (err) {
3419- skerr = -err;
3420- goto destroy;
3421- }
3422-
3423- break;
3424- case VSOCK_PACKET_TYPE_RST:
3425- /*
3426- * Older versions of the linux code (WS 6.5 / ESX 4.0) used to continue
3427- * processing here after they sent an INVALID packet. This meant that we
3428- * got a RST after the INVALID. We ignore a RST after an INVALID. The
3429- * common code doesn't send the RST ... so we can hang if an old version
3430- * of the common code fails between getting a REQUEST and sending an
3431- * OFFER back. Not much we can do about it... except hope that it
3432- * doesn't happen.
3433- */
3434- if (vsk->ignoreConnectingRst) {
3435- vsk->ignoreConnectingRst = FALSE;
3436- } else {
3437- skerr = ECONNRESET;
3438- err = 0;
3439- goto destroy;
3440- }
3441-
3442- break;
3443- default:
3444- /* Close and cleanup the connection. */
3445- skerr = EPROTO;
3446- err = -EINVAL;
3447- goto destroy;
3448- }
3449-
3450- ASSERT(pkt->type == VSOCK_PACKET_TYPE_ATTACH ||
3451- pkt->type == VSOCK_PACKET_TYPE_NEGOTIATE ||
3452- pkt->type == VSOCK_PACKET_TYPE_NEGOTIATE2 ||
3453- pkt->type == VSOCK_PACKET_TYPE_INVALID ||
3454- pkt->type == VSOCK_PACKET_TYPE_RST);
3455-
3456- return 0;
3457-
3458-destroy:
3459- VSOCK_SEND_RESET(sk, pkt);
3460-
3461- sk->sk_state = SS_UNCONNECTED;
3462- sk->sk_err = skerr;
3463- sk->sk_error_report(sk);
3464- return err;
3465-}
3466-
3467-
3468-/*
3469- *----------------------------------------------------------------------------
3470- *
3471- * VSockVmciRecvConnectingClientNegotiate --
3472- *
3473- * Handles a negotiate packet for a client in the connecting state.
3474- *
3475- * Note that this assumes the socket lock is held for both sk and pending.
3476- *
3477- * Results:
3478- * Zero on success, negative error code on failure.
3479- *
3480- * Side effects:
3481- * The socket may transition to the connected state and wakeup the pending
3482- * caller of connect().
3483- *
3484- *----------------------------------------------------------------------------
3485- */
3486-
3487-static int
3488-VSockVmciRecvConnectingClientNegotiate(struct sock *sk, // IN: socket
3489- VSockPacket *pkt) // IN: current packet
3490-{
3491- int err;
3492- VSockVmciSock *vsk;
3493- VMCIHandle handle;
3494- VMCIQPair *qpair;
3495- VMCIId attachSubId;
3496- VMCIId detachSubId;
3497- Bool isLocal;
3498- uint32 flags;
3499- Bool oldProto = TRUE;
3500- Bool oldPktProto;
3501- VSockProtoVersion version;
3502-
3503- vsk = vsock_sk(sk);
3504- handle = VMCI_INVALID_HANDLE;
3505- attachSubId = VMCI_INVALID_ID;
3506- detachSubId = VMCI_INVALID_ID;
3507-
3508- ASSERT(sk);
3509- ASSERT(pkt);
3510- ASSERT(pkt->u.size > 0);
3511- ASSERT(vsk->remoteAddr.svm_cid == VMCI_HANDLE_TO_CONTEXT_ID(pkt->dg.src));
3512- ASSERT(vsk->remoteAddr.svm_port == pkt->srcPort);
3513- ASSERT(VMCI_HANDLE_INVALID(vsk->qpHandle));
3514- ASSERT(vsk->qpair == NULL);
3515- ASSERT(vsk->produceSize == 0);
3516- ASSERT(vsk->consumeSize == 0);
3517- ASSERT(vsk->attachSubId == VMCI_INVALID_ID);
3518- ASSERT(vsk->detachSubId == VMCI_INVALID_ID);
3519-
3520- /*
3521- * If we have gotten here then we should be past the point where old linux
3522- * vsock could have sent the bogus rst.
3523- */
3524- vsk->sentRequest = FALSE;
3525- vsk->ignoreConnectingRst = FALSE;
3526-
3527- /* Verify that we're OK with the proposed queue pair size */
3528- if (pkt->u.size < vsk->queuePairMinSize ||
3529- pkt->u.size > vsk->queuePairMaxSize) {
3530- err = -EINVAL;
3531- goto destroy;
3532- }
3533-
3534- /*
3535- * At this point we know the CID the peer is using to talk to us.
3536- */
3537-
3538- if (vsk->localAddr.svm_cid == VMADDR_CID_ANY) {
3539- vsk->localAddr.svm_cid = VMCI_HANDLE_TO_CONTEXT_ID(pkt->dg.dst);
3540- }
3541-
3542- /*
3543- * Setup the notify ops to be the highest supported version that both the
3544- * server and the client support.
3545- */
3546-
3547- if (VSockVmciOldProtoOverride(&oldPktProto)) {
3548- oldProto = oldPktProto;
3549- } else {
3550- if (pkt->type == VSOCK_PACKET_TYPE_NEGOTIATE) {
3551- oldProto = TRUE;
3552- } else if (pkt->type == VSOCK_PACKET_TYPE_NEGOTIATE2) {
3553- oldProto = FALSE;
3554- }
3555- }
3556-
3557- if (oldProto) {
3558- version = VSOCK_PROTO_INVALID;
3559- } else {
3560- version = pkt->proto;
3561- }
3562-
3563- if (!VSockVmciProtoToNotifyStruct(sk, &version, oldProto)) {
3564- err = -EINVAL;
3565- goto destroy;
3566- }
3567-
3568- /*
3569- * Subscribe to attach and detach events first.
3570- *
3571- * XXX We attach once for each queue pair created for now so it is easy
3572- * to find the socket (it's provided), but later we should only subscribe
3573- * once and add a way to lookup sockets by queue pair handle.
3574- */
3575- err = vmci_event_subscribe(VMCI_EVENT_QP_PEER_ATTACH,
3576- VSockVmciPeerAttachCB,
3577- sk,
3578- &attachSubId);
3579- if (err < VMCI_SUCCESS) {
3580- err = VSockVmci_ErrorToVSockError(err);
3581- goto destroy;
3582- }
3583-
3584- err = vmci_event_subscribe(VMCI_EVENT_QP_PEER_DETACH,
3585- VSockVmciPeerDetachCB,
3586- sk,
3587- &detachSubId);
3588- if (err < VMCI_SUCCESS) {
3589- err = VSockVmci_ErrorToVSockError(err);
3590- goto destroy;
3591- }
3592-
3593- /* Make VMCI select the handle for us. */
3594- handle = VMCI_INVALID_HANDLE;
3595- isLocal = vsk->remoteAddr.svm_cid == vsk->localAddr.svm_cid;
3596- flags = isLocal ? VMCI_QPFLAG_LOCAL : 0;
3597-
3598- err = VSockVmciQueuePairAlloc(&qpair,
3599- &handle,
3600- pkt->u.size,
3601- pkt->u.size,
3602- vsk->remoteAddr.svm_cid,
3603- flags,
3604- VSockVmciTrusted(vsk, vsk->remoteAddr.svm_cid));
3605- if (err < 0) {
3606- goto destroy;
3607- }
3608-
3609- err = VSOCK_SEND_QP_OFFER(sk, handle);
3610- if (err < 0) {
3611- err = VSockVmci_ErrorToVSockError(err);
3612- goto destroy;
3613- }
3614-
3615- vsk->qpHandle = handle;
3616- vsk->qpair = qpair;
3617-
3618- vsk->produceSize = vsk->consumeSize = pkt->u.size;
3619-
3620- vsk->attachSubId = attachSubId;
3621- vsk->detachSubId = detachSubId;
3622-
3623- NOTIFYCALL(vsk, processNegotiate, sk);
3624-
3625- return 0;
3626-
3627-destroy:
3628- if (attachSubId != VMCI_INVALID_ID) {
3629- vmci_event_unsubscribe(attachSubId);
3630- ASSERT(vsk->attachSubId == VMCI_INVALID_ID);
3631- }
3632-
3633- if (detachSubId != VMCI_INVALID_ID) {
3634- vmci_event_unsubscribe(detachSubId);
3635- ASSERT(vsk->detachSubId == VMCI_INVALID_ID);
3636- }
3637-
3638- if (!VMCI_HANDLE_INVALID(handle)) {
3639- ASSERT(vsk->qpair);
3640- vmci_qpair_detach(&qpair);
3641- ASSERT(VMCI_HANDLE_INVALID(vsk->qpHandle));
3642- }
3643-
3644- return err;
3645-}
3646-
3647-
3648-/*
3649- *----------------------------------------------------------------------------
3650- *
3651- * VSockVmciRecvConnectingClientInvalid --
3652- *
3653- * Handles an invalid packet for a client in the connecting state.
3654- *
3655- * Note that this assumes the socket lock is held for both sk and pending.
3656- *
3657- * Results:
3658- * Zero on success, negative error code on failure.
3659- *
3660- * Side effects:
3661- * None.
3662- *
3663- *----------------------------------------------------------------------------
3664- */
3665-
3666-static int
3667-VSockVmciRecvConnectingClientInvalid(struct sock *sk, // IN: socket
3668- VSockPacket *pkt) // IN: current packet
3669-{
3670- int err = 0;
3671- VSockVmciSock *vsk;
3672-
3673- ASSERT(sk);
3674- ASSERT(pkt);
3675-
3676- vsk = vsock_sk(sk);
3677-
3678- if (vsk->sentRequest) {
3679- vsk->sentRequest = FALSE;
3680- vsk->ignoreConnectingRst = TRUE;
3681-
3682- err = VSOCK_SEND_CONN_REQUEST(sk, vsk->queuePairSize);
3683- if (err < 0) {
3684- err = VSockVmci_ErrorToVSockError(err);
3685- } else {
3686- err = 0;
3687- }
3688- }
3689-
3690- return err;
3691-}
3692-
3693-
3694-/*
3695- *----------------------------------------------------------------------------
3696- *
3697- * VSockVmciRecvConnected --
3698- *
3699- * Receives packets for sockets in the connected state.
3700- *
3701- * Connected sockets should only ever receive detach, wrote, read, or reset
3702- * control messages. Others are treated as errors that are ignored.
3703- *
3704- * Wrote and read signify that the peer has produced or consumed,
3705- * respectively.
3706- *
3707- * Detach messages signify that the connection is being closed cleanly and
3708- * reset messages signify that the connection is being closed in error.
3709- *
3710- * Note that this assumes the socket lock is held.
3711- *
3712- * Results:
3713- * Zero on success, negative error code on failure.
3714- *
3715- * Side effects:
3716- * A queue pair may be created, an offer control packet sent, and the socket
3717- * may transition to the connecting state.
3718- *
3719- *
3720- *----------------------------------------------------------------------------
3721- */
3722-
3723-static int
3724-VSockVmciRecvConnected(struct sock *sk, // IN
3725- VSockPacket *pkt) // IN
3726-{
3727- VSockVmciSock *vsk;
3728- Bool pktProcessed = FALSE;
3729-
3730- ASSERT(sk);
3731- ASSERT(pkt);
3732- ASSERT(sk->sk_state == SS_CONNECTED);
3733-
3734- /*
3735- * In cases where we are closing the connection, it's sufficient to mark
3736- * the state change (and maybe error) and wake up any waiting threads.
3737- * Since this is a connected socket, it's owned by a user process and will
3738- * be cleaned up when the failure is passed back on the current or next
3739- * system call. Our system call implementations must therefore check for
3740- * error and state changes on entry and when being awoken.
3741- */
3742- switch (pkt->type) {
3743- case VSOCK_PACKET_TYPE_SHUTDOWN:
3744- if (pkt->u.mode) {
3745- vsk = vsock_sk(sk);
3746-
3747- vsk->peerShutdown |= pkt->u.mode;
3748- sk->sk_state_change(sk);
3749- }
3750- break;
3751-
3752- case VSOCK_PACKET_TYPE_RST:
3753- vsk = vsock_sk(sk);
3754- /*
3755- * It is possible that we sent our peer a message (e.g
3756- * a WAITING_READ) right before we got notified that the peer
3757- * had detached. If that happens then we can get a RST pkt back
3758- * from our peer even though there is data available for us
3759- * to read. In that case, don't shutdown the socket completely
3760- * but instead allow the local client to finish reading data
3761- * off the queuepair. Always treat a RST pkt in connected mode
3762- * like a clean shutdown.
3763- */
3764- sock_set_flag(sk, SOCK_DONE);
3765- vsk->peerShutdown = SHUTDOWN_MASK;
3766- if (VSockVmciStreamHasData(vsk) <= 0) {
3767- sk->sk_state = SS_DISCONNECTING;
3768- }
3769- sk->sk_state_change(sk);
3770- break;
3771-
3772- default:
3773- vsk = vsock_sk(sk);
3774- NOTIFYCALL(vsk, handleNotifyPkt, sk, pkt, FALSE, NULL, NULL,
3775- &pktProcessed);
3776- if (!pktProcessed) {
3777- return -EINVAL;
3778- }
3779- break;
3780- }
3781-
3782- return 0;
3783-}
3784-
3785-
3786-/*
3787- *----------------------------------------------------------------------------
3788- *
3789- * __VSockVmciSendControlPkt --
3790- *
3791- * Common code to send a control packet.
3792- *
3793- * Results:
3794- * Size of datagram sent on success, negative error code otherwise.
3795- * If convertError is TRUE, error code is a vsock error, otherwise,
3796- * result is a VMCI error code.
3797- *
3798- * Side effects:
3799- * None.
3800- *
3801- *----------------------------------------------------------------------------
3802- */
3803-
3804-static int
3805-__VSockVmciSendControlPkt(VSockPacket *pkt, // IN
3806- struct sockaddr_vm *src, // IN
3807- struct sockaddr_vm *dst, // IN
3808- VSockPacketType type, // IN
3809- uint64 size, // IN
3810- uint64 mode, // IN
3811- VSockWaitingInfo *wait, // IN
3812- VSockProtoVersion proto, // IN
3813- VMCIHandle handle, // IN
3814- Bool convertError) // IN
3815-{
3816- int err;
3817-
3818- ASSERT(pkt);
3819- /*
3820- * This function can be called in different contexts, so family value is not
3821- * necessarily consistent.
3822- */
3823-
3824- VSOCK_ADDR_NOFAMILY_ASSERT(src);
3825- VSOCK_ADDR_NOFAMILY_ASSERT(dst);
3826-
3827- VSockPacket_Init(pkt, src, dst, type, size, mode, wait, proto, handle);
3828- LOG_PACKET(pkt);
3829- VSOCK_STATS_CTLPKT_LOG(pkt->type);
3830- err = vmci_datagram_send(&pkt->dg);
3831- if (convertError && (err < 0)) {
3832- return VSockVmci_ErrorToVSockError(err);
3833- }
3834-
3835- return err;
3836-}
3837-
3838-
3839-/*
3840- *----------------------------------------------------------------------------
3841- *
3842- * VSockVmciReplyControlPktFast --
3843- *
3844- * Sends a control packet back to the source of an incoming packet.
3845- * The control packet is allocated in the stack.
3846- *
3847- * Results:
3848- * Size of datagram sent on success, negative error code otherwise.
3849- *
3850- * Side effects:
3851- * None.
3852- *
3853- *----------------------------------------------------------------------------
3854- */
3855-
3856-int
3857-VSockVmciReplyControlPktFast(VSockPacket *pkt, // IN
3858- VSockPacketType type, // IN
3859- uint64 size, // IN
3860- uint64 mode, // IN
3861- VSockWaitingInfo *wait, // IN
3862- VMCIHandle handle) // IN
3863-{
3864- VSockPacket reply;
3865- struct sockaddr_vm src, dst;
3866-
3867- ASSERT(pkt);
3868-
3869- if (pkt->type == VSOCK_PACKET_TYPE_RST) {
3870- return 0;
3871- } else {
3872- VSockPacket_GetAddresses(pkt, &src, &dst);
3873- return __VSockVmciSendControlPkt(&reply, &src, &dst, type,
3874- size, mode, wait,
3875- VSOCK_PROTO_INVALID, handle, TRUE);
3876- }
3877-}
3878-
3879-
3880-/*
3881- *----------------------------------------------------------------------------
3882- *
3883- * VSockVmciSendControlPktBH --
3884- *
3885- * Sends a control packet from bottom-half context. The control packet is
3886- * static data to minimize the resource cost.
3887- *
3888- * Results:
3889- * Size of datagram sent on success, negative error code otherwise. Note
3890- * that we return a VMCI error message since that's what callers will need
3891- * to provide.
3892- *
3893- * Side effects:
3894- * None.
3895- *
3896- *----------------------------------------------------------------------------
3897- */
3898-
3899-int
3900-VSockVmciSendControlPktBH(struct sockaddr_vm *src, // IN
3901- struct sockaddr_vm *dst, // IN
3902- VSockPacketType type, // IN
3903- uint64 size, // IN
3904- uint64 mode, // IN
3905- VSockWaitingInfo *wait, // IN
3906- VMCIHandle handle) // IN
3907-{
3908- /*
3909- * Note that it is safe to use a single packet across all CPUs since two
3910- * tasklets of the same type are guaranteed to not ever run simultaneously.
3911- * If that ever changes, or VMCI stops using tasklets, we can use per-cpu
3912- * packets.
3913- */
3914- static VSockPacket pkt;
3915-
3916- return __VSockVmciSendControlPkt(&pkt, src, dst, type,
3917- size, mode, wait, VSOCK_PROTO_INVALID,
3918- handle, FALSE);
3919-}
3920-
3921-
3922-/*
3923- *----------------------------------------------------------------------------
3924- *
3925- * VSockVmciSendControlPkt --
3926- *
3927- * Sends a control packet.
3928- *
3929- * Results:
3930- * Size of datagram sent on success, negative error on failure.
3931- *
3932- * Side effects:
3933- * None.
3934- *
3935- *----------------------------------------------------------------------------
3936- */
3937-
3938-int
3939-VSockVmciSendControlPkt(struct sock *sk, // IN
3940- VSockPacketType type, // IN
3941- uint64 size, // IN
3942- uint64 mode, // IN
3943- VSockWaitingInfo *wait, // IN
3944- VSockProtoVersion proto, // IN
3945- VMCIHandle handle) // IN
3946-{
3947- VSockPacket *pkt;
3948- VSockVmciSock *vsk;
3949- int err;
3950-
3951- ASSERT(sk);
3952- /*
3953- * New sockets for connection establishment won't have socket structures
3954- * yet; if one exists, ensure it is of the proper type.
3955- */
3956- ASSERT(sk->sk_socket ?
3957- sk->sk_socket->type == SOCK_STREAM :
3958- 1);
3959-
3960- vsk = vsock_sk(sk);
3961-
3962- if (!VSockAddr_Bound(&vsk->localAddr)) {
3963- return -EINVAL;
3964- }
3965-
3966- if (!VSockAddr_Bound(&vsk->remoteAddr)) {
3967- return -EINVAL;
3968- }
3969-
3970- pkt = kmalloc(sizeof *pkt, GFP_KERNEL);
3971- if (!pkt) {
3972- return -ENOMEM;
3973- }
3974-
3975- err = __VSockVmciSendControlPkt(pkt, &vsk->localAddr, &vsk->remoteAddr,
3976- type, size, mode, wait, proto, handle,
3977- TRUE);
3978- kfree(pkt);
3979-
3980- return err;
3981-}
3982-
3983-
3984-/*
3985- *----------------------------------------------------------------------------
3986- *
3987- * __VSockVmciBind --
3988- *
3989- * Common functionality needed to bind the specified address to the
3990- * VSocket. If VMADDR_CID_ANY or VMADDR_PORT_ANY are specified, the context
3991- * ID or port are selected automatically.
3992- *
3993- * Results:
3994- * Zero on success, negative error code on failure.
3995- *
3996- * Side effects:
3997- * On success, a new datagram handle is created.
3998- *
3999- *----------------------------------------------------------------------------
4000- */
4001-
4002-static int
4003-__VSockVmciBind(struct sock *sk, // IN/OUT
4004- struct sockaddr_vm *addr) // IN
4005-{
4006- static unsigned int port = LAST_RESERVED_PORT + 1;
4007- struct sockaddr_vm newAddr;
4008- VSockVmciSock *vsk;
4009- VMCIId cid;
4010- int err;
4011-
4012- ASSERT(sk);
4013- ASSERT(sk->sk_socket);
4014- ASSERT(addr);
4015-
4016- vsk = vsock_sk(sk);
4017-
4018- /* First ensure this socket isn't already bound. */
4019- if (VSockAddr_Bound(&vsk->localAddr)) {
4020- return -EINVAL;
4021- }
4022-
4023- /*
4024- * Now bind to the provided address or select appropriate values if none are
4025- * provided (VMADDR_CID_ANY and VMADDR_PORT_ANY). Note that like AF_INET
4026- * prevents binding to a non-local IP address (in most cases), we only allow
4027- * binding to the local CID.
4028- */
4029- VSockAddr_Init(&newAddr, VMADDR_CID_ANY, VMADDR_PORT_ANY);
4030-
4031- cid = vmci_get_context_id();
4032- if (addr->svm_cid != cid &&
4033- addr->svm_cid != VMADDR_CID_ANY) {
4034- return -EADDRNOTAVAIL;
4035- }
4036-
4037- newAddr.svm_cid = addr->svm_cid;
4038-
4039- switch (sk->sk_socket->type) {
4040- case SOCK_STREAM: {
4041- spin_lock_bh(&vsockTableLock);
4042-
4043- if (addr->svm_port == VMADDR_PORT_ANY) {
4044- Bool found = FALSE;
4045- unsigned int i;
4046-
4047- for (i = 0; i < MAX_PORT_RETRIES; i++) {
4048- if (port <= LAST_RESERVED_PORT) {
4049- port = LAST_RESERVED_PORT + 1;
4050- }
4051-
4052- newAddr.svm_port = port++;
4053-
4054- if (!__VSockVmciFindBoundSocket(&newAddr)) {
4055- found = TRUE;
4056- break;
4057- }
4058- }
4059-
4060- if (!found) {
4061- err = -EADDRNOTAVAIL;
4062- goto out;
4063- }
4064- } else {
4065- /* If port is in reserved range, ensure caller has necessary privileges. */
4066- if (addr->svm_port <= LAST_RESERVED_PORT &&
4067- !capable(CAP_NET_BIND_SERVICE)) {
4068- err = -EACCES;
4069- goto out;
4070- }
4071-
4072- newAddr.svm_port = addr->svm_port;
4073- if (__VSockVmciFindBoundSocket(&newAddr)) {
4074- err = -EADDRINUSE;
4075- goto out;
4076- }
4077-
4078- }
4079- break;
4080- }
4081- case SOCK_DGRAM:
4082- case SOCK_SEQPACKET: {
4083- uint32 flags = 0;
4084-
4085- /* VMCI will select a resource ID for us if we provide VMCI_INVALID_ID. */
4086- newAddr.svm_port = addr->svm_port == VMADDR_PORT_ANY ?
4087- VMCI_INVALID_ID :
4088- addr->svm_port;
4089-
4090- if (newAddr.svm_port <= LAST_RESERVED_PORT &&
4091- !capable(CAP_NET_BIND_SERVICE)) {
4092- err = -EACCES;
4093- goto out;
4094- }
4095-
4096- if (newAddr.svm_cid == VMADDR_CID_ANY) {
4097- flags = VMCI_FLAG_ANYCID_DG_HND;
4098- }
4099-
4100- err = VSockVmciDatagramCreateHnd(newAddr.svm_port, flags,
4101- sk->sk_socket->type == SOCK_DGRAM ?
4102- VSockVmciRecvDgramCB :
4103- VSockVmciRecvSeqCB,
4104- sk, &vsk->dgHandle);
4105- if (err < VMCI_SUCCESS) {
4106- err = VSockVmci_ErrorToVSockError(err);
4107- goto out;
4108- }
4109-
4110- newAddr.svm_port = VMCI_HANDLE_TO_RESOURCE_ID(vsk->dgHandle);
4111- break;
4112- }
4113- default: {
4114- err = -EINVAL;
4115- goto out;
4116- }
4117- }
4118- /*
4119- * VSockVmci_GetAFValue() acquires a mutex and may sleep, so fill the
4120- * field after unlocking socket tables.
4121- */
4122- VSockAddr_InitNoFamily(&vsk->localAddr, newAddr.svm_cid, newAddr.svm_port);
4123-
4124- /*
4125- * Remove stream sockets from the unbound list and add them to the hash
4126- * table for easy lookup by its address. The unbound list is simply an
4127- * extra entry at the end of the hash table, a trick used by AF_UNIX.
4128- */
4129- if (sk->sk_socket->type == SOCK_STREAM) {
4130- __VSockVmciRemoveBound(sk);
4131- __VSockVmciInsertBound(vsockBoundSockets(&vsk->localAddr), sk);
4132- spin_unlock_bh(&vsockTableLock);
4133- }
4134- vsk->localAddr.svm_family = VSockVmci_GetAFValue();
4135- VSOCK_ADDR_ASSERT(&vsk->localAddr);
4136-
4137- return 0;
4138-
4139-out:
4140- if (sk->sk_socket->type == SOCK_STREAM) {
4141- spin_unlock_bh(&vsockTableLock);
4142- }
4143- return err;
4144-}
4145-
4146-
4147-/*
4148- *----------------------------------------------------------------------------
4149- *
4150- * __VSockVmciCreate --
4151- *
4152- * Does the work to create the sock structure.
4153- * Note: If sock is NULL then the type field must be non-zero.
4154- * Otherwise, sock is non-NULL and the type of sock is used in the
4155- * newly created socket.
4156- *
4157- * Results:
4158- * sock structure on success, NULL on failure.
4159- *
4160- * Side effects:
4161- * Allocated sk is added to the unbound sockets list iff it is owned by
4162- * a struct socket.
4163- *
4164- *----------------------------------------------------------------------------
4165- */
4166-
4167-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 14)
4168-static struct sock *
4169-__VSockVmciCreate(struct socket *sock, // IN: Owning socket, may be NULL
4170- struct sock *parent, // IN: Parent socket, may be NULL
4171- unsigned int priority, // IN: Allocation flags
4172- unsigned short type) // IN: Socket type if sock is NULL
4173-#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)
4174-static struct sock *
4175-__VSockVmciCreate(struct socket *sock, // IN: Owning socket, may be NULL
4176- struct sock *parent, // IN: Parent socket, may be NULL
4177- gfp_t priority, // IN: Allocation flags
4178- unsigned short type) // IN: Socket type if sock is NULL
4179-#else
4180-static struct sock *
4181-__VSockVmciCreate(struct net *net, // IN: Network namespace
4182- struct socket *sock, // IN: Owning socket, may be NULL
4183- struct sock *parent, // IN: Parent socket, may be NULL
4184- gfp_t priority, // IN: Allocation flags
4185- unsigned short type) // IN: Socket type if sock is NULL
4186-
4187-#endif
4188-{
4189- struct sock *sk;
4190- VSockVmciSock *psk;
4191- VSockVmciSock *vsk;
4192-
4193- ASSERT((sock && !type) || (!sock && type));
4194-
4195- vsk = NULL;
4196-
4197- /*
4198- * From 2.6.9 to until 2.6.12 sk_alloc() used a cache in
4199- * the protocol structure, but you still had to specify the size and cache
4200- * yourself.
4201- * Most recently (in 2.6.24), sk_alloc() was changed to expect the
4202- * network namespace, and the option to zero the sock was dropped.
4203- *
4204- */
4205-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 12)
4206- sk = sk_alloc(vsockVmciFamilyOps.family, priority,
4207- vsockVmciProto.slab_obj_size, vsockVmciProto.slab);
4208-#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)
4209- sk = sk_alloc(vsockVmciFamilyOps.family, priority, &vsockVmciProto, 1);
4210-#else
4211- sk = sk_alloc(net, vsockVmciFamilyOps.family, priority, &vsockVmciProto);
4212-#endif
4213- if (!sk) {
4214- return NULL;
4215- }
4216-
4217- /*
4218- * If we go this far, we know the socket family is registered, so there's no
4219- * need to register it now.
4220- */
4221- compat_mutex_lock(&registrationMutex);
4222- vsockVmciSocketCount++;
4223- compat_mutex_unlock(&registrationMutex);
4224-
4225- sock_init_data(sock, sk);
4226-
4227- /*
4228- * sk->sk_type is normally set in sock_init_data, but only if
4229- * sock is non-NULL. We make sure that our sockets always have a type
4230- * by setting it here if needed.
4231- */
4232- if (!sock) {
4233- sk->sk_type = type;
4234- }
4235-
4236- vsk = vsock_sk(sk);
4237- VSockAddr_Init(&vsk->localAddr, VMADDR_CID_ANY, VMADDR_PORT_ANY);
4238- VSockAddr_Init(&vsk->remoteAddr, VMADDR_CID_ANY, VMADDR_PORT_ANY);
4239-
4240- sk->sk_destruct = VSockVmciSkDestruct;
4241- sk->sk_backlog_rcv = VSockVmciQueueRcvSkb;
4242- sk->sk_state = 0;
4243- sock_reset_flag(sk, SOCK_DONE);
4244-
4245- INIT_LIST_HEAD(&vsk->boundTable);
4246- INIT_LIST_HEAD(&vsk->connectedTable);
4247- INIT_LIST_HEAD(&vsk->seqTable);
4248- vsk->dgHandle = VMCI_INVALID_HANDLE;
4249- vsk->qpHandle = VMCI_INVALID_HANDLE;
4250- vsk->qpair = NULL;
4251- vsk->produceSize = vsk->consumeSize = 0;
4252- vsk->listener = NULL;
4253- INIT_LIST_HEAD(&vsk->pendingLinks);
4254- INIT_LIST_HEAD(&vsk->acceptQueue);
4255- vsk->rejected = FALSE;
4256- vsk->sentRequest = FALSE;
4257- vsk->ignoreConnectingRst = FALSE;
4258- vsk->attachSubId = vsk->detachSubId = VMCI_INVALID_ID;
4259- vsk->peerShutdown = 0;
4260-
4261- if (parent) {
4262- psk = vsock_sk(parent);
4263- vsk->trusted = psk->trusted;
4264- vsk->owner = psk->owner;
4265- vsk->queuePairSize = psk->queuePairSize;
4266- vsk->queuePairMinSize = psk->queuePairMinSize;
4267- vsk->queuePairMaxSize = psk->queuePairMaxSize;
4268- vsk->connectTimeout = psk->connectTimeout;
4269- } else {
4270- vsk->trusted = capable(CAP_NET_ADMIN);
4271- vsk->owner = current_uid();
4272- vsk->queuePairSize = VSOCK_DEFAULT_QP_SIZE;
4273- vsk->queuePairMinSize = VSOCK_DEFAULT_QP_SIZE_MIN;
4274- vsk->queuePairMaxSize = VSOCK_DEFAULT_QP_SIZE_MAX;
4275- vsk->connectTimeout = VSOCK_DEFAULT_CONNECT_TIMEOUT;
4276- }
4277-
4278- vsk->notifyOps = NULL;
4279-
4280- if (sock) {
4281- VSockVmciInsertBound(vsockUnboundSockets, sk);
4282- }
4283-
4284- return sk;
4285-}
4286-
4287-
4288-/*
4289- *----------------------------------------------------------------------------
4290- *
4291- * __VSockVmciRelease --
4292- *
4293- * Releases the provided socket.
4294- *
4295- * Results:
4296- * None.
4297- *
4298- * Side effects:
4299- * Any pending sockets are also released.
4300- *
4301- *----------------------------------------------------------------------------
4302- */
4303-
4304-static void
4305-__VSockVmciRelease(struct sock *sk) // IN
4306-{
4307- if (sk) {
4308- struct sk_buff *skb;
4309- struct sock *pending;
4310- struct VSockVmciSock *vsk;
4311-
4312- vsk = vsock_sk(sk);
4313- pending = NULL; /* Compiler warning. */
4314-
4315- if (VSockVmciInBoundTable(sk)) {
4316- VSockVmciRemoveBound(sk);
4317- }
4318-
4319- if (VSockVmciInConnectedTable(sk)) {
4320- VSockVmciRemoveConnected(sk);
4321- }
4322-
4323- if (VSockVmciInSeqTable(sk)) {
4324- VSockVmciRemoveSeq(sk);
4325- }
4326-
4327- if (!VMCI_HANDLE_INVALID(vsk->dgHandle)) {
4328- if (SOCK_SEQPACKET == sk->sk_type && TCP_ESTABLISHED == sk->sk_state) {
4329- VSOCK_SEND_SEQ_CLOSE(vsk, 0);
4330- }
4331- vmci_datagram_destroy_handle(vsk->dgHandle);
4332- vsk->dgHandle = VMCI_INVALID_HANDLE;
4333- }
4334-
4335- lock_sock(sk);
4336- sock_orphan(sk);
4337- sk->sk_shutdown = SHUTDOWN_MASK;
4338-
4339- while ((skb = skb_dequeue(&sk->sk_receive_queue))) {
4340- kfree_skb(skb);
4341- }
4342-
4343- /* Clean up any sockets that never were accepted. */
4344- while ((pending = VSockVmciDequeueAccept(sk)) != NULL) {
4345- __VSockVmciRelease(pending);
4346- sock_put(pending);
4347- }
4348-
4349- release_sock(sk);
4350- sock_put(sk);
4351- }
4352-}
4353-
4354-
4355-/*
4356- * Sock operations.
4357- */
4358-
4359-/*
4360- *----------------------------------------------------------------------------
4361- *
4362- * VSockVmciSkDestruct --
4363- *
4364- * Destroys the provided socket. This is called by sk_free(), which is
4365- * invoked when the reference count of the socket drops to zero.
4366- *
4367- * Results:
4368- * None.
4369- *
4370- * Side effects:
4371- * Socket count is decremented.
4372- *
4373- *----------------------------------------------------------------------------
4374- */
4375-
4376-static void
4377-VSockVmciSkDestruct(struct sock *sk) // IN
4378-{
4379- VSockVmciSock *vsk;
4380-
4381- vsk = vsock_sk(sk);
4382-
4383- if (vsk->attachSubId != VMCI_INVALID_ID) {
4384- vmci_event_unsubscribe(vsk->attachSubId);
4385- vsk->attachSubId = VMCI_INVALID_ID;
4386- }
4387-
4388- if (vsk->detachSubId != VMCI_INVALID_ID) {
4389- vmci_event_unsubscribe(vsk->detachSubId);
4390- vsk->detachSubId = VMCI_INVALID_ID;
4391- }
4392-
4393- if (!VMCI_HANDLE_INVALID(vsk->qpHandle)) {
4394- ASSERT(vsk->qpair);
4395- vmci_qpair_detach(&vsk->qpair);
4396- vsk->qpHandle = VMCI_INVALID_HANDLE;
4397- ASSERT(vsk->qpair == NULL);
4398- vsk->produceSize = vsk->consumeSize = 0;
4399- }
4400-
4401- /*
4402- * Each list entry holds a reference on the socket, so we should not even be
4403- * here if the socket is in one of our lists. If we are we have a stray
4404- * sock_put() that needs to go away.
4405- */
4406- ASSERT(!VSockVmciInBoundTable(sk));
4407- ASSERT(!VSockVmciInConnectedTable(sk));
4408- ASSERT(!VSockVmciIsPending(sk));
4409- ASSERT(!VSockVmciInAcceptQueue(sk));
4410-
4411- /*
4412- * When clearing these addresses, there's no need to set the family and
4413- * possibly register the address family with the kernel.
4414- */
4415- VSockAddr_InitNoFamily(&vsk->localAddr, VMADDR_CID_ANY, VMADDR_PORT_ANY);
4416- VSockAddr_InitNoFamily(&vsk->remoteAddr, VMADDR_CID_ANY, VMADDR_PORT_ANY);
4417-
4418- NOTIFYCALL(vsk, socketDestruct, sk);
4419-
4420- compat_mutex_lock(&registrationMutex);
4421- vsockVmciSocketCount--;
4422- VSockVmciTestUnregister();
4423- compat_mutex_unlock(&registrationMutex);
4424-
4425- VSOCK_STATS_CTLPKT_DUMP_ALL();
4426- VSOCK_STATS_HIST_DUMP_ALL();
4427- VSOCK_STATS_TOTALS_DUMP_ALL();
4428-}
4429-
4430-
4431-/*
4432- *----------------------------------------------------------------------------
4433- *
4434- * VSockVmciQueueRcvSkb --
4435- *
4436- * Receives skb on the socket's receive queue.
4437- *
4438- * Results:
4439- * Zero on success, negative error code on failure.
4440- *
4441- * Side effects:
4442- * None.
4443- *
4444- *----------------------------------------------------------------------------
4445- */
4446-
4447-static int
4448-VSockVmciQueueRcvSkb(struct sock *sk, // IN
4449- struct sk_buff *skb) // IN
4450-{
4451- int err;
4452-
4453- err = sock_queue_rcv_skb(sk, skb);
4454- if (err) {
4455- kfree_skb(skb);
4456- }
4457-
4458- return err;
4459-}
4460-
4461-
4462-/*
4463- *----------------------------------------------------------------------------
4464- *
4465- * VSockVmciRegisterProto --
4466- *
4467- * Registers the vmci sockets protocol family.
4468- *
4469- * Results:
4470- * Zero on success, error code on failure.
4471- *
4472- * Side effects:
4473- * None.
4474- *
4475- *----------------------------------------------------------------------------
4476- */
4477-
4478-static int
4479-VSockVmciRegisterProto(void)
4480-{
4481- int err = 0;
4482-
4483- /*
4484- * From 2.6.9 until 2.6.11, these address families called sk_alloc_slab()
4485- * and the allocated slab was assigned to the slab variable in the proto
4486- * struct and was created of size slab_obj_size. As of 2.6.12 and later,
4487- * this slab allocation was moved
4488- * into proto_register() and only done if you specified a non-zero value
4489- * for the second argument (alloc_slab); the size of the slab element was
4490- * changed to obj_size.
4491- */
4492-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 12)
4493- err = sk_alloc_slab(&vsockVmciProto, "vsock");
4494- if (err != 0) {
4495- sk_alloc_slab_error(&vsockVmciProto);
4496- }
4497-#else
4498- /* Specify 1 as the second argument so the slab is created for us. */
4499- err = proto_register(&vsockVmciProto, 1);
4500-#endif
4501-
4502- return err;
4503-}
4504-
4505-
4506-/*
4507- *----------------------------------------------------------------------------
4508- *
4509- * VSockVmciUnregisterProto --
4510- *
4511- * Unregisters the vmci sockets protocol family.
4512- *
4513- * Results:
4514- * None.
4515- *
4516- * Side effects:
4517- * None.
4518- *
4519- *----------------------------------------------------------------------------
4520- */
4521-
4522-static void
4523-VSockVmciUnregisterProto(void)
4524-{
4525-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 12)
4526- sk_free_slab(&vsockVmciProto);
4527-#else
4528- proto_unregister(&vsockVmciProto);
4529-#endif
4530-
4531- VSOCK_STATS_RESET();
4532-}
4533-
4534-
4535-/*
4536- *----------------------------------------------------------------------------
4537- *
4538- * VSockVmciRegisterAddressFamily --
4539- *
4540- * Registers our socket address family with the kernel.
4541- *
4542- * Note that this assumes the registration lock is held.
4543- *
4544- * Results:
4545- * The address family value on success, negative error code on failure.
4546- *
4547- * Side effects:
4548- * Callers of socket operations with the returned value, on success, will
4549- * be able to use our socket implementation.
4550- *
4551- *----------------------------------------------------------------------------
4552- */
4553-
4554-static int
4555-VSockVmciRegisterAddressFamily(void)
4556-{
4557- int err = 0;
4558- int i;
4559-
4560- /*
4561- * Linux will not allocate an address family to code that is not part of the
4562- * kernel proper, so until that time comes we need a workaround. Here we
4563- * loop through the allowed values and claim the first one that's not
4564- * currently used. Users will then make an ioctl(2) into our module to
4565- * retrieve this value before calling socket(2).
4566- *
4567- * This is undesirable, but it's better than having users' programs break
4568- * when a hard-coded, currently-available value gets assigned to someone
4569- * else in the future.
4570- */
4571- for (i = NPROTO - 1; i >= 0; i--) {
4572- vsockVmciFamilyOps.family = i;
4573- err = sock_register(&vsockVmciFamilyOps);
4574- if (err) {
4575- vsockVmciFamilyOps.family = VSOCK_INVALID_FAMILY;
4576- } else {
4577- vsockVmciDgramOps.family = i;
4578- vsockVmciStreamOps.family = i;
4579- vsockVmciSeqOps.family = i;
4580- err = i;
4581- break;
4582- }
4583- }
4584-
4585- if (VSOCK_INVALID_FAMILY == vsockVmciFamilyOps.family) {
4586- Warning("Could not register address family.\n");
4587- }
4588-
4589- return err;
4590-}
4591-
4592-
4593-/*
4594- *----------------------------------------------------------------------------
4595- *
4596- * VSockVmciUnregisterAddressFamily --
4597- *
4598- * Unregisters the address family with the kernel.
4599- *
4600- * Note that this assumes the registration lock is held.
4601- *
4602- * Results:
4603- * None.
4604- *
4605- * Side effects:
4606- * Our socket implementation is no longer accessible.
4607- *
4608- *----------------------------------------------------------------------------
4609- */
4610-
4611-static void
4612-VSockVmciUnregisterAddressFamily(void)
4613-{
4614- if (vsockVmciFamilyOps.family != VSOCK_INVALID_FAMILY) {
4615- sock_unregister(vsockVmciFamilyOps.family);
4616- }
4617-
4618- vsockVmciDgramOps.family = vsockVmciFamilyOps.family = VSOCK_INVALID_FAMILY;
4619- vsockVmciStreamOps.family = vsockVmciFamilyOps.family;
4620- vsockVmciSeqOps.family = vsockVmciFamilyOps.family;
4621-}
4622-
4623-
4624-
4625-
4626-/*
4627- *----------------------------------------------------------------------------
4628- *
4629- * VSockVmciRegisterWithVmci --
4630- *
4631- * Registers with the VMCI device, and creates control message
4632- * and event handlers.
4633- *
4634- * Results:
4635- * Zero on success, error code on failure.
4636- *
4637- * Side effects:
4638- * None.
4639- *
4640- *----------------------------------------------------------------------------
4641- */
4642-
4643-static int
4644-VSockVmciRegisterWithVmci(void)
4645-{
4646- int err = 0;
4647- uint32 apiVersion;
4648-
4649- /*
4650- * We don't call into the vmci module if the vmci device isn't
4651- * present.
4652- */
4653- apiVersion = VMCI_KERNEL_API_VERSION_1;
4654- vmciDevicePresent = vmci_device_get(&apiVersion, NULL, NULL, NULL);
4655- if (!vmciDevicePresent) {
4656- Warning("VMCI device not present.\n");
4657- return -1;
4658- }
4659-
4660- /*
4661- * Create the datagram handle that we will use to send and receive all
4662- * VSocket control messages for this context.
4663- */
4664- err = VSockVmciDatagramCreateHnd(VSOCK_PACKET_RID,
4665- VMCI_FLAG_ANYCID_DG_HND,
4666- VSockVmciRecvStreamCB, NULL,
4667- &vmciStreamHandle);
4668- if (err < VMCI_SUCCESS) {
4669- Warning("Unable to create datagram handle. (%d)\n", err);
4670- err = VSockVmci_ErrorToVSockError(err);
4671- goto out;
4672- }
4673-
4674- err = vmci_event_subscribe(VMCI_EVENT_QP_RESUMED,
4675- VSockVmciQPResumedCB,
4676- NULL,
4677- &qpResumedSubId);
4678- if (err < VMCI_SUCCESS) {
4679- Warning("Unable to subscribe to QP resumed event. (%d)\n", err);
4680- err = VSockVmci_ErrorToVSockError(err);
4681- qpResumedSubId = VMCI_INVALID_ID;
4682- goto out;
4683- }
4684-
4685- err = vmci_event_subscribe(VMCI_EVENT_CTX_ID_UPDATE,
4686- VSockVmciContextUpdatedCB,
4687- NULL,
4688- &ctxUpdatedSubId);
4689- if (err < VMCI_SUCCESS) {
4690- Warning("Unable to subscribe to context updated event. (%d)\n", err);
4691- err = VSockVmci_ErrorToVSockError(err);
4692- ctxUpdatedSubId = VMCI_INVALID_ID;
4693- goto out;
4694- }
4695-
4696-out:
4697- if (err != 0) {
4698- VSockVmciUnregisterWithVmci();
4699- }
4700-
4701- return err;
4702-}
4703-
4704-
4705-/*
4706- *----------------------------------------------------------------------------
4707- *
4708- * VSockVmciUnregisterWithVmci --
4709- *
4710- * Destroys control message and event handlers, and unregisters
4711- * with the VMCI device
4712- *
4713- * Results:
4714- * None.
4715- *
4716- * Side effects:
4717- * Our socket implementation is no longer accessible.
4718- *
4719- *----------------------------------------------------------------------------
4720- */
4721-
4722-static void
4723-VSockVmciUnregisterWithVmci(void)
4724-{
4725- if (!vmciDevicePresent) {
4726- /* Nothing was registered. */
4727- return;
4728- }
4729-
4730- if (!VMCI_HANDLE_INVALID(vmciStreamHandle)) {
4731- if (vmci_datagram_destroy_handle(vmciStreamHandle) != VMCI_SUCCESS) {
4732- Warning("Could not destroy VMCI datagram handle.\n");
4733- }
4734- vmciStreamHandle = VMCI_INVALID_HANDLE;
4735- }
4736-
4737- if (qpResumedSubId != VMCI_INVALID_ID) {
4738- vmci_event_unsubscribe(qpResumedSubId);
4739- qpResumedSubId = VMCI_INVALID_ID;
4740- }
4741-
4742- if (ctxUpdatedSubId != VMCI_INVALID_ID) {
4743- vmci_event_unsubscribe(ctxUpdatedSubId);
4744- ctxUpdatedSubId = VMCI_INVALID_ID;
4745- }
4746-
4747- vmci_device_release(NULL);
4748- vmciDevicePresent = FALSE;
4749-}
4750-
4751-
4752-/*
4753- *----------------------------------------------------------------------------
4754- *
4755- * VSockVmciStreamHasData --
4756- *
4757- * Gets the amount of data available for a given stream socket's consume
4758- * queue.
4759- *
4760- * Note that this assumes the socket lock is held.
4761- *
4762- * Results:
4763- * The amount of data available or a VMCI error code on failure.
4764- *
4765- * Side effects:
4766- * None.
4767- *
4768- *----------------------------------------------------------------------------
4769- */
4770-
4771-int64
4772-VSockVmciStreamHasData(VSockVmciSock *vsk) // IN
4773-{
4774- ASSERT(vsk);
4775-
4776- return vmci_qpair_consume_buf_ready(vsk->qpair);
4777-}
4778-
4779-
4780-/*
4781- *----------------------------------------------------------------------------
4782- *
4783- * VSockVmciStreamHasSpace --
4784- *
4785- * Gets the amount of space available for a give stream socket's produce
4786- * queue.
4787- *
4788- * Note that this assumes the socket lock is held.
4789- *
4790- * Results:
4791- * The amount of space available or a VMCI error code on failure.
4792- *
4793- * Side effects:
4794- * None.
4795- *
4796- *----------------------------------------------------------------------------
4797- */
4798-
4799-int64
4800-VSockVmciStreamHasSpace(VSockVmciSock *vsk) // IN
4801-{
4802- ASSERT(vsk);
4803-
4804- return vmci_qpair_produce_free_space(vsk->qpair);
4805-}
4806-
4807-
4808-/*
4809- * Socket operations.
4810- */
4811-
4812-/*
4813- *----------------------------------------------------------------------------
4814- *
4815- * VSockVmciRelease --
4816- *
4817- * Releases the provided socket by freeing the contents of its queue. This
4818- * is called when a user process calls close(2) on the socket.
4819- *
4820- * Results:
4821- * Zero on success, negative error code on failure.
4822- *
4823- * Side effects:
4824- * None.
4825- *
4826- *----------------------------------------------------------------------------
4827- */
4828-
4829-static int
4830-VSockVmciRelease(struct socket *sock) // IN
4831-{
4832- __VSockVmciRelease(sock->sk);
4833- sock->sk = NULL;
4834- sock->state = SS_FREE;
4835-
4836- return 0;
4837-}
4838-
4839-
4840-/*
4841- *----------------------------------------------------------------------------
4842- *
4843- * VSockVmciBind --
4844- *
4845- * Binds the provided address to the provided socket.
4846- *
4847- * Results:
4848- * Zero on success, negative error code on failure.
4849- *
4850- * Side effects:
4851- * None.
4852- *
4853- *----------------------------------------------------------------------------
4854- */
4855-
4856-static int
4857-VSockVmciBind(struct socket *sock, // IN
4858- struct sockaddr *addr, // IN
4859- int addrLen) // IN
4860-{
4861- int err;
4862- struct sock *sk;
4863- struct sockaddr_vm *vmciAddr;
4864-
4865- sk = sock->sk;
4866-
4867- if (VSockAddr_Cast(addr, addrLen, &vmciAddr) != 0) {
4868- return -EINVAL;
4869- }
4870-
4871- lock_sock(sk);
4872- err = __VSockVmciBind(sk, vmciAddr);
4873- release_sock(sk);
4874-
4875- return err;
4876-}
4877-
4878-
4879-/*
4880- *----------------------------------------------------------------------------
4881- *
4882- * VSockVmciDgramConnect --
4883- *
4884- * Connects a datagram socket. This can be called multiple times to change
4885- * the socket's association and can be called with a sockaddr whose family
4886- * is set to AF_UNSPEC to dissolve any existing association.
4887- *
4888- * Results:
4889- * Zero on success, negative error code on failure.
4890- *
4891- * Side effects:
4892- * None.
4893- *
4894- *----------------------------------------------------------------------------
4895- */
4896-
4897-static int
4898-VSockVmciDgramConnect(struct socket *sock, // IN
4899- struct sockaddr *addr, // IN
4900- int addrLen, // IN
4901- int flags) // IN
4902-{
4903- int err;
4904- struct sock *sk;
4905- VSockVmciSock *vsk;
4906- struct sockaddr_vm *remoteAddr;
4907-
4908- sk = sock->sk;
4909- vsk = vsock_sk(sk);
4910-
4911- err = VSockAddr_Cast(addr, addrLen, &remoteAddr);
4912- if (err == -EAFNOSUPPORT && remoteAddr->svm_family == AF_UNSPEC) {
4913- lock_sock(sk);
4914- VSockAddr_Init(&vsk->remoteAddr, VMADDR_CID_ANY, VMADDR_PORT_ANY);
4915- sock->state = SS_UNCONNECTED;
4916- release_sock(sk);
4917- return 0;
4918- } else if (err != 0) {
4919- return -EINVAL;
4920- }
4921-
4922- lock_sock(sk);
4923-
4924- if (!VSockAddr_Bound(&vsk->localAddr)) {
4925- struct sockaddr_vm localAddr;
4926-
4927- VSockAddr_Init(&localAddr, VMADDR_CID_ANY, VMADDR_PORT_ANY);
4928- if ((err = __VSockVmciBind(sk, &localAddr))) {
4929- goto out;
4930- }
4931- }
4932-
4933- if (!VSockAddr_SocketContextDgram(remoteAddr->svm_cid,
4934- remoteAddr->svm_port)) {
4935- err = -EINVAL;
4936- goto out;
4937- }
4938-
4939- memcpy(&vsk->remoteAddr, remoteAddr, sizeof vsk->remoteAddr);
4940- sock->state = SS_CONNECTED;
4941-
4942-out:
4943- release_sock(sk);
4944- return err;
4945-}
4946-
4947-
4948-/*
4949- *----------------------------------------------------------------------------
4950- *
4951- * VSockVmciSeqConnect --
4952- *
4953- * Connects a sequential socket.
4954- *
4955- * Results:
4956- * Zero on success, negative error code on failure.
4957- *
4958- * Side effects:
4959- * None.
4960- *
4961- *----------------------------------------------------------------------------
4962- */
4963-
4964-static int
4965-VSockVmciSeqConnect(struct socket *sock, // IN
4966- struct sockaddr *addr, // IN
4967- int addrLen, // IN
4968- int flags) // IN
4969-{
4970- int err;
4971- struct sock *sk;
4972- VSockVmciSock *vsk;
4973- VSockSeqPacket pkt;
4974- struct sockaddr_vm *remoteAddr;
4975-
4976- sk = sock->sk;
4977- vsk = vsock_sk(sk);
4978-
4979- lock_sock(sk);
4980-
4981- if (SS_CONNECTED == sock->state) {
4982- err = -EISCONN;
4983- goto out;
4984- } else if (SS_CONNECTING == sock->state ||
4985- SS_DISCONNECTING == sock->state) {
4986- err = -EINVAL;
4987- goto out;
4988- }
4989-
4990- if (VSockAddr_Cast(addr, addrLen, &remoteAddr) != 0) {
4991- err = -EINVAL;
4992- goto out;
4993- }
4994-
4995- if (!VSockAddr_Bound(&vsk->localAddr)) {
4996- struct sockaddr_vm localAddr;
4997-
4998- VSockAddr_Init(&localAddr, VMADDR_CID_ANY, VMADDR_PORT_ANY);
4999- if ((err = __VSockVmciBind(sk, &localAddr))) {
5000- goto out;
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches