Whamcloud - gitweb
LU-17504 build: fix gcc-13 [-Werror=stringop-overread] error
authorShaun Tancheff <shaun.tancheff@hpe.com>
Thu, 25 Apr 2024 22:36:44 +0000 (15:36 -0700)
committerAndreas Dilger <adilger@whamcloud.com>
Sat, 27 Apr 2024 22:25:11 +0000 (22:25 +0000)
commit155ea3e5ec44790385cd44953b48d2a892699afe
treeef06094cc0e6b932bb2f5a29c424da26f65e263f
parentd357ddfd772466ff41d937029dccfa8c2544468e
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);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Lustre-change: https://review.whamcloud.com/54834
Lustre-commit: TBD (from 787b45323742a00e262334ba6dfa8c7aff80bdac)

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/ex/lustre-release/+/54874
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
14 files changed:
libcfs/include/libcfs/libcfs_hash.h
libcfs/libcfs/hash.c
lnet/lnet/config.c
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