Open pwn0rz opened 1 year ago
Hi @pwn0rz
Thanks for your report. May I ask how you're building XNU? We have seen problems before where building XNU in a certain way with CodeQL would lead to problems like this. See also here: https://github.com/github/codeql-cli-binaries/issues/145
Hi @pwn0rz
Thanks for your report. May I ask how you're building XNU? We have seen problems before where building XNU in a certain way with CodeQL would lead to problems like this. See also here: github/codeql-cli-binaries#145
Hi @jketema
I'am using this script to build xnu-8792.61.2
: https://github.com/pwn0rz/xnu-build
And here are enviroment info
$ sw_vers
ProductName: macOS
ProductVersion: 13.1
BuildVersion: 22C6
$ uname -v
Darwin Kernel Version 22.2.0: Fri Nov 11 02:03:51 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T6000
$ xcodebuild -version
Xcode 14.2
Build version 14C18
$ /usr/bin/clang --version
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: arm64-apple-darwin22.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
# brew install codeql
$ codeql --version
CodeQL command-line toolchain release 2.11.6.
Copyright (C) 2019-2022 GitHub, Inc.
Unpacked in: /opt/homebrew/Caskroom/codeql/2.11.6/codeql
Analysis results depend critically on separately distributed query and
extractor modules. To list modules that are visible to the toolchain,
use 'codeql resolve qlpacks' and 'codeql resolve languages'.
So this seems similar to the problem described in the other issue I linked to.
In ql.py
instead of
BUILD_CMD = f'make install SDKROOT=macosx ARCH_CONFIGS=ARM64 KERNEL_CONFIGS=RELEASE MACHINE_CONFIGS=VMAPPLE BUILD_WERROR=0 BUILD_LTO=0 SRCROOT={SRCROOT} OBJROOT={OBJROOT} SYMROOT={SYMROOT} DSTROOT={DSTROOT} FAKEROOT={FAKEROOT_DIR} KDKROOT={KDKROOT}'
could you try:
BUILD_CMD = f'python3 x.py'
and see if that resolves the problem?
could you try:
BUILD_CMD = f'python3 x.py'
and see if that resolves the problem?
Yes, it did work!
Yes, it did work!
That's great to hear. We'll track this internally, but given that there's a workaround there doesn't seem to be immediate urgency to fix this.
File not indexed while create xnu database
Hi, I am trying to create a CodeQL database for the latest macOS XNU kernel using this script. However I found that only a few files are indexed in the
src.zip
. For examplereturns nothing though this file did get compiled.
I have searched
log/build-tracer.log
and here are some info that might help.I have checked the following things:
installfile.o
andinstallfile.c
exists in the absolute path--source-root
I am puzzled by the first argument after
--
, context:I am not sure whether that caused the problem.