GeezerVison is showing github.com — fix: address reports #62–#72 (build, version, log, update hardening) by tmiland-labs · Pull Request #73 · tmiland/kernel-installer
Conversation
tmiland-labs
commented
Nov 10, 2026
•
edited by tmiland
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
Fixes the 11 reports from @davmonk (#62–#72) on a branch from main @ 8cbf9f2.
Security / input hardening
- Kernel version is only checked at its start, then run through eval #63 Kernel versions are validated against a full whitelist (
^[0-9]+\.[0-9]+[0-9A-Za-z.+~_-]*$) in chk_version and -k, before any run_ok eval. Still accepts 7.0.0-38-generic, 6.17.1-300.fc44.x86_64, -rc, -test, + and ~ versions.
- --dir in a shared folder: the build folder's owner is never checked, and an existing tarball skips verification #62
prepare_install_dir creates the build dir with mkdir (no -p), refuses symlinks, non-caller-owned dirs, and group/other-writable non-sticky parents, then verifies the new dir's owner/mode. get_verified_tarball no longer treats an existing tarball as verified.
- Checksum line is read from all of sha256sums.asc, including text outside the signed part #67 Checksum lines are read from
gpgv --output (signed content only), never from text appended after the clearsigned block.
- Tarball signing keys come from root's own keyring and are matched by substring #68
GNUPGHOME defaults to a throwaway keyring; keys are selected by exact <address> and exported by primary fingerprint, so a UID that merely contains [email protected]/[email protected] is not trusted.
- Log in /var/log is written and renamed without checking for symlinks (/var/log is group-writable on Ubuntu) #64 Default log is
/var/log/kernel-installer/kernel_installer.log in a 0700 root-owned dir. A custom LOGFILE and .1 are refused if they are symlinks, not regular files owned by root, or in a group/other-writable directory.
- slib writes unitest.txt (and stopspinning) into the current folder as root #65
shell_has_unicode no longer writes unitest.txt; run_ok keeps its spinner stop file in a private mktemp -d directory and cleans it up.
Robustness
Update path
Testing
- 22/22
tests/test_*.sh pass (9 new test files; test_logging.sh updated for the new spinner behavior).
shellcheck kernel_installer.sh src/slib.sh scripts/update-slib.sh → exit 0.
bash -n clean.
- Diff: 14 files, +1074/−89.
After merge (not in this PR)
- slib pin phase 2:
src/slib.sh changed but SLIB_REV/SLIB_SHA256 were deliberately left untouched. Run scripts/update-slib.sh --finalize <merge commit>; piped runs keep the old pinned slib until then.
- Backfill release assets: dispatch
.github/workflows/release.yml with tag v1.3.0 after this is on main.
- Log in /var/log is written and renamed without checking for symlinks (/var/log is group-writable on Ubuntu) #64 residual:
/var/log itself is group-writable on Ubuntu, so a syslog-group process can still rename the 0700 subdirectory; file symlink/ownership checks are in place. Moving the default to /var/lib/kernel-installer would remove that caveat.
--dir behaviour: caller-owned group-writable parents (e.g. umask 002) are refused unless sticky; the error asks for chmod g-w. This can be relaxed to reject only parents owned by another user if preferred.
- Watch the test-install matrix on Debian 12 / Ubuntu 22.04 for
gpgv --output support.
Fixes #62
Fixes #63
Fixes #64
Fixes #65
Fixes #66
Fixes #67
Fixes #68
Fixes #69
Fixes #70
Fixes #71
Fixes #72
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
, tmiland#62, tmiland#69)
Version strings are checked against a full whitelist before they reach run_ok eval, the build directory is recreated with mkdir (no -p) and checked for symlinks/ownership shared parents, and cleanup deletes the marker last so an interrupted delete is retryable. An existing tarball is no longer trusted without verification.
A second run used to delete the first run's build folder and rotate its log. The lock is taken before rotate_log and in the uninstall path; a lock failure prints a message and exits without running fatal() (which would remove the active build tree).
…d#71)
A failure in the second apt call used to leave headers installed for a kernel whose image never landed. Both package globs now go to a single apt-get invocation, matching the existing single dnf transaction on Fedora/RHEL.
…miland#64)
The default is now /var/log/kernel-installer/kernel_installer.log in a 0700 root-owned directory. A custom LOGFILE is refused if it is a symlink, not a regular file owned by the caller, or in a group/other-writable directory, and .1 is checked before rotation.
tmiland#67)
Text appended after the signature block still yields a good gpgv signature. The checksum line is now taken from gpgv --output, which contains only the signed content; the status lines are counted from a separate file.
…int (tmiland#68)
The default GNUPGHOME is now a throwaway keyring instead of root's ~/.gnupg. Keys are listed with an exact <address> match and exported by primary fingerprint, so a key whose UID merely contains [email protected] or [email protected] is not trusted.
…ly (tmiland#66, tmiland#72)
The .sh release asset is selected explicitly, a SHA256SUMS asset is required and verified before replacement, and the download is created next to the script so mv is a rename. Piped runs (no script file) are refused. A release workflow attaches kernel_installer.sh and SHA256SUMS to published releases; dispatch it with v1.3.0 to backfill the existing release.
… cwd (tmiland#65)
shell_has_unicode no longer writes unitest.txt, and run_ok creates the spinner stop file in a private mktemp -d directory that it removes afterwards. The vendored slib changes need the usual phase-2 pin bump after this branch lands.
…regression)
The throwaway GNUPGHOME default exposed that the --export building USEKEYRING did not pass --homedir, so it read root's ~/.gnupg (empty in CI) and every distro job failed with "Could not find the expected kernel.org signing keys". Pass --homedir, point the test fakes at gpg2/gpgv2 (CI has real ones), and update the test-install log tail/artifact paths to the new default.
…miland#68 regression)
Fedora gpg enables use-keyboxd, which makes --keyring on a file ignored for --list-keys, so the exact-address lookup failed there. List keys from a private homedir instead, import a custom USEKEYRING into one, and export the final gpgv keyrings from the same homedir. Retry the WKD locate a few times for dirmngr startup flakes, install ca-certificates for WKD, and update the README dependency list.
…kout runs
Ubuntu 24.04 CI repeatedly failed to start dirmngr / complete WKD (TLS general error), and Fedora gpg use-keyboxd ignores keyring files. Checkout runs now import the public keys from src/keys/kernel.org.asc into a private homedir and require the pinned Torvalds/GregKH/autosigner fingerprints; piped runs keep the WKD fallback with retries. A custom USEKEYRING is imported into a homedir and checked against the same fingerprints. Tests cover the bundle, pin check, exact selection, and private-key absence.
…ath regression)
The Ubuntu 24.04 job is the only one using --dir ki-build, which put the verification TMPDIR (and therefore the gpg homedir) at 124 characters. gpg-agent sockets have a ~108-character path limit, so importing the bundled keys failed there. Create a private mktemp -d under ${GPG_TMPDIR:-/tmp}, use it for the bundled/custom/WKD homedirs, and remove it on success or verify_fail.
Uh oh!
There was an error while loading. Please reload this page.
tmiland
pushed a commit
that referenced
this pull request
Nov 10, 2026
Phase 2 after #73. The pinned raw URL was verified to serve sha256 694784527d354eb264df24e399a693124fe0df6cb5037a7af218677772cf47c5.
[skip ci]
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
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.
|