public inbox for linux-clk@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Michael Turquette <mturquette@baylibre.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-clk <linux-clk@vger.kernel.org>
Subject: Re: [PATCH] clk: Emit a stern warning with writable debugfs enabled
Date: Fri, 10 Dec 2021 15:12:07 -0800	[thread overview]
Message-ID: <20211210231209.4E7EDC00446@smtp.kernel.org> (raw)
In-Reply-To: <CAMuHMdVf+EsN8n9iON186xCZETafGscOOB4AXOZpaH0Aui-2=A@mail.gmail.com>

Quoting Geert Uytterhoeven (2021-12-09 23:57:25)
> Hi Stephen,
> 
> On Fri, Dec 10, 2021 at 2:42 AM Stephen Boyd <sboyd@kernel.org> wrote:
> > We don't want vendors to be enabling this part of the clk code and
> > shipping it to customers. Exposing the ability to change clk frequencies
> > and parents via debugfs is potentially damaging to the system if folks
> > don't know what they're doing. Emit a strong warning so that the message
> > is clear: don't enable this outside of development systems.
> >
> > Fixes: 37215da5553e ("clk: Add support for setting clk_rate via debugfs")
> > Cc: Geert Uytterhoeven <geert+renesas@glider.be>
> > Signed-off-by: Stephen Boyd <sboyd@kernel.org>
> 
> Thanks for your patch!
> 
> > --- a/drivers/clk/clk.c
> > +++ b/drivers/clk/clk.c
> > @@ -3383,6 +3383,24 @@ static int __init clk_debug_init(void)
> >  {
> >         struct clk_core *core;
> >
> > +#ifdef CLOCK_ALLOW_WRITE_DEBUGFS
> > +       pr_warn("\n");
> > +       pr_warn("********************************************************************\n");
> > +       pr_warn("**     NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE           **\n");
> > +       pr_warn("**                                                                **\n");
> > +       pr_warn("**  WRITEABLE clk DebugFS SUPPORT HAS BEEN ENABLED IN THIS KERNEL **\n");
> > +       pr_warn("**                                                                **\n");
> > +       pr_warn("** This means that this kernel is built to expose clk operations  **\n");
> > +       pr_warn("** such as parent or rate setting, enabling, disabling, etc.      **\n");
> > +       pr_warn("** to userspace, which may compromise security on your system.    **\n");
> > +       pr_warn("**                                                                **\n");
> > +       pr_warn("** If you see this message and you are not debugging the          **\n");
> > +       pr_warn("** kernel, report this immediately to your vendor!                **\n");
> > +       pr_warn("**                                                                **\n");
> > +       pr_warn("**     NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE           **\n");
> > +       pr_warn("********************************************************************\n");
> 
> So how many variants of such blocks do we have now in the kernel?
> 

Quite a few!

      reply	other threads:[~2021-12-10 23:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-10  1:42 [PATCH] clk: Emit a stern warning with writable debugfs enabled Stephen Boyd
2021-12-10  7:57 ` Geert Uytterhoeven
2021-12-10 23:12   ` Stephen Boyd [this message]

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=20211210231209.4E7EDC00446@smtp.kernel.org \
    --to=sboyd@kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.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