'ua fix' tells me to reboot with inaccurate message
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-advantage-tools (Ubuntu) |
Fix Released
|
Medium
|
Grant Orndorff | ||
Xenial |
Fix Released
|
Medium
|
Unassigned | ||
Bionic |
Fix Committed
|
Medium
|
Unassigned | ||
Focal |
Fix Committed
|
Medium
|
Unassigned | ||
Groovy |
Won't Fix
|
Medium
|
Unassigned | ||
Hirsute |
Won't Fix
|
Medium
|
Unassigned | ||
Impish |
Fix Released
|
Medium
|
Grant Orndorff |
Bug Description
[Impact]
When using an affected version of uaclient (any beta of v27) and using the `fix` command, the user could be shown a misleading message. Specifically, if the users machine has the system reboot required flag set, and then they use the `ua fix` command, uaclient will say that a reboot is required to complete the fix, even though uaclient didn't even have to install anything.
[Test case]
The following example will work on xenial, bionic, focal, and groovy.
To reproduce on hirsute, use USN-4913-2 instead of USN-4898-1, and use node-underscore instead of curl in the instructions below.
To reproduce:
1. Launch a container: using focal here as an example
lxc launch ubuntu-daily:focal dev-f
2. Add the uaclient staging ppa: https:/
add-
apt-get update
3. Install version 27 beta 3
apt install ubuntu-
4. Make sure you have the latest version of curl installed
apt install curl
5. Touch the reboot-required file
sudo touch /var/run/
6. Attempt to fix https:/
ua fix USN-4898-1
7. See a message like this
USN-4898-1: curl vulnerabilities
Found CVEs:
https:/
https:/
1 affected package is installed: curl
(1/1) curl:
A fix is available in Ubuntu standard updates.
The update is already installed.
A reboot is required to complete fix operation.
✘ USN-4898-1 is not resolved.
To see the fixed version:
1. Launch a container: using focal here as an example
lxc launch ubuntu-daily:focal dev-f
2. Add this ppa that contains the unreleased fix for this bug: https:/
add-
apt-get update
3. Install version 27
apt install ubuntu-
4. Make sure you have the latest version of curl installed
apt install curl
5. Touch the reboot-required file
sudo touch /var/run/
6. Attempt to fix https:/
ua fix USN-4898-1
7. See a message like this
USN-4898-1: curl vulnerabilities
Found CVEs:
https:/
https:/
1 affected package is installed: curl
(1/1) curl:
A fix is available in Ubuntu standard updates.
The update is already installed.
✔ USN-4898-1 is resolved.
[Where problems could occur]
The logic of when to show the reboot required message is still based on the system /var/run/
If this new logic isn't quite right, it may result in uaclient still saying that a reboot is required to complete a fix even when it isn't (for some other situation not in this bug).
Or from the opposite direction: if the logic is wrong, it could result in uaclient failing to tell the user that a reboot is required to complete a fix, even when it is.
More generally, the changeset is large and carries the risk of other unexpected issues. Any unexpected issues would be limited to uaclient behavior though.
[Discussion]
This bug doesn't actually exist outside of the v27 betas in the ua-client/staging ppa. The number of users affected by this bug is very low and almost entirely limited to those who were deliberately testing the v27 betas. Because of this, the risk associated with fixing this bug is predicted to be very low.
[Original Report]
root@malefic:~# ua fix CVE-2021-3410
CVE-2021-3410: libcaca vulnerability
https:/
1 affected package is installed: libcaca
(1/1) libcaca:
A fix is available in Ubuntu standard updates.
The update is already installed.
A reboot is required to complete fix operation.
✘ CVE-2021-3410 is not resolved.
root@malefic:~#
The line 'A reboot is required to complete fix operation.' may be partially true (i.e. a reboot is needed) for other reasons, but is not accurate in the context of this CVE. Both 'checkrestart' and 'needrestart' confirm that no running process is using the caca library. Looking at the code, it looks like it's looking at a global 'needs reboot' flag, unrelated to the specific fix operation. I'd argue that a) it shouldn't say 'to complete fix operation' and b) it shouldn't claim 'CVE-2021-3410 is not resolved'.
Related branches
- Bryce Harrington (community): Approve
-
Diff: 12713 lines (+8514/-712)88 files modified.gitignore (+24/-0)
Jenkinsfile (+28/-35)
README.md (+29/-12)
RELEASES.md (+63/-4)
apt-hook/20apt-esm-hook.conf (+10/-2)
apt-hook/Makefile (+11/-4)
apt-hook/hook.cc (+264/-74)
apt-hook/json-hook-src/go.mod (+3/-0)
apt-hook/json-hook-src/json-hook.go (+253/-0)
apt-hook/json-hook-src/json-hook_test.go (+410/-0)
debian/changelog (+160/-1)
debian/control (+8/-2)
debian/lintian-overrides (+5/-0)
debian/po/templates.pot (+2/-2)
debian/rules (+10/-2)
debian/ubuntu-advantage-tools.config (+14/-0)
debian/ubuntu-advantage-tools.postinst (+150/-40)
debian/ubuntu-advantage-tools.templates (+1/-1)
dev/null (+0/-0)
features/attach_invalidtoken.feature (+1/-1)
features/attach_validtoken.feature (+63/-28)
features/attached_commands.feature (+12/-12)
features/attached_enable.feature (+62/-118)
features/cloud.py (+0/-12)
features/environment.py (+27/-17)
features/gcp-ids.yaml (+3/-3)
features/staging_commands.feature (+50/-5)
features/steps/steps.py (+75/-3)
features/ubuntu_pro.feature (+39/-9)
features/unattached_commands.feature (+388/-3)
features/util.py (+0/-81)
integration-requirements.txt (+1/-1)
lib/reboot_cmds.py (+12/-8)
lib/ua_update_messaging.py (+302/-0)
setup.py (+1/-0)
systemd/ua-messaging.service (+8/-0)
systemd/ua-messaging.timer (+11/-0)
tools/test_xenial_upgrade.sh (+224/-0)
tools/tox-lxd-runner (+2/-2)
tox.ini (+2/-2)
uaclient-devel.conf (+1/-0)
uaclient.conf (+1/-0)
uaclient/apt.py (+1/-0)
uaclient/cli.py (+87/-18)
uaclient/clouds/identity.py (+12/-0)
uaclient/clouds/tests/test_identity.py (+31/-0)
uaclient/config.py (+136/-8)
uaclient/contract.py (+1/-2)
uaclient/defaults.py (+10/-1)
uaclient/entitlements/esm.py (+53/-7)
uaclient/entitlements/fips.py (+9/-3)
uaclient/entitlements/livepatch.py (+3/-3)
uaclient/entitlements/repo.py (+3/-3)
uaclient/entitlements/tests/test_base.py (+2/-2)
uaclient/entitlements/tests/test_cc.py (+1/-1)
uaclient/entitlements/tests/test_esm.py (+145/-34)
uaclient/entitlements/tests/test_fips.py (+38/-1)
uaclient/entitlements/tests/test_livepatch.py (+8/-6)
uaclient/entitlements/tests/test_repo.py (+1/-1)
uaclient/exceptions.py (+12/-0)
uaclient/gpg.py (+1/-1)
uaclient/security.py (+1179/-0)
uaclient/serviceclient.py (+19/-2)
uaclient/status.py (+237/-37)
uaclient/testing/fakes.py (+4/-1)
uaclient/tests/test_apt.py (+5/-1)
uaclient/tests/test_cli.py (+2/-0)
uaclient/tests/test_cli_attach.py (+33/-3)
uaclient/tests/test_cli_auto_attach.py (+28/-0)
uaclient/tests/test_cli_detach.py (+31/-2)
uaclient/tests/test_cli_disable.py (+27/-3)
uaclient/tests/test_cli_enable.py (+31/-7)
uaclient/tests/test_cli_fix.py (+78/-0)
uaclient/tests/test_cli_refresh.py (+20/-1)
uaclient/tests/test_cli_status.py (+81/-7)
uaclient/tests/test_config.py (+162/-31)
uaclient/tests/test_contract.py (+1/-8)
uaclient/tests/test_reboot_cmds.py (+48/-1)
uaclient/tests/test_security.py (+2344/-0)
uaclient/tests/test_serviceclient.py (+24/-0)
uaclient/tests/test_status.py (+49/-1)
uaclient/tests/test_ua_update_messaging.py (+469/-0)
uaclient/tests/test_util.py (+237/-9)
uaclient/tests/test_version.py (+10/-3)
uaclient/util.py (+101/-18)
uaclient/version.py (+2/-2)
update-motd.d/88-esm-announce (+4/-0)
update-motd.d/91-contract-ua-esm-status (+4/-0)
- Bryce Harrington (community): Approve
-
Diff: 12025 lines (+8488/-712)87 files modifiedJenkinsfile (+28/-35)
README.md (+29/-12)
RELEASES.md (+63/-4)
apt-hook/20apt-esm-hook.conf (+10/-2)
apt-hook/Makefile (+11/-4)
apt-hook/hook.cc (+264/-74)
apt-hook/json-hook-src/go.mod (+3/-0)
apt-hook/json-hook-src/json-hook.go (+253/-0)
apt-hook/json-hook-src/json-hook_test.go (+410/-0)
debian/changelog (+158/-1)
debian/control (+8/-2)
debian/lintian-overrides (+5/-0)
debian/po/templates.pot (+2/-2)
debian/rules (+10/-2)
debian/ubuntu-advantage-tools.config (+14/-0)
debian/ubuntu-advantage-tools.postinst (+150/-40)
debian/ubuntu-advantage-tools.templates (+1/-1)
dev/null (+0/-0)
features/attach_invalidtoken.feature (+1/-1)
features/attach_validtoken.feature (+63/-28)
features/attached_commands.feature (+12/-12)
features/attached_enable.feature (+62/-118)
features/cloud.py (+0/-12)
features/environment.py (+27/-17)
features/gcp-ids.yaml (+3/-3)
features/staging_commands.feature (+50/-5)
features/steps/steps.py (+75/-3)
features/ubuntu_pro.feature (+39/-9)
features/unattached_commands.feature (+388/-3)
features/util.py (+0/-81)
integration-requirements.txt (+1/-1)
lib/reboot_cmds.py (+12/-8)
lib/ua_update_messaging.py (+302/-0)
setup.py (+1/-0)
systemd/ua-messaging.service (+8/-0)
systemd/ua-messaging.timer (+11/-0)
tools/test_xenial_upgrade.sh (+224/-0)
tools/tox-lxd-runner (+2/-2)
tox.ini (+2/-2)
uaclient-devel.conf (+1/-0)
uaclient.conf (+1/-0)
uaclient/apt.py (+1/-0)
uaclient/cli.py (+87/-18)
uaclient/clouds/identity.py (+12/-0)
uaclient/clouds/tests/test_identity.py (+31/-0)
uaclient/config.py (+136/-8)
uaclient/contract.py (+1/-2)
uaclient/defaults.py (+10/-1)
uaclient/entitlements/esm.py (+53/-7)
uaclient/entitlements/fips.py (+9/-3)
uaclient/entitlements/livepatch.py (+3/-3)
uaclient/entitlements/repo.py (+3/-3)
uaclient/entitlements/tests/test_base.py (+2/-2)
uaclient/entitlements/tests/test_cc.py (+1/-1)
uaclient/entitlements/tests/test_esm.py (+145/-34)
uaclient/entitlements/tests/test_fips.py (+38/-1)
uaclient/entitlements/tests/test_livepatch.py (+8/-6)
uaclient/entitlements/tests/test_repo.py (+1/-1)
uaclient/exceptions.py (+12/-0)
uaclient/gpg.py (+1/-1)
uaclient/security.py (+1179/-0)
uaclient/serviceclient.py (+19/-2)
uaclient/status.py (+237/-37)
uaclient/testing/fakes.py (+4/-1)
uaclient/tests/test_apt.py (+5/-1)
uaclient/tests/test_cli.py (+2/-0)
uaclient/tests/test_cli_attach.py (+33/-3)
uaclient/tests/test_cli_auto_attach.py (+28/-0)
uaclient/tests/test_cli_detach.py (+31/-2)
uaclient/tests/test_cli_disable.py (+27/-3)
uaclient/tests/test_cli_enable.py (+31/-7)
uaclient/tests/test_cli_fix.py (+78/-0)
uaclient/tests/test_cli_refresh.py (+20/-1)
uaclient/tests/test_cli_status.py (+81/-7)
uaclient/tests/test_config.py (+162/-31)
uaclient/tests/test_contract.py (+1/-8)
uaclient/tests/test_reboot_cmds.py (+48/-1)
uaclient/tests/test_security.py (+2344/-0)
uaclient/tests/test_serviceclient.py (+24/-0)
uaclient/tests/test_status.py (+49/-1)
uaclient/tests/test_ua_update_messaging.py (+469/-0)
uaclient/tests/test_util.py (+237/-9)
uaclient/tests/test_version.py (+10/-3)
uaclient/util.py (+101/-18)
uaclient/version.py (+2/-2)
update-motd.d/88-esm-announce (+4/-0)
update-motd.d/91-contract-ua-esm-status (+4/-0)
CVE References
Changed in ubuntu-advantage-tools (Ubuntu): | |
status: | New → In Progress |
assignee: | nobody → Grant Orndorff (orndorffgrant) |
importance: | Undecided → Medium |
Changed in ubuntu-advantage-tools (Ubuntu): | |
status: | In Progress → Fix Committed |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
Changed in ubuntu-advantage-tools (Ubuntu Hirsute): | |
importance: | Undecided → Medium |
Changed in ubuntu-advantage-tools (Ubuntu Groovy): | |
importance: | Undecided → Medium |
Changed in ubuntu-advantage-tools (Ubuntu Focal): | |
importance: | Undecided → Medium |
Changed in ubuntu-advantage-tools (Ubuntu Bionic): | |
importance: | Undecided → Medium |
Changed in ubuntu-advantage-tools (Ubuntu Xenial): | |
importance: | Undecided → Medium |
Changed in ubuntu-advantage-tools (Ubuntu Groovy): | |
importance: | Medium → Undecided |
Changed in ubuntu-advantage-tools (Ubuntu Impish): | |
status: | Fix Committed → In Progress |
description: | updated |
Changed in ubuntu-advantage-tools (Ubuntu Impish): | |
status: | In Progress → Fix Committed |
tags: |
added: verification-done-xenial removed: verification-needed-xenial |
Changed in ubuntu-advantage-tools (Ubuntu Groovy): | |
importance: | Undecided → Medium |
ubuntu- advantage- tools 27.0~20.10.1~beta3 on 20.10/amd64.