* [PATCH 10/24] hibernate: Disable when the kernel is locked down
[not found] <149142326734.5101.4596394505987813763.stgit@warthog.procyon.org.uk>
@ 2017-04-05 20:16 ` David Howells
2017-04-05 20:16 ` [PATCH 11/24] uswsusp: " David Howells
1 sibling, 0 replies; 12+ messages in thread
From: David Howells @ 2017-04-05 20:16 UTC (permalink / raw)
To: linux-kernel
Cc: gnomes, Josh Boyer, linux-pm, linux-efi, gregkh, dhowells,
linux-security-module, keyrings, matthew.garrett
From: Josh Boyer <jwboyer@fedoraproject.org>
There is currently no way to verify the resume image when returning
from hibernate. This might compromise the signed modules trust model,
so until we can work with signed hibernate images we disable it when the
kernel is locked down.
Signed-off-by: Josh Boyer <jwboyer@fedoraproject.org>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: linux-pm@vger.kernel.org
---
kernel/power/hibernate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index a8b978c35a6a..50cca5dcb62f 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -70,7 +70,7 @@ static const struct platform_hibernation_ops *hibernation_ops;
bool hibernation_available(void)
{
- return (nohibernate == 0);
+ return nohibernate == 0 && !kernel_is_locked_down();
}
/**
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 11/24] uswsusp: Disable when the kernel is locked down
[not found] <149142326734.5101.4596394505987813763.stgit@warthog.procyon.org.uk>
2017-04-05 20:16 ` [PATCH 10/24] hibernate: Disable when the kernel is locked down David Howells
@ 2017-04-05 20:16 ` David Howells
[not found] ` <149142336965.5101.2946578135980499557.stgit-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
1 sibling, 1 reply; 12+ messages in thread
From: David Howells @ 2017-04-05 20:16 UTC (permalink / raw)
To: linux-kernel
Cc: Matthew Garrett, linux-efi, gnomes, gregkh, linux-pm, dhowells,
linux-security-module, keyrings, matthew.garrett
From: Matthew Garrett <mjg59@srcf.ucam.org>
uswsusp allows a user process to dump and then restore kernel state, which
makes it possible to modify the running kernel. Disable this if the kernel
is locked down.
Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: linux-pm@vger.kernel.org
---
kernel/power/user.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/kernel/power/user.c b/kernel/power/user.c
index 22df9f7ff672..e4b926d329b7 100644
--- a/kernel/power/user.c
+++ b/kernel/power/user.c
@@ -52,6 +52,9 @@ static int snapshot_open(struct inode *inode, struct file *filp)
if (!hibernation_available())
return -EPERM;
+ if (kernel_is_locked_down())
+ return -EPERM;
+
lock_system_sleep();
if (!atomic_add_unless(&snapshot_device_available, -1, 0)) {
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 11/24] uswsusp: Disable when the kernel is locked down
[not found] ` <149142336965.5101.2946578135980499557.stgit-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
@ 2017-04-05 23:38 ` Rafael J. Wysocki
2017-04-06 6:39 ` Oliver Neukum
2017-04-06 6:55 ` David Howells
0 siblings, 2 replies; 12+ messages in thread
From: Rafael J. Wysocki @ 2017-04-05 23:38 UTC (permalink / raw)
To: David Howells
Cc: Linux Kernel Mailing List, Matthew Garrett,
linux-efi-u79uwXL29TY76Z2rM5mHXA,
gnomes-qBU/x9rampVanCEyBjwyrvXRex20P6io, Greg Kroah-Hartman,
Linux PM, linux-security-module-u79uwXL29TY76Z2rM5mHXA,
keyrings-u79uwXL29TY76Z2rM5mHXA,
matthew.garrett-05XSO3Yj/JvQT0dZR+AlfA
On Wed, Apr 5, 2017 at 10:16 PM, David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
> From: Matthew Garrett <mjg59-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>
>
> uswsusp allows a user process to dump and then restore kernel state, which
> makes it possible to modify the running kernel. Disable this if the kernel
> is locked down.
>
> Signed-off-by: Matthew Garrett <mjg59-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>
> Signed-off-by: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> cc: linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
You probably want to disable hibernation altogether in this case.
Thanks,
Rafael
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 11/24] uswsusp: Disable when the kernel is locked down
2017-04-05 23:38 ` Rafael J. Wysocki
@ 2017-04-06 6:39 ` Oliver Neukum
2017-04-06 8:41 ` David Howells
2017-04-06 6:55 ` David Howells
1 sibling, 1 reply; 12+ messages in thread
From: Oliver Neukum @ 2017-04-06 6:39 UTC (permalink / raw)
To: Rafael J. Wysocki, David Howells
Cc: Linux Kernel Mailing List, Matthew Garrett, linux-efi, gnomes,
Greg Kroah-Hartman, Linux PM, linux-security-module, keyrings,
matthew.garrett
Am Donnerstag, den 06.04.2017, 01:38 +0200 schrieb Rafael J. Wysocki:
> On Wed, Apr 5, 2017 at 10:16 PM, David Howells <dhowells@redhat.com> wrote:
> >
> > From: Matthew Garrett <mjg59@srcf.ucam.org>
> >
> > uswsusp allows a user process to dump and then restore kernel state, which
> > makes it possible to modify the running kernel. Disable this if the kernel
> > is locked down.
> >
> > Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>
> > Signed-off-by: David Howells <dhowells@redhat.com>
> > cc: linux-pm@vger.kernel.org
>
> You probably want to disable hibernation altogether in this case.
Your swap partition may be located on an NVDIMM or be encrypted.
Isn't this a bit overly drastic?
Regards
Oliver
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 11/24] uswsusp: Disable when the kernel is locked down
2017-04-05 23:38 ` Rafael J. Wysocki
2017-04-06 6:39 ` Oliver Neukum
@ 2017-04-06 6:55 ` David Howells
2017-04-06 20:07 ` Rafael J. Wysocki
1 sibling, 1 reply; 12+ messages in thread
From: David Howells @ 2017-04-06 6:55 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: dhowells, Linux Kernel Mailing List, Matthew Garrett, linux-efi,
gnomes, Greg Kroah-Hartman, Linux PM, linux-security-module,
keyrings, matthew.garrett
Rafael J. Wysocki <rafael@kernel.org> wrote:
> You probably want to disable hibernation altogether in this case.
See patch 10. Does that mean patch 11 is superfluous?
David
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 11/24] uswsusp: Disable when the kernel is locked down
2017-04-06 6:39 ` Oliver Neukum
@ 2017-04-06 8:41 ` David Howells
[not found] ` <14980.1491468060-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
0 siblings, 1 reply; 12+ messages in thread
From: David Howells @ 2017-04-06 8:41 UTC (permalink / raw)
To: Oliver Neukum
Cc: dhowells, Rafael J. Wysocki, Linux Kernel Mailing List,
Matthew Garrett, linux-efi, gnomes, Greg Kroah-Hartman, Linux PM,
linux-security-module, keyrings, matthew.garrett
Oliver Neukum <oneukum@suse.com> wrote:
> Your swap partition may be located on an NVDIMM or be encrypted.
An NVDIMM should be considered the same as any other persistent storage.
It may be encrypted, but where's the key stored, how easy is it to retrieve
and does the swapout code know this?
> Isn't this a bit overly drastic?
Perhaps, but if it's on disk and it's not encrypted, then maybe not.
David
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 11/24] uswsusp: Disable when the kernel is locked down
2017-04-06 6:55 ` David Howells
@ 2017-04-06 20:07 ` Rafael J. Wysocki
0 siblings, 0 replies; 12+ messages in thread
From: Rafael J. Wysocki @ 2017-04-06 20:07 UTC (permalink / raw)
To: David Howells
Cc: Rafael J. Wysocki, Linux Kernel Mailing List, Matthew Garrett,
linux-efi, gnomes, Greg Kroah-Hartman, Linux PM,
linux-security-module, keyrings, matthew.garrett
On Thu, Apr 6, 2017 at 8:55 AM, David Howells <dhowells@redhat.com> wrote:
> Rafael J. Wysocki <rafael@kernel.org> wrote:
>
>> You probably want to disable hibernation altogether in this case.
>
> See patch 10. Does that mean patch 11 is superfluous?
Yes, it does.
You can't open /dev/snapshot if hibernation_available() returns false.
Thanks,
Rafael
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 11/24] uswsusp: Disable when the kernel is locked down
[not found] ` <14980.1491468060-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
@ 2017-04-06 20:09 ` Rafael J. Wysocki
2017-04-06 20:12 ` Rafael J. Wysocki
0 siblings, 1 reply; 12+ messages in thread
From: Rafael J. Wysocki @ 2017-04-06 20:09 UTC (permalink / raw)
To: David Howells
Cc: Oliver Neukum, Rafael J. Wysocki, Linux Kernel Mailing List,
Matthew Garrett, linux-efi-u79uwXL29TY76Z2rM5mHXA,
gnomes-qBU/x9rampVanCEyBjwyrvXRex20P6io, Greg Kroah-Hartman,
Linux PM, linux-security-module-u79uwXL29TY76Z2rM5mHXA,
keyrings-u79uwXL29TY76Z2rM5mHXA,
matthew.garrett-05XSO3Yj/JvQT0dZR+AlfA
On Thu, Apr 6, 2017 at 10:41 AM, David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
> Oliver Neukum <oneukum-IBi9RG/b67k@public.gmane.org> wrote:
>
>> Your swap partition may be located on an NVDIMM or be encrypted.
>
> An NVDIMM should be considered the same as any other persistent storage.
>
> It may be encrypted, but where's the key stored, how easy is it to retrieve
> and does the swapout code know this?
>
>> Isn't this a bit overly drastic?
>
> Perhaps, but if it's on disk and it's not encrypted, then maybe not.
Right.
Swap encryption is not mandatory and I'm not sure how the hibernate
code can verify whether or not it is in use.
Thanks,
Rafael
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 11/24] uswsusp: Disable when the kernel is locked down
2017-04-06 20:09 ` Rafael J. Wysocki
@ 2017-04-06 20:12 ` Rafael J. Wysocki
2017-04-06 20:25 ` Jiri Kosina
0 siblings, 1 reply; 12+ messages in thread
From: Rafael J. Wysocki @ 2017-04-06 20:12 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: David Howells, Oliver Neukum, Linux Kernel Mailing List,
Matthew Garrett, linux-efi, gnomes, Greg Kroah-Hartman, Linux PM,
linux-security-module, keyrings, matthew.garrett, Jiri Kosina
On Thu, Apr 6, 2017 at 10:09 PM, Rafael J. Wysocki <rafael@kernel.org> wrote:
> On Thu, Apr 6, 2017 at 10:41 AM, David Howells <dhowells@redhat.com> wrote:
>> Oliver Neukum <oneukum@suse.com> wrote:
>>
>>> Your swap partition may be located on an NVDIMM or be encrypted.
>>
>> An NVDIMM should be considered the same as any other persistent storage.
>>
>> It may be encrypted, but where's the key stored, how easy is it to retrieve
>> and does the swapout code know this?
>>
>>> Isn't this a bit overly drastic?
>>
>> Perhaps, but if it's on disk and it's not encrypted, then maybe not.
>
> Right.
>
> Swap encryption is not mandatory and I'm not sure how the hibernate
> code can verify whether or not it is in use.
BTW, SUSE has patches adding secure boot support to the hibernate code
and Jiri promised me to post them last year even. :-)
Thanks,
Rafael
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 11/24] uswsusp: Disable when the kernel is locked down
2017-04-06 20:12 ` Rafael J. Wysocki
@ 2017-04-06 20:25 ` Jiri Kosina
2017-04-08 3:28 ` poma
0 siblings, 1 reply; 12+ messages in thread
From: Jiri Kosina @ 2017-04-06 20:25 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: David Howells, Oliver Neukum, Linux Kernel Mailing List,
Matthew Garrett, linux-efi, gnomes, Greg Kroah-Hartman, Linux PM,
linux-security-module, keyrings, Joey Lee, matthew.garrett
On Thu, 6 Apr 2017, Rafael J. Wysocki wrote:
> >>> Your swap partition may be located on an NVDIMM or be encrypted.
> >>
> >> An NVDIMM should be considered the same as any other persistent storage.
> >>
> >> It may be encrypted, but where's the key stored, how easy is it to retrieve
> >> and does the swapout code know this?
> >>
> >>> Isn't this a bit overly drastic?
> >>
> >> Perhaps, but if it's on disk and it's not encrypted, then maybe not.
> >
> > Right.
> >
> > Swap encryption is not mandatory and I'm not sure how the hibernate
> > code can verify whether or not it is in use.
>
> BTW, SUSE has patches adding secure boot support to the hibernate code
> and Jiri promised me to post them last year even. :-)
Oh, thanks for a friendly ping :) Adding Joey Lee to CC.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 11/24] uswsusp: Disable when the kernel is locked down
2017-04-06 20:25 ` Jiri Kosina
@ 2017-04-08 3:28 ` poma
2017-04-12 13:44 ` joeyli
0 siblings, 1 reply; 12+ messages in thread
From: poma @ 2017-04-08 3:28 UTC (permalink / raw)
To: Jiri Kosina, Rafael J. Wysocki
Cc: David Howells, Oliver Neukum, Linux Kernel Mailing List,
Matthew Garrett, linux-efi, gnomes, Greg Kroah-Hartman, Linux PM,
linux-security-module, keyrings, Joey Lee, matthew.garrett
On 06.04.2017 22:25, Jiri Kosina wrote:
> On Thu, 6 Apr 2017, Rafael J. Wysocki wrote:
>
>>>>> Your swap partition may be located on an NVDIMM or be encrypted.
>>>>
>>>> An NVDIMM should be considered the same as any other persistent storage.
>>>>
>>>> It may be encrypted, but where's the key stored, how easy is it to retrieve
>>>> and does the swapout code know this?
>>>>
>>>>> Isn't this a bit overly drastic?
>>>>
>>>> Perhaps, but if it's on disk and it's not encrypted, then maybe not.
>>>
>>> Right.
>>>
>>> Swap encryption is not mandatory and I'm not sure how the hibernate
>>> code can verify whether or not it is in use.
>>
>> BTW, SUSE has patches adding secure boot support to the hibernate code
>> and Jiri promised me to post them last year even. :-)
>
> Oh, thanks for a friendly ping :) Adding Joey Lee to CC.
>
Rafael J., are you talking about HIBERNATE_VERIFICATION ?
Ref.
https://github.com/joeyli/linux-s4sign/commits/s4sign-hmac-v2-v4.2-rc8
https://lkml.org/lkml/2015/8/11/47
https://bugzilla.redhat.com/show_bug.cgi?id=1330335
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 11/24] uswsusp: Disable when the kernel is locked down
2017-04-08 3:28 ` poma
@ 2017-04-12 13:44 ` joeyli
0 siblings, 0 replies; 12+ messages in thread
From: joeyli @ 2017-04-12 13:44 UTC (permalink / raw)
To: poma
Cc: Jiri Kosina, Rafael J. Wysocki, David Howells, Oliver Neukum,
Linux Kernel Mailing List, Matthew Garrett, linux-efi, gnomes,
Greg Kroah-Hartman, Linux PM, linux-security-module, keyrings,
matthew.garrett
On Sat, Apr 08, 2017 at 05:28:15AM +0200, poma wrote:
> On 06.04.2017 22:25, Jiri Kosina wrote:
> > On Thu, 6 Apr 2017, Rafael J. Wysocki wrote:
> >
> >>>>> Your swap partition may be located on an NVDIMM or be encrypted.
> >>>>
> >>>> An NVDIMM should be considered the same as any other persistent storage.
> >>>>
> >>>> It may be encrypted, but where's the key stored, how easy is it to retrieve
> >>>> and does the swapout code know this?
> >>>>
> >>>>> Isn't this a bit overly drastic?
> >>>>
> >>>> Perhaps, but if it's on disk and it's not encrypted, then maybe not.
> >>>
> >>> Right.
> >>>
> >>> Swap encryption is not mandatory and I'm not sure how the hibernate
> >>> code can verify whether or not it is in use.
> >>
> >> BTW, SUSE has patches adding secure boot support to the hibernate code
> >> and Jiri promised me to post them last year even. :-)
> >
> > Oh, thanks for a friendly ping :) Adding Joey Lee to CC.
> >
>
> Rafael J., are you talking about HIBERNATE_VERIFICATION ?
>
> Ref.
> https://github.com/joeyli/linux-s4sign/commits/s4sign-hmac-v2-v4.2-rc8
> https://lkml.org/lkml/2015/8/11/47
> https://bugzilla.redhat.com/show_bug.cgi?id=1330335
>
I am working on switch to HMAC-SHA512.
On the other hand, some mechanisms keep signing/encryption key in memory.
e.g. dm-crypt or hibernation verification. Kees Cook suggested that we
should add kernel memory reads as a thread model of securelevel to
prevent leaking those keys by /dev/kmem, bpf, kdump or hibernation...
We still need time to implement it.
Thanks a lot!
Joey Lee
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2017-04-12 13:45 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <149142326734.5101.4596394505987813763.stgit@warthog.procyon.org.uk>
2017-04-05 20:16 ` [PATCH 10/24] hibernate: Disable when the kernel is locked down David Howells
2017-04-05 20:16 ` [PATCH 11/24] uswsusp: " David Howells
[not found] ` <149142336965.5101.2946578135980499557.stgit-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
2017-04-05 23:38 ` Rafael J. Wysocki
2017-04-06 6:39 ` Oliver Neukum
2017-04-06 8:41 ` David Howells
[not found] ` <14980.1491468060-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
2017-04-06 20:09 ` Rafael J. Wysocki
2017-04-06 20:12 ` Rafael J. Wysocki
2017-04-06 20:25 ` Jiri Kosina
2017-04-08 3:28 ` poma
2017-04-12 13:44 ` joeyli
2017-04-06 6:55 ` David Howells
2017-04-06 20:07 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox