public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* new __write_overflow_field compiler warning
@ 2022-05-17 18:03 Jeff Layton
  2022-05-17 20:53 ` Kees Cook
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Layton @ 2022-05-17 18:03 UTC (permalink / raw)
  To: Kees Cook; +Cc: David Howells, linux-kernel

Hi Kees,

I'm hoping you can help with this. I recently updated to Fedora 36,
which has gcc v12, and I've started seeing this warning pop up when
compiling the ceph.ko:

In file included from ./include/linux/string.h:253,
                 from ./include/linux/ceph/ceph_debug.h:7,
                 from fs/ceph/inode.c:2:
In function ‘fortify_memset_chk’,
    inlined from ‘netfs_i_context_init’ at ./include/linux/netfs.h:326:2,
    inlined from ‘ceph_alloc_inode’ at fs/ceph/inode.c:463:2:
./include/linux/fortify-string.h:242:25: warning: call to ‘__write_overflow_field’ declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Wattribute-warning]
  242 |                         __write_overflow_field(p_size_field, size);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This doesn't seem to happen with gcc v11. It looks like the code is
doing the right thing. Is there something we need to fix how the netfs
context gets initialized or is this a compiler problem?

FWIW: I'm using:

    gcc (GCC) 12.1.1 20220507 (Red Hat 12.1.1-1)

Thanks,
-- 
Jeff Layton <jlayton@kernel.org>

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

end of thread, other threads:[~2022-05-18  8:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-17 18:03 new __write_overflow_field compiler warning Jeff Layton
2022-05-17 20:53 ` Kees Cook
2022-05-18  8:57   ` David Laight

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