Please disable suspend when the package is installed

Bug #1898087 reported by Balint Reczey
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ec2-hibinit-agent (Ubuntu)
Fix Released
Undecided
ubuntu18
Xenial
Won't Fix
Undecided
Unassigned
Bionic
Won't Fix
Undecided
Unassigned
Focal
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

Enabling CONFIG_SUSPEND in the kernel exposes a potential deadlock on Xen instance types on AWS during hibernation, so it has been disabled in the linux-aws kernel as an extra safety measure to prevent this problem from happening.

[Test Case]

Try to suspend the system as a regular user:
$ /lib/systemd/systemd-sleep suspend
Sleep mode "suspend" is disabled by configuration, refusing.

On a system where this change is not present permission error appears:
$ /lib/systemd/systemd-sleep suspend
Failed to open /sys/power/state: Permission denied

[Regression Potential]

The fix is placing a configuration file drop-in to prevent the system from suspending. On EC2 instances this is unlikely to cause unwanted side effects, since suspended instances can't be woken up.
Outside of EC2 there is no use of the package itself, but this change disable suspend when the package is installed.

[Original Bug Text]

From LP: #1892728
We also need to set "AllowSuspend=no" in /etc/systemd/sleep.conf (or a .d file) as CONFIG_SUSPEND has been disabled in the kernel to improve the robustness of hibernation.

Balint Reczey (rbalint)
Changed in ec2-hibinit-agent (Ubuntu):
status: New → Confirmed
Balint Reczey (rbalint)
description: updated
description: updated
description: updated
Revision history for this message
Balint Reczey (rbalint) wrote :

Should this be back-ported to Bionic and Xenial, too?

Changed in ec2-hibinit-agent (Ubuntu Xenial):
status: New → Incomplete
Changed in ec2-hibinit-agent (Ubuntu Bionic):
status: New → Incomplete
Changed in ec2-hibinit-agent (Ubuntu Focal):
status: New → In Progress
Changed in ec2-hibinit-agent (Ubuntu):
status: Confirmed → In Progress
Changed in ec2-hibinit-agent (Ubuntu Focal):
status: In Progress → Confirmed
Balint Reczey (rbalint)
description: updated
Revision history for this message
Balint Reczey (rbalint) wrote :

@fginther Could you please fill the [Impact] part? I do understand how having sleep enabled is not desired, but I don't have much information about the robustness problem.

Suspend seems to be disabled on AWS kernels, but not on OEM ones which can also be installed on EC2 instances.

Balint Reczey (rbalint)
Changed in ec2-hibinit-agent (Ubuntu):
status: In Progress → Incomplete
Changed in ec2-hibinit-agent (Ubuntu Focal):
status: Confirmed → Incomplete
Revision history for this message
Andrea Righi (arighi) wrote :

@rbalint about the robustness problem: enabling CONFIG_SUSPEND exposes a potential deadlock on Xen instance types on AWS during hibernation, so it has been disabled in the AWS kernel as an extra safety measure to prevent this problem from happening.

Setting "AllowSuspend=no" would be a reasonable solution that would allow to use the hibernation feature also with kernels that have CONFIG_SUSPEND enabled.

description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ec2-hibinit-agent - 1.0.0-0ubuntu11

---------------
ec2-hibinit-agent (1.0.0-0ubuntu11) groovy; urgency=medium

  * Disable suspending the system (LP: #1898087)
  * Always set resume device by PARTUUID instead of by device name.
    Based on patch by Francis Ginther. (LP: #1896638)

 -- Balint Reczey <email address hidden> Wed, 14 Oct 2020 20:49:52 +0200

Changed in ec2-hibinit-agent (Ubuntu):
status: Incomplete → Fix Released
Balint Reczey (rbalint)
Changed in ec2-hibinit-agent (Ubuntu Focal):
status: Incomplete → Confirmed
status: Confirmed → In Progress
Revision history for this message
Balint Reczey (rbalint) wrote :

@arighi, thanks for the info.

Is the deadlock observed on Bionic/Xenial, too?

Systemd in Bionic/Xenial does not support AllowSuspend=, etc., just SuspendMode=, HibernateMode=, HybridSleepMode= and SuspendState=, HibernateState=, HybridSleepState=.

Setting *Mode=hibernate would probably work. If Bionic and Xenial should be fixed, too, could you please confirm that?

Revision history for this message
Balint Reczey (rbalint) wrote :

I've uploaded the fix for Focal.

Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Balint, or anyone else affected,

Accepted ec2-hibinit-agent into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ec2-hibinit-agent/1.0.0-0ubuntu9.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in ec2-hibinit-agent (Ubuntu Focal):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-focal
Revision history for this message
Balint Reczey (rbalint) wrote :

Verified 1.0.0-0ubuntu9.1 on Focal:

ubuntu@ip-172-31-1-183:~$ dpkg -l ec2-hibinit-agent | cat
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=================-================-============-=================================
ii ec2-hibinit-agent 1.0.0-0ubuntu9.1 all Amazon EC2 hibernation agent
ubuntu@ip-172-31-1-183:~$ /lib/systemd/systemd-sleep suspend
Sleep mode "suspend" is disabled by configuration, refusing.
ubuntu@ip-172-31-1-183:~$

tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
Revision history for this message
Andrea Righi (arighi) wrote :

Just a comment to make sure we're all on the same page: this fix is only required in focal for now, because systemd in bionic and xenial does not have sleep.conf and does not recognize AllowSuspend=no.

Revision history for this message
Balint Reczey (rbalint) wrote :

Thanks, marking Bionic and Xenial as won't fix. Please reopen the bug against those releases if the SRU becomes needed.

Changed in ec2-hibinit-agent (Ubuntu Xenial):
status: Incomplete → Won't Fix
Changed in ec2-hibinit-agent (Ubuntu Bionic):
status: Incomplete → Won't Fix
ubuntu18 (sudana)
Changed in ec2-hibinit-agent (Ubuntu):
assignee: nobody → ubuntu18 (sudana)
Revision history for this message
Chris Halse Rogers (raof) wrote : Update Released

The verification of the Stable Release Update for ec2-hibinit-agent has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ec2-hibinit-agent - 1.0.0-0ubuntu9.1

---------------
ec2-hibinit-agent (1.0.0-0ubuntu9.1) focal; urgency=medium

  * Disable suspending the system (LP: #1898087)
  * Always set resume device by PARTUUID instead of by device name.
    Based on patch by Francis Ginther. (LP: #1896638)

 -- Balint Reczey <email address hidden> Fri, 02 Oct 2020 18:07:48 +0200

Changed in ec2-hibinit-agent (Ubuntu Focal):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.