public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Warnings whilst building 5.2.0+
@ 2019-07-09  6:06 Chris Clayton
  2019-07-09 10:37 ` Enrico Weigelt, metux IT consult
  0 siblings, 1 reply; 5+ messages in thread
From: Chris Clayton @ 2019-07-09  6:06 UTC (permalink / raw)
  To: LKML

Hi,

I've pulled Linus' tree this morning and, after running 'make oldconfig', tried a build. During that build I got the
following warnings, which look to me like they should be fixed. 'git describe' shows v5.2-915-g5ad18b2e60b7 and my
compiler is the 20190706 snapshot of gcc 9.

In file included from arch/x86/kernel/head64.c:35:
In function 'sanitize_boot_params',
    inlined from 'copy_bootdata' at arch/x86/kernel/head64.c:391:2:
./arch/x86/include/asm/bootparam_utils.h:40:3: warning: 'memset' offset [197, 448] from the object at 'boot_params' is
out of the bounds of referenced subobject 'ext_ramdisk_image' with type 'unsigned int' at offset 192 [-Warray-bounds]
   40 |   memset(&boot_params->ext_ramdisk_image, 0,
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   41 |          (char *)&boot_params->efi_info -
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   42 |    (char *)&boot_params->ext_ramdisk_image);
      |    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./arch/x86/include/asm/bootparam_utils.h:43:3: warning: 'memset' offset [493, 497] from the object at 'boot_params' is
out of the bounds of referenced subobject 'kbd_status' with type 'unsigned char' at offset 491 [-Warray-bounds]
   43 |   memset(&boot_params->kbd_status, 0,
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   44 |          (char *)&boot_params->hdr -
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~
   45 |          (char *)&boot_params->kbd_status);
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Happy to test any patches, but please cc me as I'm not subscribed to LKML.

Chris

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

* Re: Warnings whilst building 5.2.0+
  2019-07-09  6:06 Warnings whilst building 5.2.0+ Chris Clayton
@ 2019-07-09 10:37 ` Enrico Weigelt, metux IT consult
  2019-07-09 11:39   ` Chris Clayton
  0 siblings, 1 reply; 5+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-07-09 10:37 UTC (permalink / raw)
  To: Chris Clayton, LKML

On 09.07.19 08:06, Chris Clayton wrote:

Hi,

> I've pulled Linus' tree this morning and, after running 'make oldconfig', tried a build. During that build I got the
> following warnings, which look to me like they should be fixed. 'git describe' shows v5.2-915-g5ad18b2e60b7 and my
> compiler is the 20190706 snapshot of gcc 9.

Thanks for the report. I'm rebuilding right know anyways, so I'll look
out for it.

> In file included from arch/x86/kernel/head64.c:35:
> In function 'sanitize_boot_params',
>     inlined from 'copy_bootdata' at arch/x86/kernel/head64.c:391:2:
> ./arch/x86/include/asm/bootparam_utils.h:40:3: warning: 'memset' offset [197, 448] from the object at 'boot_params' is
> out of the bounds of referenced subobject 'ext_ramdisk_image' with type 'unsigned int' at offset 192 [-Warray-bounds]
>    40 |   memset(&boot_params->ext_ramdisk_image, 0,
>       |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    41 |          (char *)&boot_params->efi_info -
>       |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    42 |    (char *)&boot_params->ext_ramdisk_image);
>       |    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ./arch/x86/include/asm/bootparam_utils.h:43:3: warning: 'memset' offset [493, 497] from the object at 'boot_params' is
> out of the bounds of referenced subobject 'kbd_status' with type 'unsigned char' at offset 491 [-Warray-bounds]
>    43 |   memset(&boot_params->kbd_status, 0,
>       |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    44 |          (char *)&boot_params->hdr -
>       |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    45 |          (char *)&boot_params->kbd_status);
>       |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Can you check older versions, too ? Maybe also trying older gcc ?


--mtx

-- 
Enrico Weigelt, metux IT consult
Free software and Linux embedded engineering
info@metux.net -- +49-151-27565287

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

* Re: Warnings whilst building 5.2.0+
  2019-07-09 10:37 ` Enrico Weigelt, metux IT consult
