VirtualBox

Ignore:
Timestamp:
Oct 6, 2017 7:46:09 AM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
118264
Message:

Runtime/r0drv/darwin: Don't obfuscate R0 pointers, kernel addresses are logged to the kernel log only root has access to

File:
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/darwin/rtStrFormatKernelAddress-r0drv-darwin.cpp

    r68994 r68995  
    3030*********************************************************************************************************************************/
    3131#define LOG_GROUP RTLOGGROUP_STRING
    32 #include "the-linux-kernel.h"
     32#include "the-darwin-kernel.h"
    3333#include "internal/iprt.h"
    3434
     
    4242                                            signed int cchPrecision, unsigned int fFlags)
    4343{
    44 #if !defined(DEBUG) && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)
    45     RT_NOREF(cchWidth, cchPrecision);
    46     /* use the Linux kernel function which is able to handle "%pK" */
    47     static const char s_szFmt[] = "0x%pK";
    48     const char *pszFmt = s_szFmt;
    49     if (!(fFlags & RTSTR_F_SPECIAL))
    50         pszFmt += 2;
    51     return scnprintf(pszBuf, cbBuf, pszFmt, uPtr);
    52 #else
     44    /*
     45     * Kernel addresses don't need obfuscation in R0 because the kernel log is only accessible
     46     * as root.
     47     */
    5348    Assert(cbBuf >= 64);
    5449    return RTStrFormatNumber(pszBuf, uPtr, 16, cchWidth, cchPrecision, fFlags);
    55 #endif
    5650}
Note: See TracChangeset for help on using the changeset viewer.

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