From: VMware, Inc <> Date: Mon, 15 Oct 2012 04:51:48 +0000 (-0700) Subject: Changes in shared code that don't affect open-vm-tools functionality. X-Git-Tag: 2012.10.14-874563~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3db19df835b61a9f375d52326251520d160ef4bb;p=thirdparty%2Fopen-vm-tools.git Changes in shared code that don't affect open-vm-tools functionality. Signed-off-by: Dmitry Torokhov --- diff --git a/open-vm-tools/lib/file/fileTempPosix.c b/open-vm-tools/lib/file/fileTempPosix.c index c5bf90fe2..306dee86e 100644 --- a/open-vm-tools/lib/file/fileTempPosix.c +++ b/open-vm-tools/lib/file/fileTempPosix.c @@ -456,9 +456,12 @@ FileCreateSafeTmpDir(uid_t userId, // IN: * * Return a safe temporary directory (i.e. a temporary directory which * is not prone to symlink attacks, because it is only writable by the - * current effective user). Guaranteed to return the same directory - * every time it is called during the lifetime of the current process - * (unless that directory is deleted while the process is running). + * current effective user). + * + * Guaranteed to return the same directory every time it is + * called during the lifetime of the current process, for the + * current effective user ID. (Barring the user manually deleting + * or renaming the directory.) * * Results: * The allocated directory path on success. diff --git a/open-vm-tools/lib/include/backdoor_def.h b/open-vm-tools/lib/include/backdoor_def.h index bf4a4e1fe..d564f2208 100644 --- a/open-vm-tools/lib/include/backdoor_def.h +++ b/open-vm-tools/lib/include/backdoor_def.h @@ -165,7 +165,8 @@ #define BDOOR_CMD_GET_FORCE_X2APIC 76 /* CPL 0 only */ #define BDOOR_CMD_SET_PCI_HOLE 77 /* CPL 0 only */ #define BDOOR_CMD_GET_PCI_HOLE 78 /* CPL 0 only */ -#define BDOOR_CMD_MAX 79 +#define BDOOR_CMD_GET_PCI_BAR 79 /* CPL 0 only */ +#define BDOOR_CMD_MAX 80 /* diff --git a/open-vm-tools/lib/include/file.h b/open-vm-tools/lib/include/file.h index afd17898f..2a60aa374 100644 --- a/open-vm-tools/lib/include/file.h +++ b/open-vm-tools/lib/include/file.h @@ -108,7 +108,10 @@ char *FileMacos_DiskDevToVolumeName(char const *bsdDiskDev); char *FileMacos_DiskDeviceToUniqueID(char const *bsdPath); char *FileMacos_UniqueIDToDiskDevice(char const *identifier); - +Bool FileMacOS_MakeSecureLibraryCopies(const char *inDir, + const char **dylibName, + unsigned numDylibs, + char **outDir); #elif defined VMX86_SERVER struct FS_PartitionListResult; diff --git a/open-vm-tools/lib/include/loglevel_user.h b/open-vm-tools/lib/include/loglevel_user.h index c499517da..c9aef27b5 100644 --- a/open-vm-tools/lib/include/loglevel_user.h +++ b/open-vm-tools/lib/include/loglevel_user.h @@ -87,7 +87,7 @@ LOGLEVEL_VAR(pci_hyper), \ LOGLEVEL_VAR(pcibridge), \ LOGLEVEL_VAR(vide), \ - LOGLEVEL_VAR(ideCdrom), \ + LOGLEVEL_VAR(atapiCdrom), \ LOGLEVEL_VAR(hostonly), \ LOGLEVEL_VAR(oprom), \ LOGLEVEL_VAR(http), \ @@ -166,6 +166,7 @@ LOGLEVEL_VAR(buslogic), \ LOGLEVEL_VAR(lsilogic), \ LOGLEVEL_VAR(pvscsi), \ + LOGLEVEL_VAR(ahci), \ LOGLEVEL_VAR(diskVmnix), \ LOGLEVEL_VAR(hbaCommon), \ LOGLEVEL_VAR(backdoor), \ diff --git a/open-vm-tools/lib/include/mutexRankLib.h b/open-vm-tools/lib/include/mutexRankLib.h index 04b455f1d..9bc7edc73 100644 --- a/open-vm-tools/lib/include/mutexRankLib.h +++ b/open-vm-tools/lib/include/mutexRankLib.h @@ -137,15 +137,15 @@ * At least: * impersonate < pollDefault * keyLocator < preference (for checking AESNI) - * keyLocator < ssl (bug 743010) + * keyLocator < sslState (bug 743010) * configDb < keyLocator (for unlocking dictionaries) * battery/button < preference * workerLib < something for sure under VThread_Create * licenseCheck < preference + * sslState < getSafeTmpDir */ #define RANK_vigorTransportListLock (RANK_libLockBase + 0x7010) -#define RANK_getSafeTmpDirLock (RANK_libLockBase + 0x7020) #define RANK_batteryLock (RANK_libLockBase + 0x7030) #define RANK_buttonLock (RANK_libLockBase + 0x7040) #define RANK_impersonateLock (RANK_libLockBase + 0x7045) @@ -154,6 +154,7 @@ #define RANK_configDbLock (RANK_libLockBase + 0x7070) #define RANK_keyLocatorLock (RANK_libLockBase + 0x7080) #define RANK_sslStateLock (RANK_libLockBase + 0x7085) +#define RANK_getSafeTmpDirLock (RANK_libLockBase + 0x7086) #define RANK_licenseCheckLock (RANK_libLockBase + 0x7090) #define RANK_preferenceLock (RANK_libLockBase + 0x7100) diff --git a/open-vm-tools/lib/include/vixCommands.h b/open-vm-tools/lib/include/vixCommands.h index e48617f62..09b6b8705 100644 --- a/open-vm-tools/lib/include/vixCommands.h +++ b/open-vm-tools/lib/include/vixCommands.h @@ -31,7 +31,7 @@ /* * These describe the format of the message objects. * This will change when the client/vmx support different - * structures for the message header. Hopefully, that won't + * structures for the message header. Hopefully, that won't * happen. */ #define VIX_COMMAND_MAGIC_WORD 0xd00d0001 @@ -41,12 +41,19 @@ * These give upper bounds for how big any VIX IPC meesage * should be. There are for sanity checks and to ignore maliciously * large messages that may be part of an DoS attack. The may need to - * be revised if large messages are added to the protocol. + * be revised if large messages are added to the protocol. */ -#define VIX_COMMAND_MAX_SIZE (16 * 1024 * 1024) +#define VIX_COMMAND_MAX_SIZE (16 * 1024 * 1024) #define VIX_COMMAND_MAX_REQUEST_SIZE 65536 +/* + * We don't want to allow guest ops commands with input size too large. + * Limit it to the max request size with enough room for the credentials. + * Check bugs 824773, 926819 for more details. + */ +#define VIX_COMMAND_MAX_USER_INPUT_SIZE (VIX_COMMAND_MAX_REQUEST_SIZE - 5000) + /* * The types of credential we can pass with any request. */ diff --git a/open-vm-tools/lib/include/vm_basic_types.h b/open-vm-tools/lib/include/vm_basic_types.h index 9c637229e..842bb19c2 100644 --- a/open-vm-tools/lib/include/vm_basic_types.h +++ b/open-vm-tools/lib/include/vm_basic_types.h @@ -809,31 +809,6 @@ typedef void * UserVA; # define UNUSED_VARIABLE(_var) (void)_var #endif -/* - * REGPARM defaults to REGPARM3; i.e., a request that gcc - * put the first three arguments in registers. (It is fine - * if the function has fewer than three arguments.) Gcc only. - * Syntactically, put REGPARM where you'd put INLINE or NORETURN. - * - * Note that 64-bit code already puts the first six arguments in - * registers, so these attributes are only useful for 32-bit code. - */ - -#if defined(__GNUC__) -# define REGPARM0 __attribute__((regparm(0))) -# define REGPARM1 __attribute__((regparm(1))) -# define REGPARM2 __attribute__((regparm(2))) -# define REGPARM3 __attribute__((regparm(3))) -# define REGPARM REGPARM3 -#else -# define REGPARM0 -# define REGPARM1 -# define REGPARM2 -# define REGPARM3 -# define REGPARM -#endif - - /* * gcc can warn us if we're ignoring returns */ diff --git a/open-vm-tools/lib/include/vm_device_version.h b/open-vm-tools/lib/include/vm_device_version.h index 26f4b0633..13b631ef6 100644 --- a/open-vm-tools/lib/include/vm_device_version.h +++ b/open-vm-tools/lib/include/vm_device_version.h @@ -65,7 +65,8 @@ #define PCI_DEVICE_ID_VMWARE_82546EB 0x0760 /* dual port */ #define PCI_DEVICE_ID_VMWARE_EHCI 0x0770 #define PCI_DEVICE_ID_VMWARE_UHCI 0x0774 -#define PCI_DEVICE_ID_VMWARE_XHCI 0x0778 +#define PCI_DEVICE_ID_VMWARE_XHCI_0096 0x0778 +#define PCI_DEVICE_ID_VMWARE_XHCI_0100 0x0779 #define PCI_DEVICE_ID_VMWARE_1394 0x0780 #define PCI_DEVICE_ID_VMWARE_BRIDGE 0x0790 #define PCI_DEVICE_ID_VMWARE_ROOTPORT 0x07A0 @@ -73,6 +74,7 @@ #define PCI_DEVICE_ID_VMWARE_VMXWIFI 0x07B8 #define PCI_DEVICE_ID_VMWARE_PVSCSI 0x07C0 #define PCI_DEVICE_ID_VMWARE_82574 0x07D0 +#define PCI_DEVICE_ID_VMWARE_AHCI 0x07E0 #define PCI_DEVICE_ID_VMWARE_HDAUDIO_CODEC 0x1975 #define PCI_DEVICE_ID_VMWARE_HDAUDIO_CONTROLLER 0x1977 @@ -155,6 +157,11 @@ #define PCI_REVISION_NEC_UPD720200 0x03 #define PCI_FIRMWARE_NEC_UPD720200 0x3015 +#define SATA_ID_SERIAL_STR "00000000000000000001" /* Must be 20 Bytes */ +#define SATA_ID_FIRMWARE_STR "00000001" /* Must be 8 Bytes */ + +#define AHCI_ATA_MODEL_STR PRODUCT_GENERIC_NAME " Virtual SATA Hard Drive" +#define AHCI_ATAPI_MODEL_STR PRODUCT_GENERIC_NAME " Virtual SATA CDRW Drive" /************* Strings for IDE Identity Fields **************************/ #define VIDE_ID_SERIAL_STR "00000000000000000001" /* Must be 20 Bytes */ @@ -187,6 +194,8 @@ /************* SATA implementation limits ********************************/ #define SATA_MAX_CONTROLLERS 4 #define SATA_MAX_DEVICES 30 +#define AHCI_MIN_PORTS 1 +#define AHCI_MAX_PORTS SATA_MAX_DEVICES /* * VSCSI_BV_INTS is the number of uint32's needed for a bit vector @@ -195,7 +204,15 @@ #define VSCSI_BV_INTS CEILING(PVSCSI_MAX_DEVICES, 8 * sizeof (uint32)) #define SCSI_IDE_CHANNEL SCSI_MAX_CONTROLLERS #define SCSI_IDE_HOSTED_CHANNEL (SCSI_MAX_CONTROLLERS + 1) -#define SCSI_MAX_CHANNELS (SCSI_MAX_CONTROLLERS + 2) +#define SCSI_SATA_CHANNEL_FIRST (SCSI_IDE_HOSTED_CHANNEL + 1) +#define SCSI_MAX_CHANNELS (SCSI_SATA_CHANNEL_FIRST + SATA_MAX_CONTROLLERS) + +/************* SCSI-SATA channel IDs********************************/ +#define SATA_ID_TO_SCSI_ID(sataId) \ + (SCSI_SATA_CHANNEL_FIRST + (sataId)) + +#define SCSI_ID_TO_SATA_ID(scsiId) \ + ((scsiId) - SCSI_SATA_CHANNEL_FIRST) /************* Strings for the VESA BIOS Identity Fields *****************/ #define VBE_OEM_STRING COMPANY_NAME " SVGA" @@ -212,10 +229,10 @@ #define MAX_FLOPPY_DRIVES 2 /************* PCI Passthrough implementation limits ********************/ -#define MAX_PCI_PASSTHRU_DEVICES 6 +#define MAX_PCI_PASSTHRU_DEVICES 16 /************* Test device implementation limits ********************/ -#define MAX_PCI_TEST_DEVICES 2 +#define MAX_PCI_TEST_DEVICES 16 /************* USB implementation limits ********************************/ #define MAX_USB_DEVICES_PER_HOST_CONTROLLER 127 diff --git a/open-vm-tools/lib/include/win32util.h b/open-vm-tools/lib/include/win32util.h index ea04c1fc8..c1a99a17d 100644 --- a/open-vm-tools/lib/include/win32util.h +++ b/open-vm-tools/lib/include/win32util.h @@ -29,6 +29,7 @@ #include "includeCheck.h" #include "vm_basic_types.h" +#include "vm_atomic.h" #include "unicodeTypes.h" #ifdef _WIN32 @@ -233,5 +234,7 @@ Bool W32Util_CloseDismountHandle(void *handle); Bool W32Util_EnableSafePathSearching(void); +CRITICAL_SECTION *W32Util_GetSingletonCriticalSection(Atomic_Ptr *csMemory); + #endif // _WIN32 #endif // WIN32UTIL_H_