Double-escape in initramfs DECRYPT_CMD

Bug #1852406 reported by Witold Krecicki
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
zfs-linux (Ubuntu)
Fix Released
Medium
Colin Ian King
Eoan
Fix Released
Medium
Colin Ian King
Focal
Fix Released
Medium
Colin Ian King

Bug Description

== SRU Justification, Eoan ==

initramfs/scripts/zfs.in incorrectly quotes ${ENCRYPTIONROOT} on line 414:

DECRYPT_CMD="${ZFS} load-key '${ENCRYPTIONROOT}'"

This is OK when the line is executed by shell, such as in line 430 or 436, but when plymouth is used it results in plymouth executing "zfs load-key 'rpool'" - and zfs is unable to find pool called "'rpool'".

If I understand https://docs.oracle.com/cd/E23824_01/html/821-1448/gbcpt.html correctly zfs pool name is always 'shell-friendly', so removing the quotation marks would be a proper fix for that.

== Fix ==

One line fix as attached in https://bugs.launchpad.net/ubuntu/+source/zfs-linux/+bug/1852406/comments/1

== Test ==

Boot with encrypted data set with plymouth. Without the fix zfs is unable to find the root encrypted pool. With the fix this works.

== Regression Potential ==

This just affects the encrypted dataset that holds key for root dataset; currently this is causing issues because of the bug, so the risk of the fix outweighs the current situation where this is currently broken.

Revision history for this message
Witold Krecicki (wpk) wrote :
Revision history for this message
Colin Ian King (colin-king) wrote :

Thanks for the patch. Any specific version of zfs-linux this relates to?

Changed in zfs-linux (Ubuntu):
importance: Undecided → Medium
assignee: nobody → Colin Ian King (colin-king)
status: New → Triaged
Revision history for this message
Colin Ian King (colin-king) wrote :

Fixed in zfs-0.8.2 in focal.

Changed in zfs-linux (Ubuntu Focal):
status: Triaged → Fix Released
Changed in zfs-linux (Ubuntu Eoan):
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Colin Ian King (colin-king)
Revision history for this message
Colin Ian King (colin-king) wrote :

Fix required only in zfs-linux-0.8.1 in Eoan.

description: updated
Revision history for this message
Garrett Fields (fields-g) wrote :

I believe you ran into something reported and fixed upstream. https://github.com/zfsonlinux/zfs/pull/9202
(Merged to master Aug 27 and included in 0.8.2)

Revision history for this message
Richard Laager (rlaager) wrote :

The fix here seems fine, given that you're going for minimal impact in an SRU. I agree that the character restrictions are such that the pool names shouldn't actually need to be escaped. That's not to say that I would remove the _proper_ quoting of variables that currently exists upstream, as it's good shell programming practice to always quote variables.

Revision history for this message
Colin Ian King (colin-king) wrote :

Yes, minimal impact and reducing regression risk is key in SRUs.

Revision history for this message
Witold Krecicki (wpk) wrote :

btw, there's another bug in plymouth package that breaks root on encrypted zfs in some cases, the patch is there but it's waiting for review:
https://bugs.launchpad.net/ubuntu/+source/plymouth/+bug/1810154

Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Witold, or anyone else affected,

Accepted zfs-linux into eoan-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/zfs-linux/0.8.1-1ubuntu14.2 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 and change the tag from verification-needed-eoan to verification-done-eoan. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-eoan. 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 zfs-linux (Ubuntu Eoan):
status: In Progress → Fix Committed
Revision history for this message
Colin Ian King (colin-king) wrote :

@Witold, is it possible for you to sanity check this, if it's not verified it won't be fixed.

thanks

Colin

Revision history for this message
Witold Krecicki (wpk) wrote :

@colin-king I just checked and, with the plymouth fix also applied, the issue is fixed in 0.8.1-1ubuntu14.2

Revision history for this message
Colin Ian King (colin-king) wrote :

I was hoping you could test the version in -proposed. Without it being verified as fixed then the fix won't be released for Eoan.

Revision history for this message
Witold Krecicki (wpk) wrote :

@colin-king I got it (0.8.1-1ubuntu14.2) from eoan-proposed, and yes - this version fixes the issue.

Revision history for this message
Colin Ian King (colin-king) wrote :

Thanks Witold! Much appreciated.

tags: added: verification-done verification-done-eoan
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package zfs-linux - 0.8.1-1ubuntu14.2

---------------
zfs-linux (0.8.1-1ubuntu14.2) eoan; urgency=medium

  * 4601-zfs-encryptionroot-quote.patch
    - remove quotation marks to fix zfs load-key errors in
      plymouth when using an encrypted pool (LP: #1852406)

 -- Colin Ian King <email address hidden> Wed, 13 Nov 2019 11:21:12 +0000

Changed in zfs-linux (Ubuntu Eoan):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for zfs-linux 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.

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.