oem-config process that zero's swap broken on armel preinstalled images

Bug #646421 reported by Tobin Davis on 2010-09-23
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Release Notes for Ubuntu
Undecided
Oliver Grawert
ubiquity (Ubuntu)
High
Unassigned
Maverick
High
Unassigned
user-setup (Ubuntu)
High
Oliver Grawert
Maverick
High
Oliver Grawert

Bug Description

Binary package hint: ubiquity

Currently, armel preinstalled images use a swap file (/SWAP.swp) instead of a swap partition. When creating a user profile in oem-config that uses encrypted home directory, oem-config zeros the swap by just writing /dev/zero to the current swap. In this usage case, swap will fill up the entire root partition causing the rest of oem-config to fail due to lack of free space.

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: oem-config 2.4.1
ProcVersionSignature: User Name 2.6.35-903.12-omap4 2.6.35.3
Uname: Linux 2.6.35-903-omap4 armv7l
Architecture: armel
Date: Thu Sep 23 14:48:36 2010
PackageArchitecture: all
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: ubiquity

Tobin Davis (gruemaster) wrote :
Oliver Grawert (ogra) on 2010-09-24
Changed in ubiquity (Ubuntu Maverick):
milestone: none → ubuntu-10.10
importance: Undecided → High
Emmet Hikory (persia) wrote :

This probably needs an additional check in user-setup-apply to only use an unlimited copy from /dev/zero when swap is a block device, and limit it to the current size when swap is a file.

Oliver Grawert (ogra) on 2010-09-24
Changed in ubiquity (Ubuntu Maverick):
status: New → Invalid
Changed in user-setup (Ubuntu Maverick):
status: New → Confirmed
importance: Undecided → High
milestone: none → ubuntu-10.10
Oliver Grawert (ogra) wrote :

the problematic code in user-setup-apply is:

        if [ -n "$ENCRYPT_HOME_OPT" ] && [ -e $ROOT/etc/crypttab ]; then
                # Zero out all encrypted swap partitions. It is assumed that
                # passwords are not used beyond this point in the install.
                # cryptswap0 /dev/sda5 /dev/urandom swap,cipher=aes-cbc-essiv:sha256
                # Ideally we would set up a new progress bar here, but we're
                # inside finish-install's and cdebconf doesn't support nested
                # progress bars.
                db_progress INFO user-setup/progress/wipe-swap
                while read name device source options; do
                        if echo "$options" | grep -q "swap"; then
                                if swapoff $device; then
                                        dd if=/dev/zero of=$device 2>/dev/null || true
                                fi
                        fi
                done < $ROOT/etc/crypttab
        fi

some testing for blockdevices and files (if [ -b $device ] ...) needs to be added here.
in case a file is detected, the size needs to be handed over to dd.

Oliver Grawert (ogra) on 2010-09-24
Changed in ubiquity (Ubuntu Maverick):
milestone: ubuntu-10.10 → none
tags: added: iso-testing
Changed in user-setup (Ubuntu Maverick):
milestone: ubuntu-10.10 → maverick-updates
Changed in ubuntu-release-notes:
assignee: nobody → Oliver Grawert (ogra)
Oliver Grawert (ogra) wrote :

Release Note:

"On the current preinstalled images for Ubuntu ARM a bug (number 646421) exists that will grow the swap file to occupy the full free space of your SD card if you select to use an encrypted home dir during install. There is currently no workaround but to not select this option, a fix for this bug is in progress."

Changed in ubuntu-release-notes:
status: New → Fix Committed
Oliver Grawert (ogra) on 2010-10-01
Changed in user-setup (Ubuntu Maverick):
assignee: nobody → Oliver Grawert (ogra)
milestone: maverick-updates → ubuntu-10.10
Oliver Grawert (ogra) on 2010-10-01
Changed in user-setup (Ubuntu Maverick):
status: Confirmed → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package user-setup - 1.28ubuntu9

---------------
user-setup (1.28ubuntu9) maverick; urgency=low

  * make zeroing swap work also with swapfiles if encrypted home
    is selected (LP: #646421)
 -- Oliver Grawert <email address hidden> Sat, 02 Oct 2010 01:23:03 +0200

Changed in user-setup (Ubuntu Maverick):
status: Fix Committed → Fix Released
John Gilmore (gnu-gilmore) wrote :

Also note that this "dd" should specify a blocksize, rather than defaulting to 512 byte writes. This will vastly speed up the process of clearing encrypted swapspace. See bug #432422.

MillenniumBug (millenniumbug) wrote :

Should this issue be removed from the release notes?

Changed in ubuntu-release-notes:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers