linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* Re: [REGRESSION] stable-rc/linux-6.12.y: (build) variable 'val' is uninitialized when passed as a const pointer arg...
       [not found] <176398914850.89.13888454130518102455@f771fd7c9232>
@ 2025-11-24 22:04 ` Nathan Chancellor
  2025-11-24 22:35   ` Guenter Roeck
  0 siblings, 1 reply; 7+ messages in thread
From: Nathan Chancellor @ 2025-11-24 22:04 UTC (permalink / raw)
  To: kernelci; +Cc: kernelci-results, gus, stable, Greg Kroah-Hartman, linux-staging

On Mon, Nov 24, 2025 at 12:59:08PM -0000, KernelCI bot wrote:
> Hello,
> 
> New build issue found on stable-rc/linux-6.12.y:
> 
> ---
>  variable 'val' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] in drivers/staging/rtl8712/rtl8712_cmd.o (drivers/staging/rtl8712/rtl8712_cmd.c) [logspec:kbuild,kbuild.compiler.error]
> ---
> 
> - dashboard: https://d.kernelci.org/i/maestro:5b83acc62508c670164c5fceb3079a2d7d74e154
> - giturl: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
> - commit HEAD:  d5dc97879a97b328a89ec092271faa3db9f2bff3
> - tags: v6.12.59
> 
> 
> Log excerpt:
> =====================================================
> drivers/staging/rtl8712/rtl8712_cmd.c:148:28: error: variable 'val' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer]
>   148 |                 memcpy(pcmd->rsp, (u8 *)&val, pcmd->rspsz);
>       |                                          ^~~
> 1 error generated.

This comes from a new subwarning of -Wuninitialized introduced in
clang-21:

  https://github.com/llvm/llvm-project/commit/00dacf8c22f065cb52efb14cd091d441f19b319e

This driver was removed upstream in commit 41e883c137eb ("staging:
rtl8712: Remove driver using deprecated API wext") in 6.13 so this only
impacts stable.

This certainly does look broken...

  static u8 read_rfreg_hdl(struct _adapter *padapter, u8 *pbuf)
  {
      u32 val;
      void (*pcmd_callback)(struct _adapter *dev, struct cmd_obj *pcmd);
      struct cmd_obj *pcmd  = (struct cmd_obj *)pbuf;

      if (pcmd->rsp && pcmd->rspsz > 0)
          memcpy(pcmd->rsp, (u8 *)&val, pcmd->rspsz);

Presumably this is never actually hit? It is rather hard to follow the
indirection in this driver but it does not seem like _Read_RFREG is ever
set as a cmdcode? Unfortunately, the only maintainer I see listed for
this file is Florian Schilhabel but a glance at lore shows no recent
activity so that probably won't be too much help. At the very least, we
could just zero initialize val, it cannot be any worse than what it is
currently doing and copying stack garbage?

Cheers,
Nathan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [REGRESSION] stable-rc/linux-6.12.y: (build) variable 'val' is uninitialized when passed as a const pointer arg...
  2025-11-24 22:04 ` [REGRESSION] stable-rc/linux-6.12.y: (build) variable 'val' is uninitialized when passed as a const pointer arg Nathan Chancellor
@ 2025-11-24 22:35   ` Guenter Roeck
  2025-11-24 22:40     ` Nathan Chancellor
  0 siblings, 1 reply; 7+ messages in thread
From: Guenter Roeck @ 2025-11-24 22:35 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: kernelci, kernelci-results, gus, stable, Greg Kroah-Hartman,
	linux-staging

On Mon, Nov 24, 2025 at 2:04 PM Nathan Chancellor <nathan@kernel.org> wrote:
>
> On Mon, Nov 24, 2025 at 12:59:08PM -0000, KernelCI bot wrote:
> > Hello,
> >
> > New build issue found on stable-rc/linux-6.12.y:
> >
> > ---
> >  variable 'val' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] in drivers/staging/rtl8712/rtl8712_cmd.o (drivers/staging/rtl8712/rtl8712_cmd.c) [logspec:kbuild,kbuild.compiler.error]
> > ---
> >
> > - dashboard: https://d.kernelci.org/i/maestro:5b83acc62508c670164c5fceb3079a2d7d74e154
> > - giturl: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
> > - commit HEAD:  d5dc97879a97b328a89ec092271faa3db9f2bff3
> > - tags: v6.12.59
> >
> >
> > Log excerpt:
> > =====================================================
> > drivers/staging/rtl8712/rtl8712_cmd.c:148:28: error: variable 'val' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer]
> >   148 |                 memcpy(pcmd->rsp, (u8 *)&val, pcmd->rspsz);
> >       |                                          ^~~
> > 1 error generated.
>
> This comes from a new subwarning of -Wuninitialized introduced in
> clang-21:
>
>   https://github.com/llvm/llvm-project/commit/00dacf8c22f065cb52efb14cd091d441f19b319e
>
> This driver was removed upstream in commit 41e883c137eb ("staging:
> rtl8712: Remove driver using deprecated API wext") in 6.13 so this only
> impacts stable.
>
> This certainly does look broken...
>
>   static u8 read_rfreg_hdl(struct _adapter *padapter, u8 *pbuf)
>   {
>       u32 val;
>       void (*pcmd_callback)(struct _adapter *dev, struct cmd_obj *pcmd);
>       struct cmd_obj *pcmd  = (struct cmd_obj *)pbuf;
>
>       if (pcmd->rsp && pcmd->rspsz > 0)
>           memcpy(pcmd->rsp, (u8 *)&val, pcmd->rspsz);
>
> Presumably this is never actually hit? It is rather hard to follow the
> indirection in this driver but it does not seem like _Read_RFREG is ever
> set as a cmdcode? Unfortunately, the only maintainer I see listed for
> this file is Florian Schilhabel but a glance at lore shows no recent
> activity so that probably won't be too much help. At the very least, we
> could just zero initialize val, it cannot be any worse than what it is
> currently doing and copying stack garbage?
>

Or backport the patch removing the driver ? It is in staging, after
all, so I don't know if there is value in trying to keep it alive in
6.12.y.

Guenter

> Cheers,
> Nathan
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [REGRESSION] stable-rc/linux-6.12.y: (build) variable 'val' is uninitialized when passed as a const pointer arg...
  2025-11-24 22:35   ` Guenter Roeck
@ 2025-11-24 22:40     ` Nathan Chancellor
  2025-11-27 13:22       ` Greg Kroah-Hartman
  0 siblings, 1 reply; 7+ messages in thread
From: Nathan Chancellor @ 2025-11-24 22:40 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: kernelci, kernelci-results, gus, stable, Greg Kroah-Hartman,
	linux-staging

On Mon, Nov 24, 2025 at 02:35:26PM -0800, Guenter Roeck wrote:
> On Mon, Nov 24, 2025 at 2:04 PM Nathan Chancellor <nathan@kernel.org> wrote:
> >
> > On Mon, Nov 24, 2025 at 12:59:08PM -0000, KernelCI bot wrote:
> > > Hello,
> > >
> > > New build issue found on stable-rc/linux-6.12.y:
> > >
> > > ---
> > >  variable 'val' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] in drivers/staging/rtl8712/rtl8712_cmd.o (drivers/staging/rtl8712/rtl8712_cmd.c) [logspec:kbuild,kbuild.compiler.error]
> > > ---
> > >
> > > - dashboard: https://d.kernelci.org/i/maestro:5b83acc62508c670164c5fceb3079a2d7d74e154
> > > - giturl: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
> > > - commit HEAD:  d5dc97879a97b328a89ec092271faa3db9f2bff3
> > > - tags: v6.12.59
> > >
> > >
> > > Log excerpt:
> > > =====================================================
> > > drivers/staging/rtl8712/rtl8712_cmd.c:148:28: error: variable 'val' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer]
> > >   148 |                 memcpy(pcmd->rsp, (u8 *)&val, pcmd->rspsz);
> > >       |                                          ^~~
> > > 1 error generated.
> >
> > This comes from a new subwarning of -Wuninitialized introduced in
> > clang-21:
> >
> >   https://github.com/llvm/llvm-project/commit/00dacf8c22f065cb52efb14cd091d441f19b319e
> >
> > This driver was removed upstream in commit 41e883c137eb ("staging:
> > rtl8712: Remove driver using deprecated API wext") in 6.13 so this only
> > impacts stable.
> >
> > This certainly does look broken...
> >
> >   static u8 read_rfreg_hdl(struct _adapter *padapter, u8 *pbuf)
> >   {
> >       u32 val;
> >       void (*pcmd_callback)(struct _adapter *dev, struct cmd_obj *pcmd);
> >       struct cmd_obj *pcmd  = (struct cmd_obj *)pbuf;
> >
> >       if (pcmd->rsp && pcmd->rspsz > 0)
> >           memcpy(pcmd->rsp, (u8 *)&val, pcmd->rspsz);
> >
> > Presumably this is never actually hit? It is rather hard to follow the
> > indirection in this driver but it does not seem like _Read_RFREG is ever
> > set as a cmdcode? Unfortunately, the only maintainer I see listed for
> > this file is Florian Schilhabel but a glance at lore shows no recent
> > activity so that probably won't be too much help. At the very least, we
> > could just zero initialize val, it cannot be any worse than what it is
> > currently doing and copying stack garbage?
> >
> 
> Or backport the patch removing the driver ? It is in staging, after
> all, so I don't know if there is value in trying to keep it alive in
> 6.12.y.

That would likely not be the end of the world for 6.12.y but this
warning appears all the way back to at least 5.15 (the point I start
caring about warnings because of CONFIG_WERROR).

Cheers,
Nathan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [REGRESSION] stable-rc/linux-6.12.y: (build) variable 'val' is uninitialized when passed as a const pointer arg...
  2025-11-24 22:40     ` Nathan Chancellor
@ 2025-11-27 13:22       ` Greg Kroah-Hartman
  2025-12-04  0:43         ` Nathan Chancellor
  0 siblings, 1 reply; 7+ messages in thread
From: Greg Kroah-Hartman @ 2025-11-27 13:22 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Guenter Roeck, kernelci, kernelci-results, gus, stable,
	linux-staging

On Mon, Nov 24, 2025 at 03:40:46PM -0700, Nathan Chancellor wrote:
> On Mon, Nov 24, 2025 at 02:35:26PM -0800, Guenter Roeck wrote:
> > On Mon, Nov 24, 2025 at 2:04 PM Nathan Chancellor <nathan@kernel.org> wrote:
> > >
> > > On Mon, Nov 24, 2025 at 12:59:08PM -0000, KernelCI bot wrote:
> > > > Hello,
> > > >
> > > > New build issue found on stable-rc/linux-6.12.y:
> > > >
> > > > ---
> > > >  variable 'val' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] in drivers/staging/rtl8712/rtl8712_cmd.o (drivers/staging/rtl8712/rtl8712_cmd.c) [logspec:kbuild,kbuild.compiler.error]
> > > > ---
> > > >
> > > > - dashboard: https://d.kernelci.org/i/maestro:5b83acc62508c670164c5fceb3079a2d7d74e154
> > > > - giturl: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
> > > > - commit HEAD:  d5dc97879a97b328a89ec092271faa3db9f2bff3
> > > > - tags: v6.12.59
> > > >
> > > >
> > > > Log excerpt:
> > > > =====================================================
> > > > drivers/staging/rtl8712/rtl8712_cmd.c:148:28: error: variable 'val' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer]
> > > >   148 |                 memcpy(pcmd->rsp, (u8 *)&val, pcmd->rspsz);
> > > >       |                                          ^~~
> > > > 1 error generated.
> > >
> > > This comes from a new subwarning of -Wuninitialized introduced in
> > > clang-21:
> > >
> > >   https://github.com/llvm/llvm-project/commit/00dacf8c22f065cb52efb14cd091d441f19b319e
> > >
> > > This driver was removed upstream in commit 41e883c137eb ("staging:
> > > rtl8712: Remove driver using deprecated API wext") in 6.13 so this only
> > > impacts stable.
> > >
> > > This certainly does look broken...
> > >
> > >   static u8 read_rfreg_hdl(struct _adapter *padapter, u8 *pbuf)
> > >   {
> > >       u32 val;
> > >       void (*pcmd_callback)(struct _adapter *dev, struct cmd_obj *pcmd);
> > >       struct cmd_obj *pcmd  = (struct cmd_obj *)pbuf;
> > >
> > >       if (pcmd->rsp && pcmd->rspsz > 0)
> > >           memcpy(pcmd->rsp, (u8 *)&val, pcmd->rspsz);
> > >
> > > Presumably this is never actually hit? It is rather hard to follow the
> > > indirection in this driver but it does not seem like _Read_RFREG is ever
> > > set as a cmdcode? Unfortunately, the only maintainer I see listed for
> > > this file is Florian Schilhabel but a glance at lore shows no recent
> > > activity so that probably won't be too much help. At the very least, we
> > > could just zero initialize val, it cannot be any worse than what it is
> > > currently doing and copying stack garbage?
> > >
> > 
> > Or backport the patch removing the driver ? It is in staging, after
> > all, so I don't know if there is value in trying to keep it alive in
> > 6.12.y.
> 
> That would likely not be the end of the world for 6.12.y but this
> warning appears all the way back to at least 5.15 (the point I start
> caring about warnings because of CONFIG_WERROR).

No objection from me to delete the driver from all of the stable trees :)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [REGRESSION] stable-rc/linux-6.12.y: (build) variable 'val' is uninitialized when passed as a const pointer arg...
  2025-11-27 13:22       ` Greg Kroah-Hartman
@ 2025-12-04  0:43         ` Nathan Chancellor
  2025-12-04  1:03           ` Guenter Roeck
  0 siblings, 1 reply; 7+ messages in thread
From: Nathan Chancellor @ 2025-12-04  0:43 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Guenter Roeck, kernelci, kernelci-results, gus, stable,
	linux-staging

On Thu, Nov 27, 2025 at 02:22:46PM +0100, Greg Kroah-Hartman wrote:
> No objection from me to delete the driver from all of the stable trees :)

Sounds rather nuclear for the issue at hand :) but I can send the
backports for that change and we can see who complains before trying a
more localized (even if wrong) fix.

Cheers,
Nathan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [REGRESSION] stable-rc/linux-6.12.y: (build) variable 'val' is uninitialized when passed as a const pointer arg...
  2025-12-04  0:43         ` Nathan Chancellor
@ 2025-12-04  1:03           ` Guenter Roeck
  2025-12-04  2:16             ` Nathan Chancellor
  0 siblings, 1 reply; 7+ messages in thread
From: Guenter Roeck @ 2025-12-04  1:03 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Greg Kroah-Hartman, kernelci, kernelci-results, gus, stable,
	linux-staging

On Wed, Dec 3, 2025 at 4:43 PM Nathan Chancellor <nathan@kernel.org> wrote:
>
> On Thu, Nov 27, 2025 at 02:22:46PM +0100, Greg Kroah-Hartman wrote:
> > No objection from me to delete the driver from all of the stable trees :)
>
> Sounds rather nuclear for the issue at hand :) but I can send the
> backports for that change and we can see who complains before trying a
> more localized (even if wrong) fix.
>

Already done (and queued for the next stable releases). Sorry, I
wanted to copy you but ended up copying myself.

Guenter

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [REGRESSION] stable-rc/linux-6.12.y: (build) variable 'val' is uninitialized when passed as a const pointer arg...
  2025-12-04  1:03           ` Guenter Roeck
