linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Cc: jeyu@kernel.org, corbet@lwn.net, rdunlap@infradead.org,
	mchehab+samsung@kernel.org, tglx@linutronix.de,
	akpm@linux-foundation.org, pawan.kumar.gupta@linux.intel.com,
	jgross@suse.com, linux-kernel@vger.kernel.org,
	linux-doc@vger.kernel.org
Subject: Re: [PATCH v3] module: Allow to disable modsign in kernel cmdline
Date: Tue, 28 Apr 2020 09:29:44 +0200	[thread overview]
Message-ID: <20200428072944.GA994208@kroah.com> (raw)
In-Reply-To: <8a0c0ef3-4881-1b9c-6e42-ab379542bc16@linux.alibaba.com>

On Tue, Apr 28, 2020 at 03:07:10PM +0800, Tianjia Zhang wrote:
> 
> 
> On 2020/4/28 14:35, Greg KH wrote:
> > On Tue, Apr 28, 2020 at 02:00:08PM +0800, Tianjia Zhang wrote:
> > > This option allows to disable modsign completely at the beginning,
> > > and turn off by set the kernel cmdline `no_modsig_enforce` when
> > > `CONFIG_MODULE_SIG_FORCE` is enabled.
> > > 
> > > Yet another change allows to always show the current status of
> > > modsign through `/sys/module/module/parameters/sig_enforce`.
> > > 
> > > Signed-off-by: Jia Zhang <zhang.jia@linux.alibaba.com>
> > > Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
> > > ---
> > > 
> > > v3 change:
> > >    Beautify the document description according to the recommendation.
> > > 
> > > v2 change:
> > >    document this new option.
> > > 
> > >   Documentation/admin-guide/kernel-parameters.txt | 6 ++++++
> > >   kernel/module.c                                 | 8 ++++++++
> > >   2 files changed, 14 insertions(+)
> > > 
> > > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> > > index 7bc83f3d9bdf..b30f013fb8c5 100644
> > > --- a/Documentation/admin-guide/kernel-parameters.txt
> > > +++ b/Documentation/admin-guide/kernel-parameters.txt
> > > @@ -3190,6 +3190,12 @@
> > >   	noirqdebug	[X86-32] Disables the code which attempts to detect and
> > >   			disable unhandled interrupt sources.
> > > +	no_modsig_enforce
> > > +			[KNL] When CONFIG_MODULE_SIG_FORCE is set, this option
> > > +			allows to disable modsign completely at the beginning.
> > > +			This means that modules without (valid) signatures will
> > > +			be loaded successfully.
> > > +
> > 
> > So now we have module.sig_enforce and this one?  That feels really
> > confusing, why can't you just use the existing option?
> > 
> > And why would you want to allow the bootloader to override a kernel
> > build option like this?  That feels risky.
> > 
> > thanks,
> > 
> > greg k-h
> > 
> 
> If CONFIG_MODULE_SIG_FORCE is set, `module.sig_enforce` is always true and
> read-only. There is indeed a risk in doing this, but it will allow the
> system to boot normally in some emergency situations, such as certificate
> expiration.
> 
> On the other hand, would it be a good solution to make `module.sig_enforce`
> readable and writable?

Readable is fine :)

And you really can't modify the existing option to change how it works,
but my question is, why would you want to override
CONFIG_MODULE_SIG_FORCE at all?  I wouldn't want my bootloader to have
the ability to change the kernel's protection model, that's a huge
security hole you are adding to the kernel that it can not protect
itself from at all.

thanks,

greg k-h

  reply	other threads:[~2020-04-28  7:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-28  6:00 [PATCH v3] module: Allow to disable modsign in kernel cmdline Tianjia Zhang
2020-04-28  6:35 ` Greg KH
2020-04-28  7:07   ` Tianjia Zhang
2020-04-28  7:29     ` Greg KH [this message]
2020-04-28  8:24       ` Tianjia Zhang
2020-04-28 10:02       ` Jessica Yu
2020-04-29  2:13         ` Tianjia Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200428072944.GA994208@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=jeyu@kernel.org \
    --cc=jgross@suse.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab+samsung@kernel.org \
    --cc=pawan.kumar.gupta@linux.intel.com \
    --cc=rdunlap@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=tianjia.zhang@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).