lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 10 Sep 2013 18:57:55 -0400
From:	Josh Boyer <jwboyer@...oraproject.org>
To:	Vivek Goyal <vgoyal@...hat.com>
Cc:	"Linux-Kernel@...r. Kernel. Org" <linux-kernel@...r.kernel.org>,
	linux-security-module <linux-security-module@...r.kernel.org>,
	kexec <kexec@...ts.infradead.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Mimi Zohar <zohar@...ux.vnet.ibm.com>, d.kasatkin@...sung.com,
	"Eric W. Biederman" <ebiederm@...ssion.com>,
	"H. Peter Anvin" <hpa@...or.com>,
	Matthew Garrett <matthew.garrett@...ula.com>
Subject: Re: [PATCH 14/16] kexec: Export sysfs attributes for secureboot and
 secure modules to user space

On Tue, Sep 10, 2013 at 5:44 PM, Vivek Goyal <vgoyal@...hat.com> wrote:
> User space kexec-tools need to know whether to verify signature of kernel
> image being loaded. This patch exports two knobs to user space. One is
> for knowing if  secureboot is enabled, this knob will be set to 1 if secure
> boot is enabled. Other knob is secure_module_enabled. This knob will be set
> to 1 if secure modules is one.
>
> kexec-tools will verify signature of kernel image if either secureboot is
> enabled or secure modules is enabled. The only difference between two is
> that kexec-tools will set secureboot on in bootparams being passed to
> second kernel if secureboot is on in first kernel.
>
> Signed-off-by: Vivek Goyal <vgoyal@...hat.com>
> ---
>  kernel/ksysfs.c | 25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
>
> diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c
> index 6ada93c..7262245 100644
> --- a/kernel/ksysfs.c
> +++ b/kernel/ksysfs.c
> @@ -18,6 +18,8 @@
>  #include <linux/stat.h>
>  #include <linux/sched.h>
>  #include <linux/capability.h>
> +#include <linux/efi.h>
> +#include <linux/module.h>
>
>  #define KERNEL_ATTR_RO(_name) \
>  static struct kobj_attribute _name##_attr = __ATTR_RO(_name)
> @@ -101,6 +103,25 @@ static ssize_t kexec_crash_loaded_show(struct kobject *kobj,
>  }
>  KERNEL_ATTR_RO(kexec_crash_loaded);
>
> +static ssize_t secureboot_enabled_show(struct kobject *kobj,
> +                                      struct kobj_attribute *attr, char *buf)
> +{
> +       /* TODO: Change it once secureboot patches are in */
> +       return sprintf(buf, "%d\n", 1);
> +}
> +KERNEL_ATTR_RO(secureboot_enabled);

You're defaulting this to enabled, even on machines where SB isn't
possible.  I realize there are TODOs there, but you might want to
default it to off if you really intend this on going upstream before
any of the other secure_* infrastructure does.

> +
> +static ssize_t secure_modules_enabled_show(struct kobject *kobj,
> +                                      struct kobj_attribute *attr, char *buf)
> +{
> +       /*
> +        * TODO: Change it once secure_modules() or secure_level() patches
> +        * are in
> +        */
> +       return sprintf(buf, "%d\n", 1);
> +}
> +KERNEL_ATTR_RO(secure_modules_enabled);
> +

Similarly, this should either default to off, or just return the value
of sig_enforce.  You can replace the open coded sig_enforce with
secure_modules if/when it goes upstream.

josh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