@ 2025-12-04  2:16             ` Nathan Chancellor
  0 siblings, 0 replies; 7+ messages in thread
From: Nathan Chancellor @ 2025-12-04  2:16 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Greg Kroah-Hartman, kernelci, kernelci-results, gus, stable,
	linux-staging

On Wed, Dec 03, 2025 at 05:03:24PM -0800, Guenter Roeck wrote:
> On Wed, Dec 3, 2025 at 4:43 PM Nathan Chancellor <nathan@kernel.org> wrote:
> >
> > On Thu, Nov 27, 2025 at 02:22:46PM +0100, Greg Kroah-Hartman wrote:
> > > No objection from me to delete the driver from all of the stable trees :)
> >
> > Sounds rather nuclear for the issue at hand :) but I can send the
> > backports for that change and we can see who complains before trying a
> > more localized (even if wrong) fix.
> >
> 
> Already done (and queued for the next stable releases). Sorry, I
> wanted to copy you but ended up copying myself.

Ah great, one less thing for me to do :)

Cheers,
Nathan

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-12-04  2:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <176398914850.89.13888454130518102455@f771fd7c9232>
2025-11-24 22:04 ` [REGRESSION] stable-rc/linux-6.12.y: (build) variable 'val' is uninitialized when passed as a const pointer arg Nathan Chancellor
2025-11-24 22:35   ` Guenter Roeck
2025-11-24 22:40     ` Nathan Chancellor
2025-11-27 13:22       ` Greg Kroah-Hartman
2025-12-04  0:43         ` Nathan Chancellor
2025-12-04  1:03           ` Guenter Roeck
2025-12-04  2:16             ` Nathan Chancellor

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).