Re: [PATCH v3 0/5] s390/vfio-ap: ap_config sysfs attribute for mdevctl automation
From: Heiko Carstens
Date: Thu Mar 21 2024 - 10:42:01 EST
Hi Jason,
> > In function ‘bitmap_copy’,
> > inlined from ‘ap_matrix_copy’ at drivers/s390/crypto/vfio_ap_ops.c:1674:2,
> > inlined from ‘ap_config_store’ at drivers/s390/crypto/vfio_ap_ops.c:1696:2:
> > ./include/linux/bitmap.h:253:17: warning: ‘memcpy’ reading 32 bytes from a region of size 0 [-Wstringop-overread]
> > 253 | memcpy(dst, src, len);
> > | ^~~~~~~~~~~~~~~~~~~~~
> > In function ‘ap_config_store’:
> > cc1: note: source object is likely at address zero
>
> I believe that this is a bogus compiler warning. I cannot reproduce it,
> fwiw.
>
> gcc: gcc (GCC) 13.2.1 20231205 (Red Hat 13.2.1-6)
> binutls binutils-2.40-14.fc39
..
> A quick web search seems to indicate gcc throws quite a few
> Wstringop-overread warnings for valid code. I suspect this is
> another example of that.
This might be the case, however the code has to compile without
warnings also with plain gcc 13.2.0 (built from source).