@ 2019-07-09 11:39   ` Chris Clayton
  2019-08-07  6:30     ` Chris Clayton
  0 siblings, 1 reply; 5+ messages in thread
From: Chris Clayton @ 2019-07-09 11:39 UTC (permalink / raw)
  To: Enrico Weigelt, metux IT consult, LKML



On 09/07/2019 11:37, Enrico Weigelt, metux IT consult wrote:
> On 09.07.19 08:06, Chris Clayton wrote:
> 
> Hi,
> 
>> I've pulled Linus' tree this morning and, after running 'make oldconfig', tried a build. During that build I got the
>> following warnings, which look to me like they should be fixed. 'git describe' shows v5.2-915-g5ad18b2e60b7 and my
>> compiler is the 20190706 snapshot of gcc 9.
> 
> Thanks for the report. I'm rebuilding right know anyways, so I'll look
> out for it.

Thanks for the reply.

>> In file included from arch/x86/kernel/head64.c:35:
>> In function 'sanitize_boot_params',
>>     inlined from 'copy_bootdata' at arch/x86/kernel/head64.c:391:2:
>> ./arch/x86/include/asm/bootparam_utils.h:40:3: warning: 'memset' offset [197, 448] from the object at 'boot_params' is
>> out of the bounds of referenced subobject 'ext_ramdisk_image' with type 'unsigned int' at offset 192 [-Warray-bounds]
>>    40 |   memset(&boot_params->ext_ramdisk_image, 0,
>>       |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>    41 |          (char *)&boot_params->efi_info -
>>       |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>    42 |    (char *)&boot_params->ext_ramdisk_image);
>>       |    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> ./arch/x86/include/asm/bootparam_utils.h:43:3: warning: 'memset' offset [493, 497] from the object at 'boot_params' is
>> out of the bounds of referenced subobject 'kbd_status' with type 'unsigned char' at offset 491 [-Warray-bounds]
>>    43 |   memset(&boot_params->kbd_status, 0,
>>       |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>    44 |          (char *)&boot_params->hdr -
>>       |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>    45 |          (char *)&boot_params->kbd_status);
>>       |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Can you check older versions, too ? Maybe also trying older gcc ?
> 

I see the same warnings building linux-5.2.0 with gcc9. However, I don't see the warnings building linux-5.2.0 with the
the 20190705 of gcc8. So the warnings could result from an improvement (i.e. the problem was in the kernel, but
undiscovered by gcc8) or from a regression in gcc9.

> 
> --mtx
> 

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

