Skip to content

fix(install): warn for known affected ublk kernels - #93

Open
catyans wants to merge 1 commit into
kvcache-ai:mainfrom
catyans:fix/ublk-kernel-regression-guard
Open

fix(install): warn for known affected ublk kernels#93
catyans wants to merge 1 commit into
kvcache-ai:mainfrom
catyans:fix/ublk-kernel-regression-guard

Conversation

@catyans

@catyans catyans commented Jul 31, 2026

Copy link
Copy Markdown

Summary

  • warn from scripts/install.sh when the running kernel is a known affected ublk release
  • emit the same warning before Docker host setup loads and persists ublk_drv
  • keep installation non-blocking while explaining the hang/panic risk and fixed-kernel guidance

Scope

This revision follows the maintainer guidance on #20 and replaces the earlier
runtime guard with an installation-only warning. The PR now changes only:

  • scripts/install.sh
  • scripts/docker-setup.sh

The delimiter-aware shell patterns cover the known upstream 6.18.4 / 6.18.5
families and Ubuntu Azure 6.17.0-1015 / 6.17.0-1018, including - and +
local-version suffixes without overmatching releases such as 6.18.40.

Validation

  • git diff --check
  • GitHub AENV CI, including installer verification

Fixes #20

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

🔍 OpenCodeReview found 1 issue(s) in this PR.

  • ✅ Successfully posted inline: 1 comment(s)

Comment thread src/setup/ublk.rs Outdated
Comment thread src/setup/ublk.rs Outdated
@catyans

catyans commented Jul 31, 2026

Copy link
Copy Markdown
Author

Addressed the latest suffix-matching review and completed an independent Linux validation on head e65b73f:

  • cargo fmt --all -- --check
  • cargo test -p agentenv setup::ublk::tests -- --nocapture ✅ (3 passed, 0 failed)

The targeted cases include Azure kernel releases with -custom / +debug suffixes as affected, while near-prefix strings without a valid delimiter remain unaffected.

@catyans

catyans commented Aug 3, 2026

Copy link
Copy Markdown
Author

@yingdi-shan This is ready for maintainer review when convenient. The current head is mergeable; AENV CI, unit tests, clippy, both E2E jobs, agentenv tests, and OpenCodeReview are all green, and both review threads are resolved.

@yingdi-shan

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! I left a comment on issue #20. I suggest updating only the installation script instead of modifying the entire script, as this keeps the change more focused.

@catyans
catyans force-pushed the fix/ublk-kernel-regression-guard branch from e65b73f to 6d1ae9e Compare August 5, 2026 03:43
@catyans

catyans commented Aug 5, 2026

Copy link
Copy Markdown
Author

Thanks, I narrowed the PR to that scope in 6d1ae9e. The previous Rust runtime guard, override, and documentation changes have been removed; the diff now only adds a non-blocking warning to scripts/install.sh and scripts/docker-setup.sh. The warning covers the known upstream and Azure affected release families, including delimiter-valid local-version suffixes. A refreshed CI run is starting against current main.

@catyans catyans changed the title fix(setup): guard known affected ublk kernels fix(install): warn for known affected ublk kernels Aug 5, 2026
Comment thread scripts/install.sh
Comment on lines +73 to +79
cat >&2 <<EOF
warning: Linux kernel ${KERNEL_RELEASE} is known to contain a ublk initialization regression.
Creating the first ublk device may hang or panic the host.
Upgrade to a fixed vendor kernel (upstream 6.18.6+ for 6.18.y) before running AgentENV.
See: https://github.com/kvcache-ai/AgentENV/issues/20
EOF
;;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[bug · high]
The matched-kernel path only emits a warning and then continues. With the default SKIP_SETUP=0, this script subsequently invokes server --setup-host, which provisions ublk and may trigger the exact host hang/panic described here. Abort before setup on affected kernels (optionally allowing an explicit unsafe override), rather than proceeding automatically.

Suggestion:

Suggested change
cat >&2 <<EOF
warning: Linux kernel ${KERNEL_RELEASE} is known to contain a ublk initialization regression.
Creating the first ublk device may hang or panic the host.
Upgrade to a fixed vendor kernel (upstream 6.18.6+ for 6.18.y) before running AgentENV.
See: https://github.com/kvcache-ai/AgentENV/issues/20
EOF
;;
cat >&2 <<EOF
error: Linux kernel ${KERNEL_RELEASE} is known to contain a ublk initialization regression.
Creating the first ublk device may hang or panic the host.
Upgrade to a fixed vendor kernel (upstream 6.18.6+ for 6.18.y) before running AgentENV.
See: https://github.com/kvcache-ai/AgentENV/issues/20
EOF
exit 1
;;

Comment thread scripts/install.sh
case "$KERNEL_RELEASE" in
6.18.4|6.18.4[-+]*|6.18.5|6.18.5[-+]*|\
6.17.0-1015-azure|6.17.0-1015-azure[-+]*|\
6.17.0-1018-azure|6.17.0-1018-azure[-+]*)

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.

We can add 6.17.0-1020-azure. Other kernels like 6.17.0-1018-aws also contain the vulnerability.

Comment thread scripts/docker-setup.sh
case "$KERNEL_RELEASE" in
6.18.4|6.18.4[-+]*|6.18.5|6.18.5[-+]*|\
6.17.0-1015-azure|6.17.0-1015-azure[-+]*|\
6.17.0-1018-azure|6.17.0-1018-azure[-+]*)

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.

This code is duplicated with install.sh. Maybe we can add a file with affeted kernel version and read kernel versions from that file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AgentENV fails on kernels affected by the ublk ADD_DEV initialization regression

2 participants