From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Stephen Boyd <sboyd@kernel.org>
Cc: Michael Turquette <mturquette@baylibre.com>,
linux-clk <linux-clk@vger.kernel.org>,
Linux-Renesas <linux-renesas-soc@vger.kernel.org>
Subject: Re: [GIT PULL] clk: renesas: Updates for v5.8
Date: Wed, 6 May 2020 09:35:18 +0200 [thread overview]
Message-ID: <CAMuHMdWOnYVaeTFgUbg+CmB5U9NCZUraC7+MQYyn4T7ScMqzTQ@mail.gmail.com> (raw)
In-Reply-To: <158870715221.26370.13261608407586100210@swboyd.mtv.corp.google.com>
Hi Stephen,
On Tue, May 5, 2020 at 9:32 PM Stephen Boyd <sboyd@kernel.org> wrote:
> Quoting Geert Uytterhoeven (2020-04-30 01:49:02)
> > The following changes since commit 8f3d9f354286745c751374f5f1fcafee6b3f3136:
> >
> > Linux 5.7-rc1 (2020-04-12 12:35:55 -0700)
> >
> > are available in the Git repository at:
> >
> > git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git tags/clk-renesas-for-v5.8-tag1
> >
> > for you to fetch changes up to e2f022c10ed3b50ba1d2bb1f037b0e7a84cb1c3e:
> >
> > clk: renesas: rcar-gen2: Remove superfluous CLK_RENESAS_DIV6 selects (2020-04-30 09:39:06 +0200)
> >
> > ----------------------------------------------------------------
>
> Thanks. Pulled into clk-next
Thanks!
> I see these warnings with smatch. Is it a real problem?
>
> drivers/clk/renesas/renesas-cpg-mssr.c:851
> cpg_mssr_resume_noirq() error: buffer overflow 'stbcr' 11 <= 11
> drivers/clk/renesas/renesas-cpg-mssr.c:860
> cpg_mssr_resume_noirq() error: buffer overflow 'stbcr' 11 <= 11
> clk/renesas/renesas-cpg-mssr.c:862
> cpg_mssr_resume_noirq() error: buffer overflow 'stbcr' 11 <= 11
Hmm, just installed smatch, and gave it a try, but I don't see that error:
$ make C=1 CHECK="smatch -p=kernel" drivers/clk/renesas/renesas-cpg-mssr.o
...
CHECK drivers/clk/renesas/renesas-cpg-mssr.c
drivers/clk/renesas/renesas-cpg-mssr.c:378
cpg_mssr_register_core_clk() warn: passing zero to 'PTR_ERR'
(that one is harmless)
The buffer overflows can't really happen: cpg_mssr_resume_noirq() indeed
restores up to 12 registers, while there are only 11 STBCRs, but the
check below makes sure any unused registers are not restored:
mask = priv->smstpcr_saved[reg].mask;
if (!mask)
continue;
However, unlike cpg_mssr_resume_noirq(), cpg_mssr_suspend_noirq() does
not take into account systems with STBCRs instead of MSTPCRs, which is a
real bug. But even that bug cannot happen, as the suspend/resume code
is used on PSCI systems only, and systems with STBCRs (RZ/A1 and RZ/A2)
do not use PSCI.
I will fix the bug, to prevent us getting bitten on future systems.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
prev parent reply other threads:[~2020-05-06 7:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-30 8:49 [GIT PULL] clk: renesas: Updates for v5.8 Geert Uytterhoeven
2020-05-05 19:32 ` Stephen Boyd
2020-05-06 7:35 ` Geert Uytterhoeven [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=CAMuHMdWOnYVaeTFgUbg+CmB5U9NCZUraC7+MQYyn4T7ScMqzTQ@mail.gmail.com \
--to=geert@linux-m68k.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=sboyd@kernel.org \
/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).