* Re: Warnings whilst building 5.2.0+
  2019-07-09 11:39   ` Chris Clayton
@ 2019-08-07  6:30     ` Chris Clayton
  2019-08-07  6:45       ` John Hubbard
  0 siblings, 1 reply; 5+ messages in thread
From: Chris Clayton @ 2019-08-07  6:30 UTC (permalink / raw)
  To: Enrico Weigelt, metux IT consult, LKML, tglx, jhubbard, hpa



On 09/07/2019 12:39, Chris Clayton wrote:
> 
> 
> On 09/07/2019 11:37, Enrico Weigelt, metux IT consult wrote:
>> On 09.07.19 08:06, Chris Clayton wrote:
>>
>> Hi,
>>
>>> I've pulled Linus' tree this morning and, after running 'make oldconfig', tried a build. During that build I got the
>>> following warnings, which look to me like they should be fixed. 'git describe' shows v5.2-915-g5ad18b2e60b7 and my
>>> compiler is the 20190706 snapshot of gcc 9.
>>
>> Thanks for the report. I'm rebuilding right know anyways, so I'll look
>> out for it.
> 
> Thanks for the reply.
> 
>>> In file included from arch/x86/kernel/head64.c:35:
>>> In function 'sanitize_boot_params',
>>>     inlined from 'copy_bootdata' at arch/x86/kernel/head64.c:391:2:
>>> ./arch/x86/include/asm/bootparam_utils.h:40:3: warning: 'memset' offset [197, 448] from the object at 'boot_params' is
>>> out of the bounds of referenced subobject 'ext_ramdisk_image' with type 'unsigned int' at offset 192 [-Warray-bounds]
>>>    40 |   memset(&boot_params->ext_ramdisk_image, 0,
>>>       |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>    41 |          (char *)&boot_params->efi_info -
>>>       |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>    42 |    (char *)&boot_params->ext_ramdisk_image);
>>>       |    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>> ./arch/x86/include/asm/bootparam_utils.h:43:3: warning: 'memset' offset [493, 497] from the object at 'boot_params' is
>>> out of the bounds of referenced subobject 'kbd_status' with type 'unsigned char' at offset 491 [-Warray-bounds]
>>>    43 |   memset(&boot_params->kbd_status, 0,
>>>       |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>    44 |          (char *)&boot_params->hdr -
>>>       |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>    45 |          (char *)&boot_params->kbd_status);
>>>       |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> Can you check older versions, too ? Maybe also trying older gcc ?
>>
> 
> I see the same warnings building linux-5.2.0 with gcc9. However, I don't see the warnings building linux-5.2.0 with the
> the 20190705 of gcc8. So the warnings could result from an improvement (i.e. the problem was in the kernel, but
> undiscovered by gcc8) or from a regression in gcc9.
> 

From the discussion starting at https://marc.info/?l=linux-kernel&m=156401014023908, it would appear that the problem is
undiscovered by gcc8. Building a fresh pull of Linus' tree this morning (v5.3-rc3-282-g33920f1ec5bf), I see that the
warnings are still being emitted. Adding the participants in the other discussion to this one.

>>
>> --mtx
>>

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

* Re: Warnings whilst building 5.2.0+
  2019-08-07  6:30     ` Chris Clayton
@ 2019-08-07  6:45       ` John Hubbard
  0 siblings, 0 replies; 5+ messages in thread
From: John Hubbard @ 2019-08-07  6:45 UTC (permalink / raw)
  To: Chris Clayton, Enrico Weigelt, metux IT consult, LKML, tglx, hpa
  Cc: Ingo Molnar, x86@kernel.org, Borislav Petkov

On 8/6/19 11:30 PM, Chris Clayton wrote:
> On 09/07/2019 12:39, Chris Clayton wrote:
>> On 09/07/2019 11:37, Enrico Weigelt, metux IT consult wrote:
>>> On 09.07.19 08:06, Chris Clayton wrote:
...
>>> Can you check older versions, too ? Maybe also trying older gcc ?
>>>
>>
>> I see the same warnings building linux-5.2.0 with gcc9. However, I don't see the warnings building linux-5.2.0 with the
>> the 20190705 of gcc8. So the warnings could result from an improvement (i.e. the problem was in the kernel, but
>> undiscovered by gcc8) or from a regression in gcc9.
>>
> 
>  From the discussion starting at https://marc.info/?l=linux-kernel&m=156401014023908, it would appear that the problem is
> undiscovered by gcc8. Building a fresh pull of Linus' tree this morning (v5.3-rc3-282-g33920f1ec5bf), I see that the
> warnings are still being emitted. Adding the participants in the other discussion to this one.
> 

The warnings are still there because the fix has not been committed to any
tree yet.

If you could try out my proposed fix [1], and reply to that thread with perhaps a
Tested-by tag, that would help encourage the maintainers to accept it.

So far it hasn't made it to the top of their inboxes, but I'm hoping... :)


[1] https://lore.kernel.org/r/20190731054627.5627-2-jhubbard@nvidia.com
     ("x86/boot: save fields explicitly, zero out everything else")

thanks,
-- 
John Hubbard
NVIDIA

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

end of thread, other threads:[~2019-08-07  6:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-09  6:06 Warnings whilst building 5.2.0+ Chris Clayton
2019-07-09 10:37 ` Enrico Weigelt, metux IT consult
2019-07-09 11:39   ` Chris Clayton
2019-08-07  6:30     ` Chris Clayton
2019-08-07  6:45       ` John Hubbard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox