upower doesn't properly detect encrypted swap

Bug #720636 reported by Mirko Hahn
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
upower (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: upower

upower doesn't recognize a cryptswap partition created using the ecryptfs-setup-swap, rendering the AllowHibernateEncryptedSwap setting in /etc/UPower/UPower.conf ineffective.

Using the ecryptfs-setup-swap script, I got the following /etc/crypttab line:

    # <target name> <source device> <key file> <options>
    cryptswap1 /dev/sda5 /dev/urandom swap,cipher=aes-cbc-essiv:sha256

To prevent hibernation issues with randomly encrypted swap, I attempted to prevent hibernation and discovered, that /etc/UPower/UPower.conf has a setting called AllowHibernateEncryptedSwap which seems to do just that. Therefore, I altered the corresponding line to:

    # This controls whether hibernate is allowed when using encrypted swap.
    #
    # default=true
    AllowHibernateEncryptedSwap=false

The remainder of the file is identical to the original version since I reinstalled my system just yesterday. I then rebooted, expecting hibernation options to disappear from the shutdown menu. Seeing how this didn't happen, I used D-feet to inspect the org.freedesktop.UPower D-Bus interface (system bus) which returned a boolean value of 1 for property CanHibernate on object path /org/freedesktop/UPower, indicating that UPower had not properly identified the encrypted swap.

=== conjecture (!) on possible cause ===

A brief glance over the original source package (minus all patches) upower_0.9.5.orig.tar.gz as provided by Launchpad indicates that upower identifies encrypted swap partitions by comparing entries in /proc/swaps and /etc/crypttab. However, my /proc/swaps reads

    Filename Type Size Used Priority
    /dev/dm-0 partition 8000364 0 -1

which is actually the device symlinked by /dev/mapper/cryptswap. The reason why upower doesn't identify these two entries might therefore be lack of symlink resolution in upower's up_backend_has_encrypted_swap (located in src/linux/up-backend.c, line ~387)

=== apport information ===
Architecture: amd64
DistroRelease: Ubuntu 10.10
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)
NonfreeKernelModules: fglrx
Package: upower 0.9.5-4
PackageArchitecture: amd64
ProblemType: Bug
SourcePackage: upower
Tags: maverick
Uname: Linux 2.6.35-27-generic x86_64

description: updated
Changed in upower (Ubuntu):
status: New → Confirmed
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.