Skip to contentSkip to conversation

linux-next: build warning after merge of the kspp-gustavo tree

DISCUSSION Stephen Rothwell 2 participants 4 messages Nov 21, 2023 Linux-next tree

lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the kspp-gustavo tree, today's linux-next build (x86_64 allmodconfig) produced this warning:

In file included from include/linux/string.h:295,

                 from include/linux/bitmap.h:12,
                 from include/linux/cpumask.h:12,
                 from arch/x86/include/asm/paravirt.h:17,
                 from arch/x86/include/asm/cpuid.h:62,
                 from arch/x86/include/asm/processor.h:19,
                 from arch/x86/include/asm/cpufeature.h:5,
                 from arch/x86/include/asm/thread_info.h:53,
                 from include/linux/thread_info.h:60,
                 from arch/x86/include/asm/preempt.h:9,
                 from include/linux/preempt.h:79,
                 from include/linux/spinlock.h:56,
                 from include/linux/mmzone.h:8,
                 from include/linux/gfp.h:7,
                 from include/linux/firmware.h:7,
                 from drivers/net/wireless/realtek/rtw89/core.h:10,
                 from drivers/net/wireless/realtek/rtw89/coex.h:8,
                 from drivers/net/wireless/realtek/rtw89/coex.c:5:
drivers/net/wireless/realtek/rtw89/coex.c: In function '_append_tdma':
include/linux/fortify-string.h:57:33: warning: writing 8 bytes into a region of size 0 [-Wstringop-overflow=]
   57 | #define __underlying_memcpy     __builtin_memcpy
      |                                 ^
include/linux/fortify-string.h:644:9: note: in expansion of macro '__underlying_memcpy'
  644 |         __underlying_##op(p, q, __fortify_size);                        \
      |         ^~~~~~~~~~~~~
include/linux/fortify-string.h:689:26: note: in expansion of macro '__fortify_memcpy_chk'
  689 | #define memcpy(p, q, s)  __fortify_memcpy_chk(p, q, s,                  \
      |                          ^~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/realtek/rtw89/coex.c:1585:17: note: in expansion of macro 'memcpy'
 1585 |                 memcpy(&v3->tdma, &dm->tdma, sizeof(v3->tdma));
      |                 ^~~~~~

drivers/net/wireless/realtek/rtw89/core.h:2703:37: note: at offset [5714, 71249] into destination object 'ver' of size 8
2703 | const struct rtw89_btc_ver *ver;
| ^~~
include/linux/fortify-string.h:57:33: warning: writing 8 bytes into a region of size 0 [-Wstringop-overflow=]

   57 | #define __underlying_memcpy     __builtin_memcpy
      |                                 ^
include/linux/fortify-string.h:644:9: note: in expansion of macro '__underlying_memcpy'
  644 |         __underlying_##op(p, q, __fortify_size);                        \
      |         ^~~~~~~~~~~~~
include/linux/fortify-string.h:689:26: note: in expansion of macro '__fortify_memcpy_chk'
  689 | #define memcpy(p, q, s)  __fortify_memcpy_chk(p, q, s,                  \
      |                          ^~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/realtek/rtw89/coex.c:1579:17: note: in expansion of macro 'memcpy'
 1579 |                 memcpy(v, &dm->tdma, sizeof(*v));
      |                 ^~~~~~

drivers/net/wireless/realtek/rtw89/core.h:2703:37: note: at offset [5710, 71245] into destination object 'ver' of size 8
2703 | const struct rtw89_btc_ver *ver;
| ^~~

Exposed by commit

1b56c90018f0 ("Makefile: Enable -Wstringop-overflow globally")

This is with your tree on top of Linus' tree (and some fix patches but nothing that obviously touches anything relevent) and CONFIG_WERROR not set.

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw
Quoted 55 lines · Stephen Rothwell

Hi all,

After merging the kspp-gustavo tree, today's linux-next build (x86_64 allmodconfig) produced this warning:

