Whamcloud - gitweb
LU-17504 build: fix gcc-13 [-Werror=stringop-overread] error 34/54834/6 master
authorShaun Tancheff <shaun.tancheff@hpe.com>
Thu, 25 Apr 2024 17:57:36 +0000 (00:57 +0700)
committerOleg Drokin <green@whamcloud.com>
Tue, 30 Apr 2024 06:58:41 +0000 (06:58 +0000)
commit718e3f3e680f422d865a15890ac60e66dcd9e240
tree10513b0593c6d0379ba05e303257db9b1151c2e4
parentaa76ae0c21a7e315ecb1fded82f2c793aa26f78c
LU-17504 build: fix gcc-13 [-Werror=stringop-overread] error

This patch fixes the following [-Werror=stringop-overread] and
[-Werror=attribute-warning] errors detected by gcc 13:

lustre/mgc/mgc_request.c:190:21: error: 'strcmp' reading 1 or
more bytes from a region of size 0 [-Werror=stringop-overread]
  190 | if (strcmp(logname, cld->cld_logname) == 0) {
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In function 'fortify_memcpy_chk',
    inlined from 'class_handle_ioctl' at
/root/lustre-release/lustre/obdclass/class_obd.c:381:3:
include/linux/fortify-string.h:528:25: error:
call to '__write_overflow_field' declared with attribute warning:
detected write beyond size of field (1st parameter);
maybe use struct_group()? [-Werror=attribute-warning]
  528 |  __write_overflow_field(p_size_field, size);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Jian Yu <yujian@whamcloud.com>
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: I59f5a88b4cd64c9f4e67e568546baada371543b1
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54834
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
17 files changed:
libcfs/include/libcfs/libcfs_hash.h
libcfs/libcfs/hash.c
lnet/lnet/config.c
lnet/selftest/module.c
lustre/include/lustre_quota.h
lustre/include/lustre_sec.h
lustre/include/obd_class.h
lustre/include/uapi/linux/lustre/lustre_idl.h
lustre/include/uapi/linux/lustre/lustre_ioctl.h
lustre/include/uapi/linux/lustre/lustre_user.h
lustre/lfsck/lfsck_internal.h
lustre/mgc/mgc_request.c
lustre/obdclass/class_obd.c
lustre/obdclass/dt_object.c
lustre/ptlrpc/wiretest.c
lustre/utils/wirecheck.c
lustre/utils/wiretest.c