xnu | XNU kernel is part of the Darwin operating system
kandi X-RAY | xnu Summary
kandi X-RAY | xnu Summary
config - configurations for exported apis for supported architecture and platform. SETUP - Basic set of tools used for configuring the kernel, versioning and kextsymbol management. EXTERNAL_HEADERS - Headers sourced from other projects to avoid dependency cycles when building. These headers should be regularly synced when source is updated. libkern - C++ IOKit library code for handling of drivers and kexts. libsa - kernel bootstrap code for startup. libsyscall - syscall library interface for userspace programs. libkdd - source for user library for parsing kernel data like kernel chunked data. makedefs - top level rules and defines for kernel build. osfmk - Mach kernel based subsystems. pexpert - Platform specific code like interrupt handling, atomics etc. security - Mandatory Access Check policy interfaces and related implementation. bsd - BSD subsystems code. tools - A set of utilities for testing, debugging and profiling kernel.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of xnu
xnu Key Features
xnu Examples and Code Snippets
Community Discussions
Trending Discussions on xnu
QUESTION
I am working now on a macOS Sierra, which does not have the /proc/sys/fs/pipe-max-size nor fcntl's F_SETPIPE_SZ. (Darwin macos-1012 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64)
I am trying to get macOS' log stream
output through pipe()
since I am opening it with execvp()
but I only get its logs when the whole buffer is filled (16384 bytes), this may take hours, days, or more depending on the filter used with log stream
.
When I run log stream
in a command-line it shows log by log and there is no need to wait for the 16384 bytes to be written on STDOUT. But I do have to wait also when I redirect STDOUT as follows:
ANSWER
Answered 2021-May-24 at 19:34You can use command like:
QUESTION
Suddenly on the afternoon of January 6, 2021, my Selenium Protractor tests under OSX stopped working with the mysterious error
...ANSWER
Answered 2021-Feb-03 at 18:26Edit: this answer should be considered deprecated now that the underlying bug in webdriver-manager has been fixed. A better solution would be to upgrade to the newest version of webdriver-manager. The answer below may be useful if people need to use an older version of webdriver-manager which still has the bug.
As per Deepak Srinivasan's comment above, this error is caused by https://github.com/angular/webdriver-manager/issues/476
Root Cause: The ChromeDriver team added "_m1" to the end of the filename for their Apple Silicon ARM builds of Chromedriver -- but both the Silicon and Intel versions of chromedriver have "mac64" in the filename, and the version number is exactly the same. This causes webdriver-manager to always download the Silicon build of Chromedriver, even on Intel macs. As a general solution, simply avoid using the chromedriver that has _m1 in its filename if you are on an Intel mac.
Solution 1: Downgrade to Chrome 86.0.4240.198 and Chromedriver 86.0.4240.22. These versions work together and are the most recent versions prior to the new and problematic support for Silicon ARM
Chrome 86 download page: https://google-chrome.en.uptodown.com/mac/download/2920124
Disable auto-updates in Chrome: https://superuser.com/questions/1359017/how-do-i-disable-automatic-updates-of-google-chrome-on-mac-os-x
Chromedriver 86: https://chromedriver.storage.googleapis.com/index.html?path=86.0.4240.22/
QUESTION
I'm trying to write a program to expose the arguments of other pids on macOS. I've made the KERN_PROCARGS2
sysctl
, but it turns out that everyone and their dog use this wrong. Including Apple's ps
, and Google's Chrome. The exec
family of functions all allow you to pass an empty string as argv[0]
, which is not great but it can happen and so must be dealt with. In this case, the standard approach of skipping forward past the NULL
s following the exec_path
in the returned buffer doesn't work, as the last NULL
before the rest of the arguments is actually the terminating NULL
of an empty string, So you wind up skipping an argument you didn't mean to, which can result in printing an env var as an argument (I've confirmed this behaviour in many programs).
To do this properly one must calculate how many nulls to skip, instead of skipping them all every time. There are references around the web to the different parts of the returned buffer being pointer aligned, however no matter what part of the buffer I try to check with len % 8
I don't get a correct count of padding NULL
s.
ANSWER
Answered 2021-Apr-13 at 05:00It's the length of the saved exec_path
that needs to be padded to a multiple of the system pointer length.
QUESTION
For the love of my life, I cannot figure this one out: I've compiled xdebug from source code and while the CLI will show me that it is active the webserver will not.
This is the process I went through.
...ANSWER
Answered 2021-Mar-18 at 16:10After banging my head against the wall for a few hours, I was finally able to figure out what the problem was.
There was an error message about xcode not being code signed:
QUESTION
I work on what can be seen as a C interpreter that detects all undefined behaviors in the program it interprets. While using this interpreter to find bugs in a legacy open-source C application, I was puzzled by the following behavior:
The legacy application expected a 10-byte header that it needed it its entirety in order to do further work. It was correctly calling fread(buffer, 10, 1, f);
. Incorrectly, it did not assign the result of the fread
call, and started parsing the buffer right away.
When this fread
was applied on a file with less than 10 bytes available, what happened was that buffer
was partially filed with the available data. The interpreter, as it is designed to, detected that an uninitialized part of the buffer was used later and warned about that and I was able to trace the problem to the result of fread
being discarded.
It puzzled me for one minute that the fread
written by my colleagues had partially filled the buffer, even though it was going to return 0
eventually, and I wondered if this could be improved. Obviously some implementations do read into the buffer and in the end return the number of read record as return n_bytes / __size;
, letting the division round down, in this case to 0
. But I wondered if other implementations might only write to buffer
if an entire record is available, and leave it entirely uninitialized otherwise.
In practice, on the two Unices that I have at hand, fread
behaves the same way as the model implementation written by my colleagues:
ANSWER
Answered 2021-Mar-14 at 19:11Both C99 (§7.19.8.2) and C11 (§7.21.8.2) define fread()
with the following description:
The
fread
function reads, into the array pointed to byptr
, up tonmemb
elements whose size is specified bysize
, from the stream pointed to bystream
. For each object,size
calls are made to thefgetc
function and the results stored, in the order read, in an array ofunsigned char
exactly overlaying the object. The file position indicator for the stream (if defined) is advanced by the number of characters successfully read. If an error occurs, the resulting value of the file position indicator for the stream is indeterminate. If a partial element is read, its value is indeterminate.
That last bit should clear your doubts:
If a partial element is read, its value is indeterminate.
So, even though all the implementations you see appear to behave "nicely", you cannot rely on that, as it is implementation-dependent behavior that the standard does not define. A program that wishes to read a partial element (if the file contains one) should use a size
of 1
and check the return value. Indeed, if a program does not do this and instead reads with size > 1
and nmemb = 1
, it wouldn't even have the ability to distinguish between initialized and unitialized data into the buffer in the case of a last partial element.
QUESTION
need help. in few days i got error like this.
...ANSWER
Answered 2021-Mar-08 at 05:12Try to completely Uninstall Node.js from the system and try to install node v12.13.0 (You can install it from https://nodejs.org/dist/v12.13.0/)
QUESTION
I cannot build and install Oracle Instant Client 19.8 on macOS Big Sur 11.2.1. I get the following error:
...ANSWER
Answered 2021-Feb-21 at 18:12The problem is that the DYLD_LIBRARY_PATH
environment variable is not propagated to perl when running make test
as described here. Instead of running cpanm DBD::Oracle
, you can download the module run the tests manually using e.g. prove
. The following worked for me (macOS BigSur 11.2.1), perlbrew perl version 5.32.0:
Download and install
instantclient-basic-macos.x64-19.8.0.0.0dbru.dmg
andinstantclient-sdk-macos.x64-19.8.0.0.0dbru.dmg
from https://www.oracle.com/database/technologies/instant-client/macos-intel-x86-downloads.htmlInstall
DBD::Oracle
(without runningmake test
)
QUESTION
Node Version Manager (v0.35.3)
I am getting the following error using multiple different commands, even just opening up my terminal I get this.
...ANSWER
Answered 2021-Feb-17 at 14:10If you're looking to troubleshoot how things got to the state they're in, there may be a lot of things to investigate. However, if you just want to fix the problem, it should be harmless and effective to reinstall nvm
. No need to uninstall (as installing over an existing nvm
is the same as updating nvm
).
Per the instructions on installing/updating, run either:
QUESTION
I compile a macOS driverkit system extension as a Universal library so that it contains both x86_64
and arm64
. One Apple Silicon computer A the driver starts when I attach the USB device. On Apple Silicon computer B I can see kernel: exec_mach_imgact: disallowing arm64 platform driverkit binary "com.example.driver", should be arm64e
being printed in the Console.app when the USB device is attached. I've looked at the source code
of where this is happening but I cannot figure out what the problem is.
If I compile it for arm64e
then it get exec_mach_imgact: not running binary "com.example.driver" built against preview arm64e
on computer A, bit then it starts on computer B.
None of the computers have -arm64e_preview_abi
set in the boot-args
.
If I create a new Xcode (12.4) project on each machine and build Release then computer A and otool -fvv com.example.driver
gives
ANSWER
Answered 2021-Jan-31 at 10:41My experience so far indicates that arm64e
is the correct and only correct Apple Silicon architecture to use for dexts.
For one, there's the "disallowing arm64 platform" error, and also Apple's own DriverKit based drivers are built for arm64e
:
QUESTION
I am currently working on an iOS Jailbreak for iOS 13.7.
As part of the jailbreak, I need to do a series of patches to the XNU Kernel live in the memory.
Of course, the kernel is protected by kASLR
, KPP
/ KTRR
, and other memory watchdogs that would trigger a Kernel Panic if something is modified.
As luck would have it, KTRR
(Kernel Text Ready Only Region) can only protect, well, static data that is not supposed to change (i.e. the TEXT
section and constants). The variables can still be altered.
I am building a PatchFinder which is supposed to locate a function or a variable in the XNU memory based on tell-tale symbols and I am wondering what would be the most effective approach for this.
I am currently adapting on top of the PatchFinder made publicly available back in the iOS 8 era by in7egal
which looks like this:
ANSWER
Answered 2020-Dec-31 at 16:55The variable you're looking for doesn't exist anymore.
The bytes in your first snippet make up Thumb instructions, which find this function in AMFI in a 32bit kernelcache:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install xnu
$(DSTROOT)/System/Library/Frameworks/Kernel.framework/Headers
$(DSTROOT)/System/Library/Frameworks/Kernel.framework/PrivateHeaders
$(DSTROOT)/usr/include/
$(DSTROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
DATAFILES : To make header file available in user level - $(DSTROOT)/usr/include
PRIVATE_DATAFILES : To make header file available to Apple internal in user level - $(DSTROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
KERNELFILES : To make header file available in kernel level - $(DSTROOT)/System/Library/Frameworks/Kernel.framework/Headers $(DSTROOT)/System/Library/Frameworks/Kernel.framework/PrivateHeaders
PRIVATE_KERNELFILES : To make header file available to Apple internal for kernel extensions - $(DSTROOT)/System/Library/Frameworks/Kernel.framework/PrivateHeaders
INSTALL_MI_LIST : Installs header file to a location that is available to everyone in user level. Locations - $(DSTROOT)/usr/include Definition - INSTALL_MI_LIST = ${DATAFILES}
INSTALL_MI_LCL_LIST : Installs header file to a location that is available for Apple internal in user level. Locations - $(DSTROOT)/System/Library/Frameworks/System.framework/PrivateHeaders Definition - INSTALL_MI_LCL_LIST = ${PRIVATE_DATAFILES}
INSTALL_KF_MI_LIST : Installs header file to location that is available to everyone for kernel extensions. Locations - $(DSTROOT)/System/Library/Frameworks/Kernel.framework/Headers Definition - INSTALL_KF_MI_LIST = ${KERNELFILES}
INSTALL_KF_MI_LCL_LIST : Installs header file to location that is available for Apple internal for kernel extensions. Locations - $(DSTROOT)/System/Library/Frameworks/Kernel.framework/PrivateHeaders Definition - INSTALL_KF_MI_LCL_LIST = ${KERNELFILES} ${PRIVATE_KERNELFILES}
EXPORT_MI_LIST : Exports header file to all of xnu (bsd/, osfmk/, etc.) for compilation only. Does not install anything into the SDK. Definition - EXPORT_MI_LIST = ${KERNELFILES} ${PRIVATE_KERNELFILES}
PRIVATE : If defined, enclosed definitions are considered System Private Interfaces. These are visible within xnu and exposed in user/kernel headers installed within the AppleInternal "PrivateHeaders" sections of the System and Kernel frameworks.
KERNEL_PRIVATE : If defined, enclosed code is available to all of xnu kernel and Apple internal kernel extensions and omitted from user headers.
BSD_KERNEL_PRIVATE : If defined, enclosed code is visible exclusively within the xnu/bsd module.
MACH_KERNEL_PRIVATE: If defined, enclosed code is visible exclusively within the xnu/osfmk module.
XNU_KERNEL_PRIVATE: If defined, enclosed code is visible exclusively within xnu.
KERNEL : If defined, enclosed code is available within xnu and kernel extensions and is not visible in user level header files. Only the header files installed in following paths will have the code - $(DSTROOT)/System/Library/Frameworks/Kernel.framework/Headers $(DSTROOT)/System/Library/Frameworks/Kernel.framework/PrivateHeaders
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page