* Re: Build regressions/improvements in v6.8-rc2
[not found] ` <20240129104954.1778339-1-geert@linux-m68k.org>
@ 2024-01-29 11:06 ` Geert Uytterhoeven
2024-01-29 14:58 ` Guenter Roeck
0 siblings, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2024-01-29 11:06 UTC (permalink / raw)
To: linux-kernel; +Cc: sparclinux, linux-parisc, linux-hwmon, intel-xe
On Mon, 29 Jan 2024, Geert Uytterhoeven wrote:
> JFYI, when comparing v6.8-rc2[1] to v6.8-rc1[3], the summaries are:
> - build errors: +26/-14
+ /kisskb/src/arch/sparc/kernel/setup_64.c: error: no previous prototype for 'alloc_irqstack_bootmem' [-Werror=missing-prototypes]: => 602:13
sparc64-gcc{5,1[123]}/sparc64-{allno,def}config
+ /kisskb/src/drivers/gpu/drm/nouveau/nvif/object.c: error: 'memcpy' specified bound between 4294967240 and 4294967263 exceeds maximum object size 2147483647 [-Werror=stringop-overflow=]: => 298:17
+ /kisskb/src/drivers/gpu/drm/nouveau/nvif/object.c: error: 'memcpy' specified bound between 4294967264 and 4294967287 exceeds maximum object size 2147483647 [-Werror=stringop-overflow=]: => 161:9
parisc-gcc1[23]/generic-32bit_defconfig
parisc-gcc1[23]/parisc-{allmod,def}config
+ /kisskb/src/drivers/hwmon/pc87360.c: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]: => 383:51
arm64-gcc12/arm64-allmodconfig
parisc-gcc12/parisc-allmodconfig
+ /kisskb/src/include/linux/compiler_types.h: error: call to '__compiletime_assert_1045' declared with attribute error: FIELD_GET: mask is not constant: => 435:38
+ /kisskb/src/include/linux/compiler_types.h: error: call to '__compiletime_assert_1065' declared with attribute error: FIELD_PREP: mask is not constant: => 435:38
+ /kisskb/src/include/linux/compiler_types.h: error: call to '__compiletime_assert_1084' declared with attribute error: FIELD_GET: mask is not constant: => 435:38
+ /kisskb/src/include/linux/compiler_types.h: error: call to '__compiletime_assert_1095' declared with attribute error: FIELD_GET: mask is not constant: => 435:38
+ /kisskb/src/include/linux/compiler_types.h: error: call to '__compiletime_assert_1137' declared with attribute error: FIELD_GET: mask is not constant: => 435:38
+ /kisskb/src/include/linux/compiler_types.h: error: call to '__compiletime_assert_1139' declared with attribute error: FIELD_GET: mask is not constant: => 435:38
+ /kisskb/src/include/linux/compiler_types.h: error: call to '__compiletime_assert_1148' declared with attribute error: FIELD_GET: mask is not constant: => 435:38
+ /kisskb/src/include/linux/compiler_types.h: error: call to '__compiletime_assert_1150' declared with attribute error: FIELD_GET: mask is not constant: => 435:38
+ /kisskb/src/include/linux/compiler_types.h: error: call to '__compiletime_assert_924' declared with attribute error: FIELD_GET: mask is not constant: => 435:38
+ /kisskb/src/include/linux/compiler_types.h: error: call to '__compiletime_assert_935' declared with attribute error: FIELD_GET: mask is not constant: => 435:38
in drivers/gpu/drm/xe/xe_guc_ct.c:526
arm64-gcc5/arm64-allmodconfig
powerpc-gcc5/powerpc-all{mod,yes}config
powerpc-gcc5/ppc{32,64le,64_book3e}_allmodconfig
(seen before in v6.8-rc1, with different assertion numbers)
+ /kisskb/src/include/linux/fortify-string.h: error: writing 16 bytes into a region of size 0 [-Werror=stringop-overflow=]: => 57:33
in drivers/gpu/drm/xe/xe_gt_pagefault.c:340
arm64-gcc13/arm64-allmodconfig
s390x-gcc13/s390-all{mod,yes}config
+ {standard input}: Error: displacement to undefined symbol .L101 overflows 8-bit field : => 593
+ {standard input}: Error: displacement to undefined symbol .L104 overflows 8-bit field : => 588
+ {standard input}: Error: displacement to undefined symbol .L139 overflows 8-bit field : => 606
+ {standard input}: Error: displacement to undefined symbol .L73 overflows 12-bit field: => 594
+ {standard input}: Error: displacement to undefined symbol .L74 overflows 8-bit field : => 585
+ {standard input}: Error: displacement to undefined symbol .L75 overflows 12-bit field: 606, 586 => 589, 606, 586
+ {standard input}: Error: displacement to undefined symbol .L76 overflows 8-bit field : 577 => 580, 577
+ {standard input}: Error: displacement to undefined symbol .L80 overflows 8-bit field : 601 => 601, 607
+ {standard input}: Error: displacement to undefined symbol .L81 overflows 8-bit field : 606, 604 => 604, 610, 606
+ {standard input}: Error: displacement to undefined symbol .L96 overflows 12-bit field: => 602
+ {standard input}: Error: displacement to undefined symbol .L99 overflows 12-bit field: => 607
The usual SH ICE crickets.
> [1] http://kisskb.ellerman.id.au/kisskb/branch/linus/head/41bccc98fb7931d63d03f326a746ac4d429c1dd3/ (all 239 configs)
> [3] http://kisskb.ellerman.id.au/kisskb/branch/linus/head/6613476e225e090cc9aad49be7fa504e290dd33d/ (all 239 configs)
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Build regressions/improvements in v6.8-rc2
2024-01-29 11:06 ` Build regressions/improvements in v6.8-rc2 Geert Uytterhoeven
@ 2024-01-29 14:58 ` Guenter Roeck
2024-01-30 7:49 ` Helge Deller
0 siblings, 1 reply; 5+ messages in thread
From: Guenter Roeck @ 2024-01-29 14:58 UTC (permalink / raw)
To: Geert Uytterhoeven, linux-kernel
Cc: sparclinux, linux-parisc, linux-hwmon, intel-xe
On 1/29/24 03:06, Geert Uytterhoeven wrote:
[ ... ]
> parisc-gcc1[23]/parisc-{allmod,def}config
>
> + /kisskb/src/drivers/hwmon/pc87360.c: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]: => 383:51
>
The "fix" for this problem would be similar to commit 4265eb062a73 ("hwmon: (pc87360)
Bounds check data->innr usage"). The change would be something like
- for (i = 0; i < data->tempnr; i++) {
+ for (i = 0; i < min(data->tempnr, ARRAY_SIZE(data->temp_max)); i++) {
but that would be purely random because the loop accesses several arrays
indexed with i, and tempnr is never >= ARRAY_SIZE(data->temp_max).
I kind of resist making such changes to the code just because the compiler
is clueless.
Are we sprinkling the kernel code with code like this to make the compiler happy ?
Guenter
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Build regressions/improvements in v6.8-rc2
2024-01-29 14:58 ` Guenter Roeck
@ 2024-01-30 7:49 ` Helge Deller
2024-01-30 8:02 ` Sam James
2024-01-30 16:38 ` Guenter Roeck
0 siblings, 2 replies; 5+ messages in thread
From: Helge Deller @ 2024-01-30 7:49 UTC (permalink / raw)
To: Guenter Roeck, Geert Uytterhoeven, linux-kernel
Cc: sparclinux, linux-parisc, linux-hwmon, intel-xe
On 1/29/24 15:58, Guenter Roeck wrote:
> On 1/29/24 03:06, Geert Uytterhoeven wrote:
> [ ... ]
>> parisc-gcc1[23]/parisc-{allmod,def}config
>>
>> + /kisskb/src/drivers/hwmon/pc87360.c: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]: => 383:51
>>
>
> The "fix" for this problem would be similar to commit 4265eb062a73 ("hwmon: (pc87360)
> Bounds check data->innr usage"). The change would be something like
>
> - for (i = 0; i < data->tempnr; i++) {
> + for (i = 0; i < min(data->tempnr, ARRAY_SIZE(data->temp_max)); i++) {
>
> but that would be purely random because the loop accesses several arrays
> indexed with i, and tempnr is never >= ARRAY_SIZE(data->temp_max).
> I kind of resist making such changes to the code just because the compiler
> is clueless.
I agree with your analysis.
But I'm wondering why this warning just seem to appear on parisc.
I would expect gcc on other platforms to complain as well ?!?
Helge
> Are we sprinkling the kernel code with code like this to make the compiler happy ?
>
> Guenter
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Build regressions/improvements in v6.8-rc2
2024-01-30 7:49 ` Helge Deller
@ 2024-01-30 8:02 ` Sam James
2024-01-30 16:38 ` Guenter Roeck
1 sibling, 0 replies; 5+ messages in thread
From: Sam James @ 2024-01-30 8:02 UTC (permalink / raw)
To: Helge Deller
Cc: Guenter Roeck, Geert Uytterhoeven, linux-kernel, sparclinux,
linux-parisc, linux-hwmon, intel-xe,
linux-hardening@vger.kernel.org
Helge Deller <deller@gmx.de> writes:
> On 1/29/24 15:58, Guenter Roeck wrote:
>> On 1/29/24 03:06, Geert Uytterhoeven wrote:
>> [ ... ]
>>> parisc-gcc1[23]/parisc-{allmod,def}config
>>>
>>> + /kisskb/src/drivers/hwmon/pc87360.c: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]: => 383:51
>>>
>>
>> The "fix" for this problem would be similar to commit 4265eb062a73 ("hwmon: (pc87360)
>> Bounds check data->innr usage"). The change would be something like
>>
>> - for (i = 0; i < data->tempnr; i++) {
>> + for (i = 0; i < min(data->tempnr, ARRAY_SIZE(data->temp_max)); i++) {
>>
>> but that would be purely random because the loop accesses several arrays
>> indexed with i, and tempnr is never >= ARRAY_SIZE(data->temp_max).
>> I kind of resist making such changes to the code just because the compiler
>> is clueless.
>
> I agree with your analysis.
> But I'm wondering why this warning just seem to appear on parisc.
> I would expect gcc on other platforms to complain as well ?!?
-Wstringop-overflow and -Wstringop-truncation are known noisy warnings
because they're implemented in GCC's "middle-end". Whether or not they
fire depends on other optimisations.
See also https://lore.kernel.org/linux-hardening/CAHk-=wjG4jdE19-vWWhAX3ByfbNr4DJS-pwiN9oY38WkhMZ57g@mail.gmail.com/.
>
> Helge
>
>> Are we sprinkling the kernel code with code like this to make the compiler happy ?
>>
>> Guenter
>>
>>
thanks,
sam
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Build regressions/improvements in v6.8-rc2
2024-01-30 7:49 ` Helge Deller
2024-01-30 8:02 ` Sam James
@ 2024-01-30 16:38 ` Guenter Roeck
1 sibling, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2024-01-30 16:38 UTC (permalink / raw)
To: Helge Deller, Geert Uytterhoeven, linux-kernel
Cc: sparclinux, linux-parisc, linux-hwmon, intel-xe
On 1/29/24 23:49, Helge Deller wrote:
> On 1/29/24 15:58, Guenter Roeck wrote:
>> On 1/29/24 03:06, Geert Uytterhoeven wrote:
>> [ ... ]
>>> parisc-gcc1[23]/parisc-{allmod,def}config
>>>
>>> + /kisskb/src/drivers/hwmon/pc87360.c: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]: => 383:51
>>>
>>
>> The "fix" for this problem would be similar to commit 4265eb062a73 ("hwmon: (pc87360)
>> Bounds check data->innr usage"). The change would be something like
>>
>> - for (i = 0; i < data->tempnr; i++) {
>> + for (i = 0; i < min(data->tempnr, ARRAY_SIZE(data->temp_max)); i++) {
>>
>> but that would be purely random because the loop accesses several arrays
>> indexed with i, and tempnr is never >= ARRAY_SIZE(data->temp_max).
>> I kind of resist making such changes to the code just because the compiler
>> is clueless.
>
> I agree with your analysis.
> But I'm wondering why this warning just seem to appear on parisc.
> I would expect gcc on other platforms to complain as well ?!?
>
I have seen that problem before, where specifically gcc for x86 doesn't even
generate warnings for really problematic code but gcc for other architectures
does. I never found out what causes this. Don't ask me for examples, I didn't
write it down, forgot specifics, and just accepted it as "one of those things".
Guenter
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-01-30 16:38 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CAHk-=wgxzm+Oc1ywuNGxb1R1=ZEC85LJi776R2QEpk6=_2Qfdw@mail.gmail.com>
[not found] ` <20240129104954.1778339-1-geert@linux-m68k.org>
2024-01-29 11:06 ` Build regressions/improvements in v6.8-rc2 Geert Uytterhoeven
2024-01-29 14:58 ` Guenter Roeck
2024-01-30 7:49 ` Helge Deller
2024-01-30 8:02 ` Sam James
2024-01-30 16:38 ` Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox