Skip to content

Add kernelCTF CVE-2026-43074_lts#380

Open
2045castor wants to merge 8 commits into
google:masterfrom
2045castor:submit_final
Open

Add kernelCTF CVE-2026-43074_lts#380
2045castor wants to merge 8 commits into
google:masterfrom
2045castor:submit_final

Conversation

@2045castor
Copy link
Copy Markdown

No description provided.


void ExploitLayout::load_from_xdk(const char* distro, const char* release) {
TargetDb kxdb("target_db.kxdb", target_db);
auto target = kxdb.GetTarget(distro, release);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check kernelXDK documentation and samples. Please use kxdb.AutoDetectTarget() here.

Copy link
Copy Markdown

@r33s3n6 r33s3n6 May 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in e44145e: now uses kxdb.AutoDetectTarget() instead of manual distro/release selection.

" --shell shell mode\n"
" --image-offset HEX override image offset\n"
" --nperm-addr HEX override layout nperm address (default: 0x%lx)\n"
" --xdk-distro NAME Kernel XDK target distro (default: %s)\n"
Copy link
Copy Markdown
Collaborator

@artmetla artmetla May 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing the target distro and release as command-line arguments defeats the framework's built-in fingerprinting capabilities. We don't want manual overrides here. Please review the examples in libxdk/samples and refactor this to rely entirely on the framework's auto-detection.

Copy link
Copy Markdown

@r33s3n6 r33s3n6 May 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in e44145e: the manual XDK target CLI options were removed.

TargetDb kxdb("target_db.kxdb", target_db);
auto target = kxdb.GetTarget(distro, release);

panic_on_oops = target.GetSymbolOffset("panic_on_oops") + kernel_text_base;
Copy link
Copy Markdown
Collaborator

@artmetla artmetla May 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The panic_on_oops symbol isn't included in the default kernelXDK database. If your exploit relies on this offset, you will need to extend the extraction logic to include it. Please check the documentation on xdk.dev for how to add custom symbols to the DB generation before querying them here.

Please apply to the other symbols too

Copy link
Copy Markdown

@r33s3n6 r33s3n6 May 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in e44145e.

Added docs/xdk-db.md describing the DB generation flow and included the DB updates in this commit. The loading path was also refactored to remove the fallback behavior — required layout information is now expected to come from kernelXDK, and missing offsets cause an explicit failure.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please have a look at https://xdk.dev/libxdk/how_to_get_started.html#initialize-the-target-database. Effectively you should add symbols for specific target that you run against. But the logic is that later kernelXDK team would add your symbols to default DB as smth available on all targets for all exploits.

If you follow the guidelines, you could skip adding extra docs to docs/xdk-db.md

state.options.offsets.image_offset, state.options.runtime.nokaslr ? 1 : 0,
state.options.layout.nperm_addr, state.options.spray.size_kb,
state.options.spray.slow_nperm, state.options.runtime.use_unmovable_nperm ? 1 : 0,
state.options.layout.loaded_from_xdk ? 1 : 0);
Copy link
Copy Markdown
Collaborator

@artmetla artmetla May 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to be a compliance workaround. Toggling a flag just to print a debug statement does not meet the requirement for using the kernelXDK framework.

Copy link
Copy Markdown

@r33s3n6 r33s3n6 May 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. I initially misunderstood how the kernelXDK DB generation worked and assumed all required symbols would be present by default.

Fixed in e44145e: I added DB generation documentation (docs/xdk-db.md), updated the DB, removed the fallback path, and now require all layout information to come directly from kernelXDK.

Copy link
Copy Markdown
Collaborator

@artmetla artmetla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check the comments and improve kernelXDK usage.

@r33s3n6
Copy link
Copy Markdown

r33s3n6 commented May 17, 2026

Hi @artmetla, thanks for the review. We've addressed the requested XDK changes in e44145e.

Also noticed CI failing during environment setup before reaching the exploit changes. The failure appears to happen while preparing rootfs_v3.img (virt-copy-out exits with code 8), so this may be infrastructure-related rather than caused by this change.

@artmetla artmetla added the recheck Triggers kernelCTF PR verification again label May 17, 2026
@artmetla
Copy link
Copy Markdown
Collaborator

Hey @r33s3n6. Thanks for ping, fixed the vuln-verify. Please check my comment on how symbols should be added for specific targets.

@r33s3n6
Copy link
Copy Markdown

r33s3n6 commented May 17, 2026

Hey @r33s3n6. Thanks for ping, fixed the vuln-verify. Please check my comment on how symbols should be added for specific targets.

Thanks @artmetla, that clears it up. We had been reading https://xdk.dev/about/kxdb_database.html#configuration-file and initially thought extending config.py to avoid hardcoding offsets in the exploit was the intended approach. We understand the workflow now and updated the implementation accordingly.

@2045castor 2045castor requested a review from artmetla May 17, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

recheck Triggers kernelCTF PR verification again

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants