Repository navigation
codeql: prove the patched files were read, trace the kernel and QEMU, analyse our Go and workflows (#653) - #659
Merged
Merged
Conversation
… kernel's and QEMU's; analyse our Go and workflows (#653) CodeQL's own diagnostics in the SARIF say which files it extracted and, without a build, which compilations failed. Run 45214602230 shows every touched kernel compilation and three of QEMU's failed in build-mode none while each analysis reported 0 results: arch/x86/kernel/early-quirks.c, unwind_orc.c, arch/x86/pci/common.c, kernel/bpf/btf.c, hw/i386/x86-common.c, target/i386/cpu.c and target/i386/kvm/kvm.c were never analysed. patched scope now fails naming each touched C file the SARIF does not report extracted, or reports a failed compilation of. The kernel and QEMU are compiled under the tracer (patched compile: the kernel from its configuration, QEMU for x86_64-softmmu, only the touched objects). The repository's Go and workflows get their own jobs, security-extended. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t failed Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dium severity patched scope now sends code scanning only the results on lines the patches added or changed, the ones that fail the job. Upstream's results in the touched files are kept as the job's artifact (upstream.txt): alert #1, system/vl.c's -dump-vmstate fopen, which qemu 0001 does not change, was noise and would block a merge once a ruleset requires CodeQL. patched severe fails the Go analysis on a result of medium security severity or above that no codeql[<rule>] comment suppresses. The first run gave one: go/insecure-hostkeycallback in internal/lab/login.go, a vsock login to the host's own fresh guest, suppressed in the source with its reason. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CodeQL's C front end cannot parse __seg_gs. Every touched kernel file that reached a per-CPU accessor failed to extract (ten of fourteen, run 45216274329), which the new check named. The analysis tree turns USE_X86_SEG_SUPPORT off, the path a compiler without named address spaces builds, and refuses a Kconfig that turns it on some other way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… access USE_X86_SEG_SUPPORT off left percpu_types.h's __percpu_seg_override on __seg_gs whenever the compiler has named address spaces, and the same ten files failed to extract (run 45218725523). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es and verbs attestgate refused the SARIF and upstream-results uploads as unattested publications: they are for a person to read. The traced compiles and the severe and compile verbs get tests that run them against fake tools, which holds coverage over its floor and refuses every mutation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aledbf
force-pushed
the
codeql-extraction-653
branch
from
November 23, 2026 17:04
50a12c2 to
2718b87
Compare
aledbf
marked this pull request as ready for review
November 23, 2026 17:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The goal is a cold first login under 100 ms with every carried patch safe to ship. #657 analyses the files the C patches touch, and every part reported 0 results. Nothing showed those files had been read. CodeQL's own diagnostics in the SARIF say they mostly had not. In build-mode none, every compilation of a touched kernel file failed, and so did three of QEMU's (throwaway run 45214602230).
arch/x86/kernel/early-quirks.c,unwind_orc.c,arch/x86/pci/common.c,kernel/bpf/btf.c,hw/i386/x86-common.c,target/i386/cpu.candtarget/i386/kvm/kvm.cwere never analysed. Our own Go and workflows were not analysed at all (#653).What
patched scopefails on a file not read. It readscpp/diagnostics/successfully-extracted-filesand, without a build, the failed compilations incpp/bmn/extraction-information. It exits 2 naming each touched C file that is missing or failed. It bit in CI: run 45216274329 named 10 kernel files, and run 45218725523 named the same 10 after a first fix that was not enough.patched compile. It builds only the touched objects: the kernel fromkernel/config-*-x86_64afterprepare, QEMU for x86_64-softmmu. Their trees keep every file. qboot, systemd and OpenSSH stay buildless, since every touched file of theirs was extracted.CC_HAS_NAMED_AS. CodeQL's front end cannot parse__seg_gs, so every file that reached a per-CPU accessor failed to extract. The analysis tree turns the symbol off, which takes the upstream path for compilers without named address spaces. The build refuses a Kconfig that turns it on another way, and a.configthat kept it.upstream-results-<part>artifact. Alert One layout, one name for the image, and a fingerprint that cannot be shifted #1 (system/vl.c's-dump-vmstatefopen, which qemu 0001 does not change) was this kind of noise, and it would block a merge once a ruleset requires CodeQL.own (go)(autobuild) andown (actions), both security-extended, on every PR, on main and on the weekly schedule. A new verb,patched severe, fails the Go job on any result of medium security severity (4.0) or above unless acodeql[<rule>]comment suppresses it. The suppression query is added to the run so that the SARIF marks those results. Why medium: the first Go run gave one result at medium or above, so the threshold costs nothing today, and every new one gets fixed or explained in the source. That one result wasgo/insecure-hostkeycallbackininternal/lab/login.go(high). It is suppressed with its reason: vsock reaches only this host's own guest, whose keys its boot made. Lower severities go to code scanning only.spin-machine-dev changed(patches, their pins, the kernel config, this workflow,internal/patched), because the workflow itself now runs on every PR.Results
Run 45220409814 is green. Every touched C file in all five parts was extracted, and no result lands on a line the patches added. Upstream's results kept as artifacts: kernel 6 (
cpp/suspicious-pointer-scaling-voidin unwind_orc.c and btf.c), qemu 2 (alert #1's fopen, and a pointer-scaling result in kvm.c).Open
Code scanning's own
CodeQLcheck is red because of alert #5, the suppressedgo/insecure-hostkeycallback. Code scanning opens an alert for a result even when the SARIF marks it suppressed in source. It needs a person to dismiss it as won't fix, for the reason in the source comment. Every later in-source suppression needs the same dismissal. The workflow jobs are all green, includingpatched severe.CI time
Measured in run 45220409814.
own (go)takes 1.6 min andown (actions)0.7 min, in parallel, on every PR. When a patched tree can change, the kernel analysis takes 5.7 min and QEMU's 4.7 min, against about 2.5 and 2 buildless in #657. The others are unchanged at about 2 min, andchangedadds about 1 min before them.Refs #653.
🤖 Generated with Claude Code