Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix -Wstringop-overflow warnings in drivers/net/wireless/realtek/rtw89/coex.c #311

Open
GustavoARSilva opened this issue Jun 13, 2023 · 0 comments
Assignees
Labels
-Wstringop-overflow Emits warnings under -Wstringop-overflow

Comments

@GustavoARSilva
Copy link
Collaborator

Found in x86_64

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:648:9: note: in expansion of macro '__underlying_memcpy'
  648 |         __underlying_##op(p, q, __fortify_size);                        \
      |         ^~~~~~~~~~~~~
include/linux/fortify-string.h:693:26: note: in expansion of macro '__fortify_memcpy_chk'
  693 | #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:2428:37: note: at offset [5714, 71249] into destination object 'ver' of size 8
 2428 |         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:648:9: note: in expansion of macro '__underlying_memcpy'
  648 |         __underlying_##op(p, q, __fortify_size);                        \
      |         ^~~~~~~~~~~~~
include/linux/fortify-string.h:693:26: note: in expansion of macro '__fortify_memcpy_chk'
  693 | #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:2428:37: note: at offset [5710, 71245] into destination object 'ver' of size 8
 2428 |         const struct rtw89_btc_ver *ver;
      |                                     ^~~
@kees kees added the -Wstringop-overflow Emits warnings under -Wstringop-overflow label Jun 14, 2023
@GustavoARSilva GustavoARSilva self-assigned this Jun 15, 2023
@GustavoARSilva GustavoARSilva reopened this Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-Wstringop-overflow Emits warnings under -Wstringop-overflow
Projects
None yet
Development

No branches or pull requests

2 participants