Linus Torvalds
5520d27f02
sparc: avoid stringop-overread errors
...
[ Upstream commit fc7c028dcdbfe981bca75d2a7b95f363eb691ef3 ]
The sparc mdesc code does pointer games with 'struct mdesc_hdr', but
didn't describe to the compiler how that header is then followed by the
data that the header describes.
As a result, gcc is now unhappy since it does stricter pointer range
tracking, and doesn't understand about how these things work. This
results in various errors like:
arch/sparc/kernel/mdesc.c: In function ‘mdesc_node_by_name’:
arch/sparc/kernel/mdesc.c:647:22: error: ‘strcmp’ reading 1 or more bytes from a region of size 0 [-Werror=stringop-overread]
647 | if (!strcmp(names + ep[ret].name_offset, name))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
which are easily avoided by just describing 'struct mdesc_hdr' better,
and making the node_block() helper function look into that unsized
data[] that follows the header.
This makes the sparc64 build happy again at least for my cross-compiler
version (gcc version 11.2.1).
Link: https://lore.kernel.org/lkml/CAHk-=wi4NW3NC0xWykkw=6LnjQD6D_rtRtxY9g8gQAJXtQMi8A@mail.gmail.com/
Cc: Guenter Roeck <linux@roeck-us.net >
Cc: David S. Miller <davem@davemloft.net >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2021-09-30 10:11:07 +02:00
..
2020-10-18 09:27:10 -07:00
2020-03-25 11:50:48 +01:00
2019-06-19 17:09:52 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2020-08-23 17:36:59 -05:00
2020-10-25 14:51:49 -07:00
2020-08-23 17:36:59 -05:00
2017-11-02 11:10:55 +01:00
2019-05-21 10:50:45 +02:00
2017-11-02 11:10:55 +01:00
2020-06-09 09:39:13 -07:00
2020-05-07 18:49:04 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2020-05-07 18:49:04 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-03-18 07:38:45 -07:00
2020-06-23 10:49:56 +02:00
2017-11-02 11:10:55 +01:00
2018-03-18 07:38:48 -07:00
2017-11-02 11:10:55 +01:00
2018-11-27 20:31:46 -05:00
2017-11-02 11:10:55 +01:00
2020-05-13 15:32:00 -07:00
2020-06-09 09:39:13 -07:00
2019-05-21 10:50:45 +02:00
2018-01-22 08:17:15 -08:00
2018-01-22 08:17:15 -08:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-12-06 06:56:40 -08:00
2020-09-03 18:12:15 +02:00
2020-10-06 07:07:03 +02:00
2021-09-30 10:11:06 +02:00
2017-11-02 11:10:55 +01:00
2018-11-18 13:35:21 -08:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-01-06 09:46:51 +09:00
2020-06-23 10:49:56 +02:00
2020-08-23 17:36:59 -05:00
2020-08-23 17:36:59 -05:00
2020-09-08 11:52:35 +02:00
2017-11-02 11:10:55 +01:00
2020-06-09 09:39:13 -07:00
2018-05-09 06:54:27 +02:00
2021-03-04 11:38:10 +01:00
2018-11-18 13:35:22 -08:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-05-22 07:54:06 -05:00
2020-11-24 16:47:35 +01:00
2020-08-07 11:33:26 -07:00
2020-06-23 10:49:56 +02:00
2021-09-30 10:11:07 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-05-21 10:50:45 +02:00
2018-11-18 13:35:22 -08:00
2018-11-18 13:35:22 -08:00
2020-04-02 18:11:55 -07:00
2017-11-02 11:10:55 +01:00
2018-05-22 07:54:06 -05:00
2019-03-05 21:07:14 -08:00
2018-02-15 15:07:30 -06:00
2018-05-22 07:54:06 -05:00
2017-11-02 11:10:55 +01:00
2018-11-18 13:35:21 -08:00
2019-03-05 21:07:14 -08:00
2017-11-02 11:10:55 +01:00
2020-10-06 07:07:03 +02:00
2017-11-02 11:10:55 +01:00
2020-06-09 09:39:13 -07:00
2018-05-22 07:54:06 -05:00
2020-08-23 17:36:59 -05:00
2019-06-02 22:16:33 -07:00
2017-11-02 11:10:55 +01:00
2018-11-18 13:35:20 -08:00
2020-11-24 16:47:35 +01:00
2020-11-24 16:47:35 +01:00
2020-08-20 13:12:58 +02:00
2020-08-23 17:36:59 -05:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2018-11-18 13:35:21 -08:00
2017-11-02 11:10:55 +01:00
2019-03-05 21:07:14 -08:00
2017-11-02 11:10:55 +01:00
2020-07-27 14:31:08 -04:00
2020-07-27 14:31:08 -04:00
2018-11-18 13:35:21 -08:00
2017-11-02 11:10:55 +01:00
2019-12-08 14:37:35 +01:00
2019-03-05 21:07:14 -08:00
2020-07-30 08:22:33 +02:00
2020-07-30 08:22:33 +02:00
2020-08-23 17:36:59 -05:00
2020-10-17 15:04:36 -06:00
2020-10-17 15:04:36 -06:00
2019-01-03 18:57:57 -08:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2021-07-14 16:55:50 +02:00
2021-07-14 16:55:50 +02:00
2016-08-07 23:55:43 -04:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-05-21 10:50:45 +02:00
2017-11-02 11:10:55 +01:00
2018-11-18 13:35:21 -08:00
2017-11-02 11:10:55 +01:00
2020-08-07 11:33:26 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-06-19 17:09:52 +02:00
2017-11-02 11:10:55 +01:00
2020-07-19 18:16:40 -07:00
2020-06-02 18:41:48 -07:00
2019-05-29 09:31:43 -05:00
2020-02-02 11:54:41 +01:00
2020-06-23 10:49:54 +02:00
2017-11-02 11:10:55 +01:00
2018-11-18 18:52:22 -08:00
2018-11-18 18:52:22 -08:00
2018-03-20 12:05:17 -04:00
2017-11-02 11:10:55 +01:00
2019-05-10 12:20:36 +02:00
2017-11-02 11:10:55 +01:00
2020-06-09 09:39:13 -07:00
2020-06-09 09:39:13 -07:00
2021-03-30 14:31:50 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-03-18 07:38:45 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-01-03 18:57:57 -08:00
2017-11-02 11:10:55 +01:00
2019-05-21 11:28:45 +02:00
2018-03-18 07:38:48 -07:00
2017-11-02 11:10:55 +01:00
2020-08-06 16:13:13 +02:00
2020-05-13 15:35:58 -07:00
2018-10-07 22:42:00 -07:00
2017-11-02 11:10:55 +01:00
2020-09-01 09:50:35 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00