VirtualBox

Ignore:
Timestamp:
Aug 13, 2015 10:16:46 AM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
102075
Message:

IPRT,SUPDrv: More work on preserving certain EFLAGS for CONFIG_X86_SMAP.

Location:
trunk/src/VBox/HostDrivers/Support
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/Makefile.kmk

    r57256 r57313  
    581581 endif
    582582 if ($(VBOX_VERSION_BUILD) % 2) == 1
    583   VBoxDrv_DEFS           += VBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV
     583  VBoxDrv_DEFS           += VBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV IPRT_WITH_EFLAGS_AC_PRESERVING
    584584 endif
    585585
     
    707707        $(QUIET)$(SED) -e "" \
    708708                $(if-expr !defined(VBOX_WITH_HARDENING)   ,-e "s;-DVBOX_WITH_HARDENING;;g",) \
    709                 $(if-expr ($(VBOX_VERSION_BUILD) % 2) == 0 || 1,-e "s;-DVBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV;;g",) \
     709                $(if-expr ($(VBOX_VERSION_BUILD) % 2) == 0 || 1 \
     710                 , -e "s;-DVBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV;;g" -e "s;-DIPRT_WITH_EFLAGS_AC_PRESERVING;;g",) \
    710711                --output $@ $<
    711712        %$(QUIET2)$(APPEND) -t '$(PATH_TARGET)/vboxdrv-mod-1.dep' \
  • trunk/src/VBox/HostDrivers/Support/linux/Makefile

    r57254 r57313  
    256256KFLAGS   := -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 \
    257257            -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING \
    258             -DSUPDRV_WITH_RELEASE_LOGGER -DVBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV \
     258            -DSUPDRV_WITH_RELEASE_LOGGER -DVBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV -DIPRT_WITH_EFLAGS_AC_PRESERVING \
    259259            -Wno-declaration-after-statement
    260260ifdef VBOX_REDHAT_KABI
  • trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c

    r57305 r57313  
    710710    {
    711711        char szTmp[48];
    712         RTStrPrintf(szTmp, sizeof(szTmp), "uCmd=%#x: %#x->%#x!", uCmd, (uint32_t)fSavedEfl, (uint32_t)ASMGetFlags());
     712        RTStrPrintf(szTmp, sizeof(szTmp), "uCmd=%#x: %#x->%#x!", _IOC_NR(uCmd), (uint32_t)fSavedEfl, (uint32_t)ASMGetFlags());
    713713        supdrvBadContext(&g_DevExt, "SUPDrv-linux.c",  __LINE__, szTmp);
    714714    }
     
    741741     * Read the header.
    742742     */
    743     if (RT_UNLIKELY(copy_from_user(&Hdr, (void *)ulArg, sizeof(Hdr))))
     743    if (RT_FAILURE(RTR0MemUserCopyFrom(&Hdr, ulArg, sizeof(Hdr))))
    744744    {
    745745        Log(("VBoxDrvLinuxIOCtl: copy_from_user(,%#lx,) failed; uCmd=%#x\n", ulArg, uCmd));
     
    772772        return -ENOMEM;
    773773    }
    774     if (RT_UNLIKELY(copy_from_user(pHdr, (void *)ulArg, Hdr.cbIn)))
     774    if (RT_FAILURE(RTR0MemUserCopyFrom(pHdr, ulArg, Hdr.cbIn)))
    775775    {
    776776        Log(("VBoxDrvLinuxIOCtl: copy_from_user(,%#lx, %#x) failed; uCmd=%#x\n", ulArg, Hdr.cbIn, uCmd));
     
    797797            cbOut = cbBuf;
    798798        }
    799         if (RT_UNLIKELY(copy_to_user((void *)ulArg, pHdr, cbOut)))
     799        if (RT_FAILURE(RTR0MemUserCopyTo(ulArg, pHdr, cbOut)))
    800800        {
    801801            /* this is really bad! */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette