Re: [GIT PULL] clk: renesas: Updates for v5.8

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Stephen,

On Tue, May 5, 2020 at 9:32 PM Stephen Boyd <sboyd@xxxxxxxxxx> 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@xxxxxxxxxxxxxx

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



[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux