linux-version sort: argv and stdin behaviors differ
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux-base (Debian) |
Fix Released
|
Unknown
|
|||
linux-base (Ubuntu) |
Fix Released
|
Undecided
|
dann frazier | ||
Bionic |
Fix Released
|
Undecided
|
dann frazier | ||
Focal |
Fix Released
|
Undecided
|
dann frazier | ||
Groovy |
Won't Fix
|
Undecided
|
dann frazier | ||
Hirsute |
Fix Released
|
Undecided
|
dann frazier | ||
Impish |
Fix Released
|
Undecided
|
dann frazier |
Bug Description
[Impact]
`linux-version sort` provides 2 ways to sort kernel version strings: users can provide these strings either via the command line or via stdin. Currently these methods give different answers for certain version strings (see Test Case). The stdin behavior is decidedly incorrect, and this is the mode flash-kernel uses. As a real world example, a user with an arm64 u-boot system might end up booting 5.8.0-50-generic instead of the expected 5.8.0-50-
It's possible this internal discrepancy can cause other issues due to tools disagreeing about which kernel is the latest, but the flash-kernel example is the only one I'm aware of at this point.
[Test Case]
Using argv:
$ linux-version sort 5.8.0-50-generic 5.8.0-50-
5.8.0-50-generic
5.8.0-50-
Using stdin (incorrect):
$ cat versions.txt
5.8.0-50-generic
5.8.0-50-
$ cat versions.txt | linux-version sort
5.8.0-50-
5.8.0-50-generic
[Where Problems Could Occur]
An obvious place where problems could occur is if someone is relying on rebooting into the kernel that is incorrectly being sorted greatest. For those using only Ubuntu kernel packages, the only case I'm aware of is arm64 generic vs. generic-64k case used in the examples above. The generic-64k flavor is available in >= 20.10, as well as 20.04-hwe. ARM server users - those most likely to want the generic-64k flavor - are very unlikely to be using flash-kernel. The standard for ARM servers is UEFI firmware, which use GRUB and are unaffected by this change. We found this on an HP m400 platform which is the only Ubuntu certified u-boot-based arm64 server.
Changed in linux-base (Debian): | |
status: | Unknown → New |
Changed in linux-base (Ubuntu): | |
status: | New → In Progress |
assignee: | nobody → dann frazier (dannf) |
Changed in linux-base (Ubuntu Hirsute): | |
assignee: | nobody → dann frazier (dannf) |
Changed in linux-base (Ubuntu Focal): | |
assignee: | nobody → dann frazier (dannf) |
Changed in linux-base (Ubuntu Groovy): | |
assignee: | nobody → dann frazier (dannf) |
Changed in linux-base (Ubuntu Bionic): | |
assignee: | nobody → dann frazier (dannf) |
Changed in linux-base (Ubuntu Hirsute): | |
status: | New → In Progress |
Changed in linux-base (Ubuntu Groovy): | |
status: | New → In Progress |
Changed in linux-base (Ubuntu Focal): | |
status: | New → In Progress |
Changed in linux-base (Ubuntu Bionic): | |
status: | New → In Progress |
description: | updated |
description: | updated |
tags: | added: verification-done verification-done-bionic verification-done-focal verification-done-hirsute |
Changed in linux-base (Ubuntu Groovy): | |
status: | Fix Committed → Won't Fix |
Changed in linux-base (Debian): | |
status: | New → Fix Released |
This bug was fixed in the package linux-base - 4.5ubuntu6
---------------
linux-base (4.5ubuntu6) impish; urgency=medium
* linux-version: Fix sorting of versions provided via stdin to match
the output when provided via argv (LP: #1926985).
-- dann frazier <email address hidden> Mon, 03 May 2021 10:16:43 -0600