All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5][RFC] Encryption and authentication for hibernate snapshot image
@ 2018-09-12 14:23 Lee, Chun-Yi
  2018-09-12 14:23 ` [PATCH 1/5] PM / hibernate: Create snapshot keys handler Lee, Chun-Yi
                   ` (4 more replies)
  0 siblings, 5 replies; 30+ messages in thread
From: Lee, Chun-Yi @ 2018-09-12 14:23 UTC (permalink / raw)
  To: Rafael J . Wysocki, Pavel Machek
  Cc: linux-kernel, linux-pm, Lee, Chun-Yi, Rafael J. Wysocki, Chen Yu,
	Oliver Neukum, Ryan Chen, David Howells, Giovanni Gherdovich

Hi,

This patchset is the implementation of encryption and authentication
for hibernate snapshot image. The image will be encrypted by AES and
authenticated by HMAC.

The hibernate function can be used to snapshot memory pages to an image,
then kernel restores the image to memory space in a appropriate time.
There have secrets in snapshot image and cracker may modifies it for
hacking system. Encryption and authentication of snapshot image can protect
the system.

Hibernate function requests the master key through key retention service.
The snapshot master key can be a trusted key or a user defined key. The
name of snapshot master key is fixed to "swsusp-kmk". User should loads
swsusp-kmk to kernel by keyctl tool before the hibernation resume.
e.g. The swsusp-kmk must be loaded before systemd-hibernate-resume

The TPM trusted key type is preferred to be the master key. But user
defined key can also be used for testing or when the platform doesn't
have TPM. User must be aware that the security of user key relies on
user space. If the root account be compromised, then the user key will
easy to be grabbed.

Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Chen Yu <yu.c.chen@intel.com>
Cc: Oliver Neukum <oneukum@suse.com>
Cc: Ryan Chen <yu.chen.surf@gmail.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Giovanni Gherdovich <ggherdovich@suse.cz>
Signed-off-by: "Lee, Chun-Yi" <jlee@suse.com>

Lee, Chun-Yi (5):
  PM / hibernate: Create snapshot keys handler
  PM / hibernate: Generate and verify signature for snapshot image
  PM / hibernate: Encrypt snapshot image
  PM / hibernate: Erase the snapshot master key in snapshot pages
  PM / hibernate: An option to request that snapshot image must be
    authenticated

 Documentation/admin-guide/kernel-parameters.txt |   6 +
 include/linux/kernel.h                          |   3 +-
 kernel/panic.c                                  |   1 +
 kernel/power/Kconfig                            |  25 +
 kernel/power/Makefile                           |   1 +
 kernel/power/hibernate.c                        |  62 ++-
 kernel/power/power.h                            |  59 +++
 kernel/power/snapshot.c                         | 576 +++++++++++++++++++++++-
 kernel/power/snapshot_key.c                     | 303 +++++++++++++
 kernel/power/swap.c                             |   6 +
 kernel/power/user.c                             |  12 +
 11 files changed, 1036 insertions(+), 18 deletions(-)
 create mode 100644 kernel/power/snapshot_key.c

-- 
2.13.6


