Bug 1330335 - Enhancement: Support for generating and verifying the signature of memory snapshot image
Summary: Enhancement: Support for generating and verifying the signature of memory sna...
Keywords:
Status: MODIFIED
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: rawhide
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL: https://github.com/joeyli/linux-s4sig...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-25 23:51 UTC by poma
Modified: 2017-04-08 03:16 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-04-26 00:49:01 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Signature verification of hibernate snapshot v2 - 4.5.2 (69.09 KB, patch)
2016-04-25 23:51 UTC, poma
no flags Details | Diff
Signature verification of hibernate snapshot v2 - 4.6-rc6 (141.91 KB, patch)
2016-05-03 16:02 UTC, poma
no flags Details | Diff
S4 suspend-resume log - 4.6-rc6 (70.99 KB, text/plain)
2016-05-03 16:03 UTC, poma
no flags Details

Description poma 2016-04-25 23:51:03 UTC
Created attachment 1150652 [details]
Signature verification of hibernate snapshot v2 - 4.5.2

Support for generating and verifying the signature of memory snapshot image by HMAC-SHA1.

Tested with:
 efi: EFI v2.60 by EDK II
 DMI: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
 Hypervisor detected: KVM
 Secure boot enabled

resulted:
 PM: Image restored successfully.
 PM: Enforce hibernate signature verifying
 PM: Signature verifying pass
 PM: Restored hibernation keys

Comment 1 Josh Boyer 2016-04-26 00:49:01 UTC
A few comments.

Too late for f24.  Moving to rawhide and marking as FutureFeature.

If we were to support this, rather than a giant patch we'd probably take the individual patches from the original author.

Marking as DEFERRED until we figure out the strategy behind the Secure Boot patches overall.  We can reopen when we have that figured out.

Comment 2 poma 2016-05-03 16:02:08 UTC
Created attachment 1153506 [details]
Signature verification of hibernate snapshot v2 - 4.6-rc6

Comment 3 poma 2016-05-03 16:03:13 UTC
Created attachment 1153507 [details]
S4 suspend-resume log - 4.6-rc6

Comment 4 poma 2016-05-05 22:39:26 UTC
How to test with e.g. kernel 4.6.0-0.rc6.git0.1

$ git clone http://pkgs.fedoraproject.org/git/rpms/kernel.git ~/rpmbuild/SOURCES/
$ cd ~/rpmbuild/SOURCES/
$ git checkout 5f62b8b

$ wget -c --no-check-certificate \
https://pkgs.fedoraproject.org/repo/pkgs/kernel/perf-man-4.5.tar.gz/md5/6f557fe90b800b615c85c2ca04da6154/perf-man-4.5.tar.gz \
https://pkgs.fedoraproject.org/repo/pkgs/kernel/patch-4.6-rc6.xz/md5/60d2e4b5eeb4ff2b58cf85a03d9c6a4b/patch-4.6-rc6.xz \
https://pkgs.fedoraproject.org/repo/pkgs/kernel/linux-4.5.tar.xz/md5/a60d48eee08ec0536d5efb17ca819aef/linux-4.5.tar.xz
$ md5sum -c sources

$ curl -s https://bugzilla.redhat.com/attachment.cgi?id=1153506 | patch -p1
$ rpmbuild -ba [--with baseonly] [--without debuginfo] kernel.spec 


Booting custom kernels in Fedora 2x with Secure Boot [1]

$ certutil -d /etc/pki/pesign-rh-test -L -n "Red Hat Test CA" -r > rhca.der
$ su
# mokutil --import rhca.der
# reboot

MOK Managment
  -> Enroll MOK
    -> Continue
      -> Enroll the key
        -> Password
          -> Reboot



[1] Ref.
    http://jwboyer.livejournal.com/46149.html

Comment 5 Jóhann B. Guðmundsson 2016-05-06 09:34:27 UTC
(In reply to Josh Boyer from comment #1)
> A few comments.
> 
> Too late for f24.  Moving to rawhide and marking as FutureFeature.

This is irrelevant to specific Fedora release.

> If we were to support this, rather than a giant patch we'd probably take the
> individual patches from the original author.
> 
> Marking as DEFERRED until we figure out the strategy behind the Secure Boot
> patches overall.  We can reopen when we have that figured out.


What "strategy" is supposed to be involved here? 

Does this not just travel the usual upstream --> downstream path as in in the kernel patch set needs to be implemented upstream and once it's supported enabled downstream for that or those kernel version it's implemented and will be enabled in all GA releases once that or those spesific kernel version contains that or those patches..

Comment 6 poma 2016-06-27 19:02:50 UTC
How to test verified S4 with stable 4.6.3 kernel

Via LiveDVD [1], to promptly hibernate machine from the Xfce Desktop, enabled 512 MB swap partition is sufficient.
Of course, during both - the initial boot and resume(thaw) boot, kernel command line requires effective resume= directive.

[1] Test compilation:
    http://goo.gl/Gm4ffO
    iso/


Note You need to log in before you can comment on or make changes to this bug.