mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nilay Shroff <nilay@linux.ibm.com>
To: Brian Norris <briannorris@chromium.org>
Cc: kees@kernel.org, nathan@kernel.org, yury.norov@gmail.com,
	linux-kernel@vger.kernel.org, "Gregory Joyce" <gjoyce@ibm.com>,
	"Thomas Weißschuh" <linux@weissschuh.net>
Subject: Re: [bug report] cpumask: gcc 13.x emits compilation error on PowerPC
Date: Thu, 7 Nov 2024 19:07:54 +0530	[thread overview]
Message-ID: <6f0cd0ce-f217-4397-8785-7590d1e0e0e0@linux.ibm.com> (raw)
In-Reply-To: <CA+ASDXPKosUXy1x7Yvbu3pEYiMfDPSt69xt3Jq-zHw66yeUSRw@mail.gmail.com>



On 11/6/24 23:30, Brian Norris wrote:
> Hi,
> 
> On Wed, Nov 6, 2024 at 5:02 AM Nilay Shroff <nilay@linux.ibm.com> wrote:
>>
>> Hi,
>>
>> Of late, I've been encountering the following compilation error while using GCC 13.x and latest upstream code:
>>
>> Compilation error:
>> ==================
>>   <snip>
>>   CC      kernel/padata.o
>> In file included from ./include/linux/string.h:390,
>>                  from ./arch/powerpc/include/asm/paca.h:16,
>>                  from ./arch/powerpc/include/asm/current.h:13,
>>                  from ./include/linux/thread_info.h:23,
>>                  from ./include/asm-generic/preempt.h:5,
>>                  from ./arch/powerpc/include/generated/asm/preempt.h:1,
>>                  from ./include/linux/preempt.h:79,
>>                  from ./include/linux/spinlock.h:56,
>>                  from ./include/linux/swait.h:7,
>>                  from ./include/linux/completion.h:12,
>>                  from kernel/padata.c:14:
>> In function ‘bitmap_copy’,
>>     inlined from ‘cpumask_copy’ at ./include/linux/cpumask.h:839:2,
>>     inlined from ‘__padata_set_cpumasks’ at kernel/padata.c:730:2:
>> ./include/linux/fortify-string.h:114:33: error: ‘__builtin_memcpy’ reading between 257 and 536870904 bytes from a region of size 256 [-Werror=stringop-overread]
>>   114 | #define __underlying_memcpy     __builtin_memcpy
>>       |                                 ^
> 
> FWIW, I think Kees already was fielding a similar report a few days ago:
> 
> Re: Fortify compilation warning in __padata_set_cpumask()
> https://lore.kernel.org/all/202411021337.85E9BB06@keescook/
> 
Thanks for this pointer! This one appears exactly similar to what I encountered on PowerPC. 

> IIUC, he was hoping for better compiler diagnostics to help out there.
Hmm ok
> 
> (Also, I imitated Thomas's .config notes from that report and couldn't
> reproduce with my GCC 13.2.0.)
> 
> I also happen to see there are a few scattered instances of either
> disabling or working around -Wstringop-overread false positives in the
> tree today.
> 
So shall we wait until we get better diagnostics from GCC or can we bypass this 
error temporarily with either using __NO_FORTIFY (as I proposed  in my another 
email) or disable -Wstringop-overread for kernel/padata.c file? Later when we 
find a better fix, we may then revert this change. 

Thanks,
--Nilay

  reply	other threads:[~2024-11-07 13:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-06 13:02 Nilay Shroff
2024-11-06 16:12 ` Yury Norov
2024-11-07 13:30   ` Nilay Shroff
2024-11-06 18:00 ` Brian Norris
2024-11-07 13:37   ` Nilay Shroff [this message]
2024-11-11 20:57     ` Brian Norris
2024-11-12 12:38       ` Nilay Shroff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6f0cd0ce-f217-4397-8785-7590d1e0e0e0@linux.ibm.com \
    --to=nilay@linux.ibm.com \
    --cc=briannorris@chromium.org \
    --cc=gjoyce@ibm.com \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=nathan@kernel.org \
    --cc=yury.norov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®