* fs/orangefs/super.c:403:9: warning: 'strncpy' output may be truncated copying 255 bytes from a string of length 255
@ 2024-01-07 17:23 kernel test robot
2024-01-08 1:23 ` Liu, Yujie
0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2024-01-07 17:23 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp
::::::
:::::: Manual check reason: "low confidence static check first_new_problem: fs/orangefs/super.c:403:9: warning: 'strncpy' output may be truncated copying 255 bytes from a string of length 255 [-Wstringop-truncation]"
::::::
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: WANG Xuerui <git@xen0n.name>
CC: Huacai Chen <chenhuacai@kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 52b1853b080a082ec3749c3a9577f6c71b1d4a90
commit: 3f301dc292eb122eff61b8b2906e519154b0327f LoongArch: Replace -ffreestanding with finer-grained -fno-builtin's
date: 5 months ago
:::::: branch date: 22 hours ago
:::::: commit date: 5 months ago
config: loongarch-randconfig-r064-20240107 (https://download.01.org/0day-ci/archive/20240108/202401080141.9S4e21oc-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240108/202401080141.9S4e21oc-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202401080141.9S4e21oc-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from fs/orangefs/protocol.h:287,
from fs/orangefs/super.c:8:
fs/orangefs/orangefs-debug.h:86:18: warning: 'num_kmod_keyword_mask_map' defined but not used [-Wunused-const-variable=]
86 | static const int num_kmod_keyword_mask_map = (int)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
In function 'orangefs_unmount',
inlined from 'orangefs_kill_sb' at fs/orangefs/super.c:616:6:
>> fs/orangefs/super.c:403:9: warning: 'strncpy' output may be truncated copying 255 bytes from a string of length 255 [-Wstringop-truncation]
403 | strncpy(op->upcall.req.fs_umount.orangefs_config_server,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
404 | devname, ORANGEFS_MAX_SERVER_ADDR_LEN - 1);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
drivers/acpi/acpica/tbfind.c: In function 'acpi_tb_find_table':
>> drivers/acpi/acpica/tbfind.c:60:9: warning: 'strncpy' specified bound 6 equals destination size [-Wstringop-truncation]
60 | strncpy(header.oem_id, oem_id, ACPI_OEM_ID_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/acpi/acpica/tbfind.c:61:9: warning: 'strncpy' specified bound 8 equals destination size [-Wstringop-truncation]
61 | strncpy(header.oem_table_id, oem_table_id, ACPI_OEM_TABLE_ID_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
drivers/pci/controller/pcie-mt7621.c: In function 'mt7621_pcie_parse_dt':
>> drivers/pci/controller/pcie-mt7621.c:228:49: warning: 'snprintf' output may be truncated before the last format character [-Wformat-truncation=]
228 | snprintf(name, sizeof(name), "pcie-phy%d", slot);
| ^
In function 'mt7621_pcie_parse_port',
inlined from 'mt7621_pcie_parse_dt' at drivers/pci/controller/pcie-mt7621.c:280:9:
drivers/pci/controller/pcie-mt7621.c:228:9: note: 'snprintf' output between 10 and 11 bytes into a destination of size 10
228 | snprintf(name, sizeof(name), "pcie-phy%d", slot);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
drivers/gpu/drm/imx/ipuv3/imx-ldb.c: In function 'imx_ldb_probe':
>> drivers/gpu/drm/imx/ipuv3/imx-ldb.c:659:39: warning: '_sel' directive writing 4 bytes into a region of size between 3 and 13 [-Wformat-overflow=]
659 | sprintf(clkname, "di%d_sel", i);
| ^~~~
drivers/gpu/drm/imx/ipuv3/imx-ldb.c:659:17: note: 'sprintf' output between 8 and 18 bytes into a destination of size 16
659 | sprintf(clkname, "di%d_sel", i);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/strncpy +403 fs/orangefs/super.c
1182fca3bc0044 Mike Marshall 2015-07-17 393
9d286b0d8207a7 Martin Brandenburg 2017-04-25 394 static int orangefs_unmount(int id, __s32 fs_id, const char *devname)
9d286b0d8207a7 Martin Brandenburg 2017-04-25 395 {
9d286b0d8207a7 Martin Brandenburg 2017-04-25 396 struct orangefs_kernel_op_s *op;
9d286b0d8207a7 Martin Brandenburg 2017-04-25 397 int r;
9d286b0d8207a7 Martin Brandenburg 2017-04-25 398 op = op_alloc(ORANGEFS_VFS_OP_FS_UMOUNT);
9d286b0d8207a7 Martin Brandenburg 2017-04-25 399 if (!op)
9d286b0d8207a7 Martin Brandenburg 2017-04-25 400 return -ENOMEM;
9d286b0d8207a7 Martin Brandenburg 2017-04-25 401 op->upcall.req.fs_umount.id = id;
9d286b0d8207a7 Martin Brandenburg 2017-04-25 402 op->upcall.req.fs_umount.fs_id = fs_id;
9d286b0d8207a7 Martin Brandenburg 2017-04-25 @403 strncpy(op->upcall.req.fs_umount.orangefs_config_server,
6bdfb48dae8e1b Xiongfeng Wang 2018-01-08 404 devname, ORANGEFS_MAX_SERVER_ADDR_LEN - 1);
9d286b0d8207a7 Martin Brandenburg 2017-04-25 405 r = service_operation(op, "orangefs_fs_umount", 0);
9d286b0d8207a7 Martin Brandenburg 2017-04-25 406 /* Not much to do about an error here. */
9d286b0d8207a7 Martin Brandenburg 2017-04-25 407 if (r)
9d286b0d8207a7 Martin Brandenburg 2017-04-25 408 gossip_err("orangefs_unmount: service_operation %d\n", r);
9d286b0d8207a7 Martin Brandenburg 2017-04-25 409 op_release(op);
9d286b0d8207a7 Martin Brandenburg 2017-04-25 410 return r;
9d286b0d8207a7 Martin Brandenburg 2017-04-25 411 }
9d286b0d8207a7 Martin Brandenburg 2017-04-25 412
:::::: The code at line 403 was first introduced by commit
:::::: 9d286b0d8207a70d7e0ffbd5be864ff7a62de05a orangefs: ensure the userspace component is unmounted if mount fails
:::::: TO: Martin Brandenburg <martin@omnibond.com>
:::::: CC: Mike Marshall <hubcap@omnibond.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread* RE: fs/orangefs/super.c:403:9: warning: 'strncpy' output may be truncated copying 255 bytes from a string of length 255
2024-01-07 17:23 fs/orangefs/super.c:403:9: warning: 'strncpy' output may be truncated copying 255 bytes from a string of length 255 kernel test robot
@ 2024-01-08 1:23 ` Liu, Yujie
0 siblings, 0 replies; 2+ messages in thread
From: Liu, Yujie @ 2024-01-08 1:23 UTC (permalink / raw)
To: lkp, oe-kbuild@lists.linux.dev
not_report
The patch changes the cflags for memcpy/memmove/memset under loongarch. It seems no relation with the -Wstringop-truncation and -Wformat-overflow warnings in some filesystem and driver code.
diff --git a/arch/loongarch/Makefile b/arch/loongarch/Makefile
index b1e5db51b61ca..ef87bab46754e 100644
--- a/arch/loongarch/Makefile
+++ b/arch/loongarch/Makefile
@@ -83,8 +83,8 @@ KBUILD_CFLAGS_KERNEL += -fPIE
LDFLAGS_vmlinux += -static -pie --no-dynamic-linker -z notext
endif
-cflags-y += -ffreestanding
cflags-y += $(call cc-option, -mno-check-zero-division)
+cflags-y += -fno-builtin-memcpy -fno-builtin-memmove -fno-builtin-memset
load-y = 0x9000000000200000
bootvars-y = VMLINUX_LOAD_ADDRESS=$(load-y)
-----Original Message-----
From: lkp <lkp@intel.com>
Sent: Monday, January 8, 2024 01:23
To: oe-kbuild@lists.linux.dev
Cc: lkp <lkp@intel.com>
Subject: fs/orangefs/super.c:403:9: warning: 'strncpy' output may be truncated copying 255 bytes from a string of length 255
::::::
:::::: Manual check reason: "low confidence static check first_new_problem: fs/orangefs/super.c:403:9: warning: 'strncpy' output may be truncated copying 255 bytes from a string of length 255 [-Wstringop-truncation]"
::::::
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: WANG Xuerui <git@xen0n.name>
CC: Huacai Chen <chenhuacai@kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 52b1853b080a082ec3749c3a9577f6c71b1d4a90
commit: 3f301dc292eb122eff61b8b2906e519154b0327f LoongArch: Replace -ffreestanding with finer-grained -fno-builtin's
date: 5 months ago
:::::: branch date: 22 hours ago
:::::: commit date: 5 months ago
config: loongarch-randconfig-r064-20240107 (https://download.01.org/0day-ci/archive/20240108/202401080141.9S4e21oc-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240108/202401080141.9S4e21oc-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202401080141.9S4e21oc-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from fs/orangefs/protocol.h:287,
from fs/orangefs/super.c:8:
fs/orangefs/orangefs-debug.h:86:18: warning: 'num_kmod_keyword_mask_map' defined but not used [-Wunused-const-variable=]
86 | static const int num_kmod_keyword_mask_map = (int)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
In function 'orangefs_unmount',
inlined from 'orangefs_kill_sb' at fs/orangefs/super.c:616:6:
>> fs/orangefs/super.c:403:9: warning: 'strncpy' output may be truncated copying 255 bytes from a string of length 255 [-Wstringop-truncation]
403 | strncpy(op->upcall.req.fs_umount.orangefs_config_server,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
404 | devname, ORANGEFS_MAX_SERVER_ADDR_LEN - 1);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
drivers/acpi/acpica/tbfind.c: In function 'acpi_tb_find_table':
>> drivers/acpi/acpica/tbfind.c:60:9: warning: 'strncpy' specified bound 6 equals destination size [-Wstringop-truncation]
60 | strncpy(header.oem_id, oem_id, ACPI_OEM_ID_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/acpi/acpica/tbfind.c:61:9: warning: 'strncpy' specified bound 8 equals destination size [-Wstringop-truncation]
61 | strncpy(header.oem_table_id, oem_table_id, ACPI_OEM_TABLE_ID_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
drivers/pci/controller/pcie-mt7621.c: In function 'mt7621_pcie_parse_dt':
>> drivers/pci/controller/pcie-mt7621.c:228:49: warning: 'snprintf' output may be truncated before the last format character [-Wformat-truncation=]
228 | snprintf(name, sizeof(name), "pcie-phy%d", slot);
| ^
In function 'mt7621_pcie_parse_port',
inlined from 'mt7621_pcie_parse_dt' at drivers/pci/controller/pcie-mt7621.c:280:9:
drivers/pci/controller/pcie-mt7621.c:228:9: note: 'snprintf' output between 10 and 11 bytes into a destination of size 10
228 | snprintf(name, sizeof(name), "pcie-phy%d", slot);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
drivers/gpu/drm/imx/ipuv3/imx-ldb.c: In function 'imx_ldb_probe':
>> drivers/gpu/drm/imx/ipuv3/imx-ldb.c:659:39: warning: '_sel' directive writing 4 bytes into a region of size between 3 and 13 [-Wformat-overflow=]
659 | sprintf(clkname, "di%d_sel", i);
| ^~~~
drivers/gpu/drm/imx/ipuv3/imx-ldb.c:659:17: note: 'sprintf' output between 8 and 18 bytes into a destination of size 16
659 | sprintf(clkname, "di%d_sel", i);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/strncpy +403 fs/orangefs/super.c
1182fca3bc0044 Mike Marshall 2015-07-17 393
9d286b0d8207a7 Martin Brandenburg 2017-04-25 394 static int orangefs_unmount(int id, __s32 fs_id, const char *devname)
9d286b0d8207a7 Martin Brandenburg 2017-04-25 395 {
9d286b0d8207a7 Martin Brandenburg 2017-04-25 396 struct orangefs_kernel_op_s *op;
9d286b0d8207a7 Martin Brandenburg 2017-04-25 397 int r;
9d286b0d8207a7 Martin Brandenburg 2017-04-25 398 op = op_alloc(ORANGEFS_VFS_OP_FS_UMOUNT);
9d286b0d8207a7 Martin Brandenburg 2017-04-25 399 if (!op)
9d286b0d8207a7 Martin Brandenburg 2017-04-25 400 return -ENOMEM;
9d286b0d8207a7 Martin Brandenburg 2017-04-25 401 op->upcall.req.fs_umount.id = id;
9d286b0d8207a7 Martin Brandenburg 2017-04-25 402 op->upcall.req.fs_umount.fs_id = fs_id;
9d286b0d8207a7 Martin Brandenburg 2017-04-25 @403 strncpy(op->upcall.req.fs_umount.orangefs_config_server,
6bdfb48dae8e1b Xiongfeng Wang 2018-01-08 404 devname, ORANGEFS_MAX_SERVER_ADDR_LEN - 1);
9d286b0d8207a7 Martin Brandenburg 2017-04-25 405 r = service_operation(op, "orangefs_fs_umount", 0);
9d286b0d8207a7 Martin Brandenburg 2017-04-25 406 /* Not much to do about an error here. */
9d286b0d8207a7 Martin Brandenburg 2017-04-25 407 if (r)
9d286b0d8207a7 Martin Brandenburg 2017-04-25 408 gossip_err("orangefs_unmount: service_operation %d\n", r);
9d286b0d8207a7 Martin Brandenburg 2017-04-25 409 op_release(op);
9d286b0d8207a7 Martin Brandenburg 2017-04-25 410 return r;
9d286b0d8207a7 Martin Brandenburg 2017-04-25 411 }
9d286b0d8207a7 Martin Brandenburg 2017-04-25 412
:::::: The code at line 403 was first introduced by commit
:::::: 9d286b0d8207a70d7e0ffbd5be864ff7a62de05a orangefs: ensure the userspace component is unmounted if mount fails
:::::: TO: Martin Brandenburg <martin@omnibond.com>
:::::: CC: Mike Marshall <hubcap@omnibond.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-01-08 1:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-07 17:23 fs/orangefs/super.c:403:9: warning: 'strncpy' output may be truncated copying 255 bytes from a string of length 255 kernel test robot
2024-01-08 1:23 ` Liu, Yujie
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.