In file included from include/linux/string.h:295,

                  from include/linux/bitmap.h:12,
                  from include/linux/cpumask.h:12,
                  from arch/x86/include/asm/paravirt.h:17,
                  from arch/x86/include/asm/cpuid.h:62,
                  from arch/x86/include/asm/processor.h:19,
                  from arch/x86/include/asm/cpufeature.h:5,
                  from arch/x86/include/asm/thread_info.h:53,
                  from include/linux/thread_info.h:60,
                  from arch/x86/include/asm/preempt.h:9,
                  from include/linux/preempt.h:79,
                  from include/linux/spinlock.h:56,
                  from include/linux/mmzone.h:8,
                  from include/linux/gfp.h:7,
                  from include/linux/firmware.h:7,
                  from drivers/net/wireless/realtek/rtw89/core.h:10,
                  from drivers/net/wireless/realtek/rtw89/coex.h:8,
                  from drivers/net/wireless/realtek/rtw89/coex.c:5:
drivers/net/wireless/realtek/rtw89/coex.c: In function '_append_tdma':
include/linux/fortify-string.h:57:33: warning: writing 8 bytes into a region of size 0 [-Wstringop-overflow=]
    57 | #define __underlying_memcpy     __builtin_memcpy
       |                                 ^
include/linux/fortify-string.h:644:9: note: in expansion of macro '__underlying_memcpy'
   644 |         __underlying_##op(p, q, __fortify_size);                        \
       |         ^~~~~~~~~~~~~
include/linux/fortify-string.h:689:26: note: in expansion of macro '__fortify_memcpy_chk'
   689 | #define memcpy(p, q, s)  __fortify_memcpy_chk(p, q, s,                  \
       |                          ^~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/realtek/rtw89/coex.c:1585:17: note: in expansion of macro 'memcpy'
  1585 |                 memcpy(&v3->tdma, &dm->tdma, sizeof(v3->tdma));
       |                 ^~~~~~

drivers/net/wireless/realtek/rtw89/core.h:2703:37: note: at offset [5714, 71249] into destination object 'ver' of size 8
2703 | const struct rtw89_btc_ver *ver;
| ^~~
include/linux/fortify-string.h:57:33: warning: writing 8 bytes into a region of size 0 [-Wstringop-overflow=]

    57 | #define __underlying_memcpy     __builtin_memcpy
       |                                 ^
include/linux/fortify-string.h:644:9: note: in expansion of macro '__underlying_memcpy'
   644 |         __underlying_##op(p, q, __fortify_size);                        \
       |         ^~~~~~~~~~~~~
include/linux/fortify-string.h:689:26: note: in expansion of macro '__fortify_memcpy_chk'
   689 | #define memcpy(p, q, s)  __fortify_memcpy_chk(p, q, s,                  \
       |                          ^~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/realtek/rtw89/coex.c:1579:17: note: in expansion of macro 'memcpy'
  1579 |                 memcpy(v, &dm->tdma, sizeof(*v));
       |                 ^~~~~~

drivers/net/wireless/realtek/rtw89/core.h:2703:37: note: at offset [5710, 71245] into destination object 'ver' of size 8
2703 | const struct rtw89_btc_ver *ver;
| ^~~

Quoted 7 lines

Exposed by commit

   1b56c90018f0 ("Makefile: Enable -Wstringop-overflow globally")

This is with your tree on top of Linus' tree (and some fix patches but nothing that obviously touches anything relevent) and CONFIG_WERROR not set.

Stephen,

The fix for that shows up in linux-next already:

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=ca76817f4c4bbf8f98268772f4eeea8382a34bcd

Thanks for your help on this. :)
--
Gustavo

Quoted 1 line
#3 lore raw
Quoted 11 lines · Stephen Rothwell

Hi Gustavo,

Quoted 4 lines · On Tue, 21 Nov 2023 17:07:32 -0600 "Gustavo A. R. Silva"…

The fix for that shows up in linux-next already:

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=ca76817f4c4bbf8f98268772f4eeea8382a34bcd

OK, so if maintainers are putting fixes exposed by this change into their own trees, I need to merge your tree last then ...

Yep; that seems to be the right way to go. :)

Thank you!
--
Gustavo