Changeset 63673 in vbox for trunk/src/VBox/HostDrivers/Support
- Timestamp:
- Aug 31, 2016 11:16:18 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp
r63573 r63673 512 512 # ifdef RT_OS_LINUX 513 513 static uint32_t g_uCaps; 514 static uint32_t g_uCapsVersion; 514 515 # endif 515 516 #endif … … 1808 1809 # else 1809 1810 cap_user_header_t hdr = (cap_user_header_t)alloca(sizeof(*hdr)); 1810 cap_user_data_t cap = (cap_user_data_t)alloca( sizeof(*cap));1811 cap_user_data_t cap = (cap_user_data_t)alloca(2 /*_LINUX_CAPABILITY_U32S_3*/ * sizeof(*cap)); 1811 1812 memset(hdr, 0, sizeof(*hdr)); 1812 hdr->version = _LINUX_CAPABILITY_VERSION; 1813 memset(cap, 0, sizeof(*cap)); 1813 capget(&hdr, NULL); 1814 if ( hdr->version != 0x19980330 /* _LINUX_CAPABILITY_VERSION_1, _LINUX_CAPABILITY_U32S_1 = 1 */ 1815 && hdr->version != 0x20071026 /* _LINUX_CAPABILITY_VERSION_2, _LINUX_CAPABILITY_U32S_2 = 2 */ 1816 && hdr->version != 0x20080522 /* _LINUX_CAPABILITY_VERSION_3, _LINUX_CAPABILITY_U32S_3 = 2 */) 1817 hdr->version = _LINUX_CAPABILITY_VERSION; 1818 g_uCapsVersion = hdr->version; 1819 memset(cap, 0, 2 /* _LINUX_CAPABILITY_U32S_3 */ * sizeof(*cap)); 1814 1820 cap->effective = g_uCaps; 1815 1821 cap->permitted = g_uCaps; … … 1982 1988 # else 1983 1989 cap_user_header_t hdr = (cap_user_header_t)alloca(sizeof(*hdr)); 1984 cap_user_data_t cap = (cap_user_data_t)alloca( sizeof(*cap));1990 cap_user_data_t cap = (cap_user_data_t)alloca(2 /* _LINUX_CAPABILITY_U32S_3 */ * sizeof(*cap)); 1985 1991 memset(hdr, 0, sizeof(*hdr)); 1986 hdr->version = _LINUX_CAPABILITY_VERSION;1987 memset(cap, 0, sizeof(*cap));1992 hdr->version = g_uCapsVersion; 1993 memset(cap, 0, 2 /* _LINUX_CAPABILITY_U32S_3 */ * sizeof(*cap)); 1988 1994 cap->effective = g_uCaps; 1989 1995 cap->permitted = g_uCaps;
Note:
See TracChangeset
for help on using the changeset viewer.