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]
Message-ID: <CAPDyKFqgsHYz1hfOQ=KniNJj+u7ZSMoxS03Rixj1n2AOUdSVaQ@mail.gmail.com>
Date:   Tue, 26 Sep 2023 13:22:13 +0200
From:   Ulf Hansson <ulf.hansson@...aro.org>
To:     Geert Uytterhoeven <geert@...ux-m68k.org>
Cc:     Justin Stitt <justinstitt@...gle.com>,
        Magnus Damm <magnus.damm@...il.com>,
        Nathan Chancellor <nathan@...nel.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Tom Rix <trix@...hat.com>, linux-renesas-soc@...r.kernel.org,
        linux-kernel@...r.kernel.org, llvm@...ts.linux.dev,
        Linux PM list <linux-pm@...r.kernel.org>
Subject: Re: [PATCH] soc: renesas: rmobile-sysc: fix -Wvoid-pointer-to-enum-cast
 warning

On Mon, 18 Sept 2023 at 11:21, Geert Uytterhoeven <geert@...ux-m68k.org> wrote:
>
> Hi Ulf,
>
> On Wed, Aug 30, 2023 at 10:24 AM Geert Uytterhoeven
> <geert@...ux-m68k.org> wrote:
> > On Tue, Aug 15, 2023 at 12:11 AM Justin Stitt <justinstitt@...gle.com> wrote:
> > > When building with clang 18 I see the following warning:
> > > |      drivers/soc/renesas/rmobile-sysc.c:193:22: warning: cast to smaller integer
> > > |               type 'enum pd_types' from 'const void *' [-Wvoid-pointer-to-enum-cast]
> > > |        193 |                 add_special_pd(np, (enum pd_types)id->data);
> > >
> > > This is due to the fact that `id->data` is a void* and `enum pd_types`
> > > has the size of an integer. This cast from pointer-width to int-width
> > > causes truncation and possible data loss. Instead, cast to `uintptr_t`
> > > which has the same width as void*.
> > >
> > > Link: https://github.com/ClangBuiltLinux/linux/issues/1910
> > > Reported-by: Nathan Chancellor <nathan@...nel.org>
> >
> > scripts/checkpatch.pl:
> >
> >     WARNING: Reported-by: should be immediately followed by Closes:
> > with a URL to the report
> >
> > Hence changing the Link: tag to a Closes: tag.
> >
> > > Signed-off-by: Justin Stitt <justinstitt@...gle.com>
> > > ---
> > > Note: It should be noted that there is likely no data loss occurring in
> > > this case since the enum only has a few fields. The narrowing cast from
> > > pointer to int will not lose any data.
> >
> > Indeed, the theoretical narrowing could only happen on a 64-bit
> > platform, while this driver is only used on arm32.
> >
> > Reviewed-by: Geert Uytterhoeven <geert+renesas@...der.be>
> > i.e. will queue in renesas-devel for v6.7.
>
> As the Generic PM Domain providers were moved to drivers/pmdomain/
> in v6.6-rc2, and now have their own maintainer, I have moved this
> commit from renesas-drivers-for-v6.7 to renesas-pmdomain-for-v6.7[1],
> with s/soc/pmdomain/ in the oneline-summary.
>
> Ulf: if you prefer, you can still take this patch directly.
> Else I will send a PR after rc3 and/or rc5, like I do with my other
> renesas-<foo>-for-<version> branches.
> Thanks!

Apologize for the delay, been traveling lately. Anyway, I can
certainly pick up the patch and carry it for v6.7. Just let me know,
if/when you have dropped the patch from your tree.

[...]

Kind regards
Uffe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