^ permalink raw reply	[flat|nested] 30+ messages in thread
* [PATCH 0/5 v2][RFC] Encryption and authentication for hibernate snapshot image
@ 2019-01-03 14:32 Lee, Chun-Yi
  2019-01-03 14:32   ` Lee, Chun-Yi
  0 siblings, 1 reply; 30+ messages in thread
From: Lee, Chun-Yi @ 2019-01-03 14:32 UTC (permalink / raw)
  To: Rafael J . Wysocki, Pavel Machek
  Cc: linux-kernel, linux-pm, keyrings, Lee, Chun-Yi,
	Rafael J. Wysocki, Chen Yu, Oliver Neukum, Ryan Chen,
	David Howells, Giovanni Gherdovich, Randy Dunlap, Jann Horn,
	Andy Lutomirski

Hi,

This patchset is the implementation of encryption and authentication
for hibernate snapshot image. The image will be encrypted by AES and
authenticated by HMAC.

The hibernate function can be used to snapshot memory pages to an image,
then kernel restores the image to memory space in a appropriate time.
There have secrets in snapshot image and cracker may modifies it for
hacking system. Encryption and authentication of snapshot image can protect
the system.

Hibernate function requests the master key through key retention service.
The snapshot master key can be a trusted key or a user defined key. The
name of snapshot master key is fixed to "swsusp-kmk". User should loads
swsusp-kmk to kernel by keyctl tool before the hibernation resume.
e.g. The swsusp-kmk must be loaded before systemd-hibernate-resume

The TPM trusted key type is preferred to be the master key. But user
defined key can also be used for testing or when the platform doesn't
have TPM. User must be aware that the security of user key relies on
user space. If the root account be compromised, then the user key will
easy to be grabbed.

v2:
- Fixed bug of trusted_key_init's return value.
- Fixed wording in Kconfig
- Removed VLA usage
- Removed the checking of capability for writing disk_kmk.
- Fixed Kconfig, select trusted key.
- Add memory barrier before setting key initialized flag.
- Add memory barrier after cleaning key initialized flag.

Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Chen Yu <yu.c.chen@intel.com>
Cc: Oliver Neukum <oneukum@suse.com>
Cc: Ryan Chen <yu.chen.surf@gmail.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Giovanni Gherdovich <ggherdovich@suse.cz>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Jann Horn <jannh@google.com>
Cc: Andy Lutomirski <luto@kernel.org>
Signed-off-by: "Lee, Chun-Yi" <jlee@suse.com>

Lee, Chun-Yi (5):
  PM / hibernate: Create snapshot keys handler
  PM / hibernate: Generate and verify signature for snapshot image
  PM / hibernate: Encrypt snapshot image
  PM / hibernate: Erase the snapshot master key in snapshot pages
  PM / hibernate: An option to request that snapshot image must be
    authenticated

 Documentation/admin-guide/kernel-parameters.txt |   6 +
 include/linux/kernel.h                          |   3 +-
 kernel/panic.c                                  |   1 +
 kernel/power/Kconfig                            |  25 +
 kernel/power/Makefile                           |   1 +
 kernel/power/hibernate.c                        |  59 ++-
 kernel/power/power.h                            |  59 +++
 kernel/power/snapshot.c                         | 576 +++++++++++++++++++++++-
 kernel/power/snapshot_key.c                     | 312 +++++++++++++
 kernel/power/swap.c                             |   6 +
 kernel/power/user.c                             |  12 +
 11 files changed, 1042 insertions(+), 18 deletions(-)
 create mode 100644 kernel/power/snapshot_key.c

-- 
2.13.6

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2019-01-06  8:24 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-12 14:23 [PATCH 0/5][RFC] Encryption and authentication for hibernate snapshot image Lee, Chun-Yi
2018-09-12 14:23 ` [PATCH 1/5] PM / hibernate: Create snapshot keys handler Lee, Chun-Yi
2018-09-12 16:27   ` Randy Dunlap
2018-09-13  8:39     ` joeyli
2018-09-13 13:58   ` Yu Chen
2018-10-01 10:47     ` joeyli
2018-09-13 14:31   ` Jann Horn
2018-09-13 14:31     ` Jann Horn
2018-10-02  7:54     ` joeyli
2018-10-02  7:54       ` joeyli
2018-10-02 19:36       ` Jann Horn
2018-10-02 19:36         ` Jann Horn
2018-10-03 22:08         ` Andy Lutomirski
2018-10-03 22:08           ` Andy Lutomirski
2018-10-08 13:29           ` joeyli
2018-10-08 13:29             ` joeyli
2018-10-08 13:29             ` joeyli
2018-10-04  4:02         ` Mimi Zohar
2018-10-04  4:02           ` Mimi Zohar
2018-09-14  5:52   ` kbuild test robot
2018-09-12 14:23 ` [PATCH 2/5] PM / hibernate: Generate and verify signature for snapshot image Lee, Chun-Yi
2018-09-12 14:23 ` [PATCH 3/5] PM / hibernate: Encrypt " Lee, Chun-Yi
2018-09-12 14:23 ` [PATCH 4/5] PM / hibernate: Erase the snapshot master key in snapshot pages Lee, Chun-Yi
2018-09-12 14:23 ` [PATCH 5/5] PM / hibernate: An option to request that snapshot image must be authenticated Lee, Chun-Yi
2018-09-12 16:24   ` Randy Dunlap
2018-09-13  8:37     ` joeyli
2019-01-03 14:32 [PATCH 0/5 v2][RFC] Encryption and authentication for hibernate snapshot image Lee, Chun-Yi
2019-01-03 14:32 ` [PATCH 3/5] PM / hibernate: Encrypt " Lee, Chun-Yi
2019-01-03 14:32   ` Lee, Chun-Yi
2019-01-06  8:23   ` Stephan Mueller
2019-01-06  8:23     ` Stephan Mueller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.