* [hnaz-linux-mm:master 156/523] include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
@ 2020-05-19 9:23 kbuild test robot
2020-05-19 14:42 ` Daniel Axtens
2020-05-19 14:42 ` Daniel Axtens
0 siblings, 2 replies; 6+ messages in thread
From: kbuild test robot @ 2020-05-19 9:23 UTC (permalink / raw)
To: Daniel Axtens
Cc: kbuild-all, Johannes Weiner, Dmitry Vyukov, Andrew Morton,
Linux Memory Management List
[-- Attachment #1: Type: text/plain, Size: 14497 bytes --]
tree: https://github.com/hnaz/linux-mm master
head: 2bbf0589bfeb27800c730b76eacf34528eee5418
commit: 854834b3859d2d80e31750f658bc8e4031422912 [156/523] string.h: fix incompatibility between FORTIFY_SOURCE and KASAN
config: arm-allyesconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 854834b3859d2d80e31750f658bc8e4031422912
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
drivers/scsi/arcmsr/arcmsr_hba.c: In function 'arcmsr_remap_pciregion':
drivers/scsi/arcmsr/arcmsr_hba.c:286:30: warning: variable 'flags' set but not used [-Wunused-but-set-variable]
286 | unsigned long addr, range, flags;
| ^~~~~
drivers/scsi/arcmsr/arcmsr_hba.c: In function 'arcmsr_suspend':
drivers/scsi/arcmsr/arcmsr_hba.c:1070:11: warning: variable 'intmask_org' set but not used [-Wunused-but-set-variable]
1070 | uint32_t intmask_org;
| ^~~~~~~~~~~
drivers/scsi/arcmsr/arcmsr_hba.c: In function 'arcmsr_done4abort_postqueue':
drivers/scsi/arcmsr/arcmsr_hba.c:1410:29: warning: variable 'cdb_phy_hipart' set but not used [-Wunused-but-set-variable]
1410 | unsigned long ccb_cdb_phy, cdb_phy_hipart;
| ^~~~~~~~~~~~~~
drivers/scsi/arcmsr/arcmsr_hba.c: In function 'arcmsr_hbaD_postqueue_isr':
drivers/scsi/arcmsr/arcmsr_hba.c:2448:36: warning: variable 'cdb_phy_hipart' set but not used [-Wunused-but-set-variable]
2448 | unsigned long flags, ccb_cdb_phy, cdb_phy_hipart;
| ^~~~~~~~~~~~~~
drivers/scsi/arcmsr/arcmsr_hba.c: In function 'arcmsr_hbaD_polling_ccbdone':
drivers/scsi/arcmsr/arcmsr_hba.c:3498:36: warning: variable 'cdb_phy_hipart' set but not used [-Wunused-but-set-variable]
3498 | unsigned long flags, ccb_cdb_phy, cdb_phy_hipart;
| ^~~~~~~~~~~~~~
In file included from include/linux/bitmap.h:9,
from include/linux/nodemask.h:95,
from include/linux/mmzone.h:17,
from include/linux/gfp.h:6,
from include/linux/umh.h:4,
from include/linux/kmod.h:9,
from include/linux/module.h:16,
from drivers/scsi/arcmsr/arcmsr_hba.c:47:
In function 'strncpy',
inlined from 'arcmsr_handle_virtual_command' at drivers/scsi/arcmsr/arcmsr_hba.c:3059:3:
include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 4 bytes from a string of the same length [-Wstringop-truncation]
297 | #define __underlying_strncpy __builtin_strncpy
| ^
>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
307 | return __underlying_strncpy(p, q, size);
| ^~~~~~~~~~~~~~~~~~~~
In function 'strncpy',
inlined from 'arcmsr_handle_virtual_command' at drivers/scsi/arcmsr/arcmsr_hba.c:3057:3:
include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 16 bytes from a string of the same length [-Wstringop-truncation]
297 | #define __underlying_strncpy __builtin_strncpy
| ^
>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
307 | return __underlying_strncpy(p, q, size);
| ^~~~~~~~~~~~~~~~~~~~
In function 'strncpy',
inlined from 'arcmsr_handle_virtual_command' at drivers/scsi/arcmsr/arcmsr_hba.c:3055:3:
include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 8 bytes from a string of the same length [-Wstringop-truncation]
297 | #define __underlying_strncpy __builtin_strncpy
| ^
>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
307 | return __underlying_strncpy(p, q, size);
| ^~~~~~~~~~~~~~~~~~~~
--
In file included from include/linux/bitmap.h:9,
from include/linux/nodemask.h:95,
from include/linux/mmzone.h:17,
from include/linux/gfp.h:6,
from include/linux/slab.h:15,
from drivers/scsi/pm8001/pm8001_sas.c:41:
In function 'strncpy',
inlined from 'pm8001_issue_ssp_tmf' at drivers/scsi/pm8001/pm8001_sas.c:919:2:
include/linux/string.h:297:30: warning: '__builtin_strncpy' specified bound 8 equals destination size [-Wstringop-truncation]
297 | #define __underlying_strncpy __builtin_strncpy
| ^
>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
307 | return __underlying_strncpy(p, q, size);
| ^~~~~~~~~~~~~~~~~~~~
--
drivers/scsi/ips.c: In function 'ips_init_copperhead':
drivers/scsi/ips.c:4700:10: warning: variable 'ConfigByte' set but not used [-Wunused-but-set-variable]
4700 | uint8_t ConfigByte[IPS_MAX_CONFIG_BYTES];
| ^~~~~~~~~~
drivers/scsi/ips.c: In function 'ips_init_copperhead_memio':
drivers/scsi/ips.c:4794:10: warning: variable 'ConfigByte' set but not used [-Wunused-but-set-variable]
4794 | uint8_t ConfigByte[IPS_MAX_CONFIG_BYTES];
| ^~~~~~~~~~
drivers/scsi/ips.c: In function 'ips_init_phase1':
drivers/scsi/ips.c:6839:10: warning: variable 'func' set but not used [-Wunused-but-set-variable]
6839 | uint8_t func;
| ^~~~
drivers/scsi/ips.c:6838:10: warning: variable 'bus' set but not used [-Wunused-but-set-variable]
6838 | uint8_t bus;
| ^~~
In file included from arch/arm/include/asm/io.h:23,
from drivers/scsi/ips.c:164:
In function 'strncpy',
inlined from 'ips_send_cmd' at drivers/scsi/ips.c:3522:6:
include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 4 bytes from a string of the same length [-Wstringop-truncation]
297 | #define __underlying_strncpy __builtin_strncpy
| ^
>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
307 | return __underlying_strncpy(p, q, size);
| ^~~~~~~~~~~~~~~~~~~~
In function 'strncpy',
inlined from 'ips_send_cmd' at drivers/scsi/ips.c:3520:6:
include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 16 bytes from a string of the same length [-Wstringop-truncation]
297 | #define __underlying_strncpy __builtin_strncpy
| ^
>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
307 | return __underlying_strncpy(p, q, size);
| ^~~~~~~~~~~~~~~~~~~~
In function 'strncpy',
inlined from 'ips_send_cmd' at drivers/scsi/ips.c:3518:6:
include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 8 bytes from a string of the same length [-Wstringop-truncation]
297 | #define __underlying_strncpy __builtin_strncpy
| ^
>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
307 | return __underlying_strncpy(p, q, size);
| ^~~~~~~~~~~~~~~~~~~~
In function 'strncpy',
inlined from 'ips_inquiry' at drivers/scsi/ips.c:4041:2:
include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 4 bytes from a string of the same length [-Wstringop-truncation]
297 | #define __underlying_strncpy __builtin_strncpy
| ^
>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
307 | return __underlying_strncpy(p, q, size);
| ^~~~~~~~~~~~~~~~~~~~
In function 'strncpy',
inlined from 'ips_inquiry' at drivers/scsi/ips.c:4040:2:
include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 16 bytes from a string of the same length [-Wstringop-truncation]
297 | #define __underlying_strncpy __builtin_strncpy
| ^
>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
307 | return __underlying_strncpy(p, q, size);
| ^~~~~~~~~~~~~~~~~~~~
In function 'strncpy',
inlined from 'ips_inquiry' at drivers/scsi/ips.c:4039:2:
include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 8 bytes from a string of the same length [-Wstringop-truncation]
297 | #define __underlying_strncpy __builtin_strncpy
| ^
>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
307 | return __underlying_strncpy(p, q, size);
| ^~~~~~~~~~~~~~~~~~~~
In function 'strncpy',
inlined from 'ips_get_bios_version' at drivers/scsi/ips.c:2242:2:
include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 8 bytes from a string of the same length [-Wstringop-truncation]
297 | #define __underlying_strncpy __builtin_strncpy
| ^
>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
307 | return __underlying_strncpy(p, q, size);
| ^~~~~~~~~~~~~~~~~~~~
In function 'strncpy',
inlined from 'ips_write_driver_status' at drivers/scsi/ips.c:5626:2:
include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 4 bytes from a string of the same length [-Wstringop-truncation]
297 | #define __underlying_strncpy __builtin_strncpy
| ^
>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
307 | return __underlying_strncpy(p, q, size);
| ^~~~~~~~~~~~~~~~~~~~
In function 'strncpy',
inlined from 'ips_write_driver_status' at drivers/scsi/ips.c:5625:2:
include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 4 bytes from a string of the same length [-Wstringop-truncation]
297 | #define __underlying_strncpy __builtin_strncpy
| ^
>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
307 | return __underlying_strncpy(p, q, size);
| ^~~~~~~~~~~~~~~~~~~~
In function 'strncpy',
inlined from 'ips_write_driver_status' at drivers/scsi/ips.c:5627:2,
inlined from 'ips_hainit' at drivers/scsi/ips.c:2433:7:
include/linux/string.h:297:30: warning: '__builtin_strncpy' output may be truncated copying 4 bytes from a string of length 7 [-Wstringop-truncation]
297 | #define __underlying_strncpy __builtin_strncpy
| ^
>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
307 | return __underlying_strncpy(p, q, size);
| ^~~~~~~~~~~~~~~~~~~~
In function 'strncpy',
inlined from 'ips_write_driver_status' at drivers/scsi/ips.c:5628:2,
inlined from 'ips_hainit' at drivers/scsi/ips.c:2433:7:
include/linux/string.h:297:30: warning: '__builtin_strncpy' specified bound 4 equals destination size [-Wstringop-truncation]
297 | #define __underlying_strncpy __builtin_strncpy
| ^
>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
307 | return __underlying_strncpy(p, q, size);
| ^~~~~~~~~~~~~~~~~~~~
--
drivers/scsi/3w-sas.c: In function 'twl_scsiop_execute_scsi':
drivers/scsi/3w-sas.c:298:22: warning: variable 'sglist' set but not used [-Wunused-but-set-variable]
298 | struct scatterlist *sglist = NULL, *sg;
| ^~~~~~
drivers/scsi/3w-sas.c: In function 'twl_scsi_biosparam':
drivers/scsi/3w-sas.c:1411:23: warning: variable 'tw_dev' set but not used [-Wunused-but-set-variable]
1411 | TW_Device_Extension *tw_dev;
| ^~~~~~
In file included from include/linux/bitmap.h:9,
from include/linux/nodemask.h:95,
from include/linux/mmzone.h:17,
from include/linux/gfp.h:6,
from include/linux/umh.h:4,
from include/linux/kmod.h:9,
from include/linux/module.h:16,
from drivers/scsi/3w-sas.c:53:
In function 'strncpy',
inlined from 'twl_reset_sequence' at drivers/scsi/3w-sas.c:1331:3:
include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 11 bytes from a string of the same length [-Wstringop-truncation]
297 | #define __underlying_strncpy __builtin_strncpy
| ^
>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
307 | return __underlying_strncpy(p, q, size);
| ^~~~~~~~~~~~~~~~~~~~
--
In file included from include/linux/bitmap.h:9,
from include/linux/nodemask.h:95,
from include/linux/mmzone.h:17,
from include/linux/gfp.h:6,
from include/linux/slab.h:15,
from include/linux/crypto.h:19,
from include/crypto/hash.h:11,
from include/linux/uio.h:10,
from include/linux/socket.h:8,
from include/uapi/linux/if.h:25,
from include/scsi/libfc.h:12,
from drivers/scsi/libfc/fc_elsct.c:17:
In function 'strncpy',
inlined from 'fc_ct_ms_fill.constprop' at include/scsi/fc_encode.h:263:3:
include/linux/string.h:297:30: warning: '__builtin_strncpy' output may be truncated copying 64 bytes from a string of length 79 [-Wstringop-truncation]
297 | #define __underlying_strncpy __builtin_strncpy
| ^
>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
307 | return __underlying_strncpy(p, q, size);
| ^~~~~~~~~~~~~~~~~~~~
In function 'strncpy',
inlined from 'fc_ct_ms_fill.constprop' at include/scsi/fc_encode.h:275:3:
include/linux/string.h:297:30: warning: '__builtin_strncpy' output may be truncated copying 64 bytes from a string of length 79 [-Wstringop-truncation]
297 | #define __underlying_strncpy __builtin_strncpy
| ^
>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
307 | return __underlying_strncpy(p, q, size);
| ^~~~~~~~~~~~~~~~~~~~
vim +/__underlying_strncpy +307 include/linux/string.h
299
300 __FORTIFY_INLINE char *strncpy(char *p, const char *q, __kernel_size_t size)
301 {
302 size_t p_size = __builtin_object_size(p, 0);
303 if (__builtin_constant_p(size) && p_size < size)
304 __write_overflow();
305 if (p_size < size)
306 fortify_panic(__func__);
> 307 return __underlying_strncpy(p, q, size);
308 }
309
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 73958 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [hnaz-linux-mm:master 156/523] include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
2020-05-19 9:23 [hnaz-linux-mm:master 156/523] include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy' kbuild test robot
@ 2020-05-19 14:42 ` Daniel Axtens
2020-05-20 1:48 ` Andrew Morton
2020-05-19 14:42 ` Daniel Axtens
1 sibling, 1 reply; 6+ messages in thread
From: Daniel Axtens @ 2020-05-19 14:42 UTC (permalink / raw)
To: kbuild test robot
Cc: kbuild-all, Johannes Weiner, Dmitry Vyukov, Andrew Morton,
Linux Memory Management List, linux-scsi
This looks like a SCSI issue that this has just happened to expose?
+ scsi list
kbuild test robot <lkp@intel.com> writes:
> tree: https://github.com/hnaz/linux-mm master
> head: 2bbf0589bfeb27800c730b76eacf34528eee5418
> commit: 854834b3859d2d80e31750f658bc8e4031422912 [156/523] string.h: fix incompatibility between FORTIFY_SOURCE and KASAN
> config: arm-allyesconfig (attached as .config)
> compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
> reproduce:
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> git checkout 854834b3859d2d80e31750f658bc8e4031422912
> # save the attached .config to linux build tree
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kbuild test robot <lkp@intel.com>
>
> All warnings (new ones prefixed by >>, old ones prefixed by <<):
>
> drivers/scsi/arcmsr/arcmsr_hba.c: In function 'arcmsr_remap_pciregion':
> drivers/scsi/arcmsr/arcmsr_hba.c:286:30: warning: variable 'flags' set but not used [-Wunused-but-set-variable]
> 286 | unsigned long addr, range, flags;
> | ^~~~~
> drivers/scsi/arcmsr/arcmsr_hba.c: In function 'arcmsr_suspend':
> drivers/scsi/arcmsr/arcmsr_hba.c:1070:11: warning: variable 'intmask_org' set but not used [-Wunused-but-set-variable]
> 1070 | uint32_t intmask_org;
> | ^~~~~~~~~~~
> drivers/scsi/arcmsr/arcmsr_hba.c: In function 'arcmsr_done4abort_postqueue':
> drivers/scsi/arcmsr/arcmsr_hba.c:1410:29: warning: variable 'cdb_phy_hipart' set but not used [-Wunused-but-set-variable]
> 1410 | unsigned long ccb_cdb_phy, cdb_phy_hipart;
> | ^~~~~~~~~~~~~~
> drivers/scsi/arcmsr/arcmsr_hba.c: In function 'arcmsr_hbaD_postqueue_isr':
> drivers/scsi/arcmsr/arcmsr_hba.c:2448:36: warning: variable 'cdb_phy_hipart' set but not used [-Wunused-but-set-variable]
> 2448 | unsigned long flags, ccb_cdb_phy, cdb_phy_hipart;
> | ^~~~~~~~~~~~~~
> drivers/scsi/arcmsr/arcmsr_hba.c: In function 'arcmsr_hbaD_polling_ccbdone':
> drivers/scsi/arcmsr/arcmsr_hba.c:3498:36: warning: variable 'cdb_phy_hipart' set but not used [-Wunused-but-set-variable]
> 3498 | unsigned long flags, ccb_cdb_phy, cdb_phy_hipart;
> | ^~~~~~~~~~~~~~
> In file included from include/linux/bitmap.h:9,
> from include/linux/nodemask.h:95,
> from include/linux/mmzone.h:17,
> from include/linux/gfp.h:6,
> from include/linux/umh.h:4,
> from include/linux/kmod.h:9,
> from include/linux/module.h:16,
> from drivers/scsi/arcmsr/arcmsr_hba.c:47:
> In function 'strncpy',
> inlined from 'arcmsr_handle_virtual_command' at drivers/scsi/arcmsr/arcmsr_hba.c:3059:3:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 4 bytes from a string of the same length [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> In function 'strncpy',
> inlined from 'arcmsr_handle_virtual_command' at drivers/scsi/arcmsr/arcmsr_hba.c:3057:3:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 16 bytes from a string of the same length [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> In function 'strncpy',
> inlined from 'arcmsr_handle_virtual_command' at drivers/scsi/arcmsr/arcmsr_hba.c:3055:3:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 8 bytes from a string of the same length [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> --
> In file included from include/linux/bitmap.h:9,
> from include/linux/nodemask.h:95,
> from include/linux/mmzone.h:17,
> from include/linux/gfp.h:6,
> from include/linux/slab.h:15,
> from drivers/scsi/pm8001/pm8001_sas.c:41:
> In function 'strncpy',
> inlined from 'pm8001_issue_ssp_tmf' at drivers/scsi/pm8001/pm8001_sas.c:919:2:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' specified bound 8 equals destination size [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> --
> drivers/scsi/ips.c: In function 'ips_init_copperhead':
> drivers/scsi/ips.c:4700:10: warning: variable 'ConfigByte' set but not used [-Wunused-but-set-variable]
> 4700 | uint8_t ConfigByte[IPS_MAX_CONFIG_BYTES];
> | ^~~~~~~~~~
> drivers/scsi/ips.c: In function 'ips_init_copperhead_memio':
> drivers/scsi/ips.c:4794:10: warning: variable 'ConfigByte' set but not used [-Wunused-but-set-variable]
> 4794 | uint8_t ConfigByte[IPS_MAX_CONFIG_BYTES];
> | ^~~~~~~~~~
> drivers/scsi/ips.c: In function 'ips_init_phase1':
> drivers/scsi/ips.c:6839:10: warning: variable 'func' set but not used [-Wunused-but-set-variable]
> 6839 | uint8_t func;
> | ^~~~
> drivers/scsi/ips.c:6838:10: warning: variable 'bus' set but not used [-Wunused-but-set-variable]
> 6838 | uint8_t bus;
> | ^~~
> In file included from arch/arm/include/asm/io.h:23,
> from drivers/scsi/ips.c:164:
> In function 'strncpy',
> inlined from 'ips_send_cmd' at drivers/scsi/ips.c:3522:6:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 4 bytes from a string of the same length [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> In function 'strncpy',
> inlined from 'ips_send_cmd' at drivers/scsi/ips.c:3520:6:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 16 bytes from a string of the same length [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> In function 'strncpy',
> inlined from 'ips_send_cmd' at drivers/scsi/ips.c:3518:6:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 8 bytes from a string of the same length [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> In function 'strncpy',
> inlined from 'ips_inquiry' at drivers/scsi/ips.c:4041:2:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 4 bytes from a string of the same length [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> In function 'strncpy',
> inlined from 'ips_inquiry' at drivers/scsi/ips.c:4040:2:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 16 bytes from a string of the same length [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> In function 'strncpy',
> inlined from 'ips_inquiry' at drivers/scsi/ips.c:4039:2:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 8 bytes from a string of the same length [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> In function 'strncpy',
> inlined from 'ips_get_bios_version' at drivers/scsi/ips.c:2242:2:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 8 bytes from a string of the same length [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> In function 'strncpy',
> inlined from 'ips_write_driver_status' at drivers/scsi/ips.c:5626:2:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 4 bytes from a string of the same length [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> In function 'strncpy',
> inlined from 'ips_write_driver_status' at drivers/scsi/ips.c:5625:2:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 4 bytes from a string of the same length [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> In function 'strncpy',
> inlined from 'ips_write_driver_status' at drivers/scsi/ips.c:5627:2,
> inlined from 'ips_hainit' at drivers/scsi/ips.c:2433:7:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' output may be truncated copying 4 bytes from a string of length 7 [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> In function 'strncpy',
> inlined from 'ips_write_driver_status' at drivers/scsi/ips.c:5628:2,
> inlined from 'ips_hainit' at drivers/scsi/ips.c:2433:7:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' specified bound 4 equals destination size [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> --
> drivers/scsi/3w-sas.c: In function 'twl_scsiop_execute_scsi':
> drivers/scsi/3w-sas.c:298:22: warning: variable 'sglist' set but not used [-Wunused-but-set-variable]
> 298 | struct scatterlist *sglist = NULL, *sg;
> | ^~~~~~
> drivers/scsi/3w-sas.c: In function 'twl_scsi_biosparam':
> drivers/scsi/3w-sas.c:1411:23: warning: variable 'tw_dev' set but not used [-Wunused-but-set-variable]
> 1411 | TW_Device_Extension *tw_dev;
> | ^~~~~~
> In file included from include/linux/bitmap.h:9,
> from include/linux/nodemask.h:95,
> from include/linux/mmzone.h:17,
> from include/linux/gfp.h:6,
> from include/linux/umh.h:4,
> from include/linux/kmod.h:9,
> from include/linux/module.h:16,
> from drivers/scsi/3w-sas.c:53:
> In function 'strncpy',
> inlined from 'twl_reset_sequence' at drivers/scsi/3w-sas.c:1331:3:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 11 bytes from a string of the same length [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> --
> In file included from include/linux/bitmap.h:9,
> from include/linux/nodemask.h:95,
> from include/linux/mmzone.h:17,
> from include/linux/gfp.h:6,
> from include/linux/slab.h:15,
> from include/linux/crypto.h:19,
> from include/crypto/hash.h:11,
> from include/linux/uio.h:10,
> from include/linux/socket.h:8,
> from include/uapi/linux/if.h:25,
> from include/scsi/libfc.h:12,
> from drivers/scsi/libfc/fc_elsct.c:17:
> In function 'strncpy',
> inlined from 'fc_ct_ms_fill.constprop' at include/scsi/fc_encode.h:263:3:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' output may be truncated copying 64 bytes from a string of length 79 [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> In function 'strncpy',
> inlined from 'fc_ct_ms_fill.constprop' at include/scsi/fc_encode.h:275:3:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' output may be truncated copying 64 bytes from a string of length 79 [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
>
> vim +/__underlying_strncpy +307 include/linux/string.h
>
> 299
> 300 __FORTIFY_INLINE char *strncpy(char *p, const char *q, __kernel_size_t size)
> 301 {
> 302 size_t p_size = __builtin_object_size(p, 0);
> 303 if (__builtin_constant_p(size) && p_size < size)
> 304 __write_overflow();
> 305 if (p_size < size)
> 306 fortify_panic(__func__);
> > 307 return __underlying_strncpy(p, q, size);
> 308 }
> 309
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [hnaz-linux-mm:master 156/523] include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
2020-05-19 14:42 ` Daniel Axtens
@ 2020-05-20 1:48 ` Andrew Morton
2020-05-20 2:08 ` Martin K. Petersen
2020-05-20 3:57 ` Daniel Axtens
0 siblings, 2 replies; 6+ messages in thread
From: Andrew Morton @ 2020-05-20 1:48 UTC (permalink / raw)
To: Daniel Axtens
Cc: kbuild test robot, kbuild-all, Johannes Weiner, Dmitry Vyukov,
Linux Memory Management List, linux-scsi
On Wed, 20 May 2020 00:42:17 +1000 Daniel Axtens <dja@axtens.net> wrote:
> This looks like a SCSI issue that this has just happened to expose?
> + scsi list
Maybe.
static void arcmsr_handle_virtual_command(struct AdapterControlBlock *acb,
struct scsi_cmnd *cmd)
{
switch (cmd->cmnd[0]) {
case INQUIRY: {
unsigned char inqdata[36];
char *buffer;
struct scatterlist *sg;
if (cmd->device->lun) {
cmd->result = (DID_TIME_OUT << 16);
cmd->scsi_done(cmd);
return;
}
inqdata[0] = TYPE_PROCESSOR;
/* Periph Qualifier & Periph Dev Type */
inqdata[1] = 0;
/* rem media bit & Dev Type Modifier */
inqdata[2] = 0;
/* ISO, ECMA, & ANSI versions */
inqdata[4] = 31;
/* length of additional data */
strncpy(&inqdata[8], "Areca ", 8);
/* Vendor Identification */
>>> strncpy(&inqdata[16], "RAID controller ", 16);
/* Product Identification */
strncpy(&inqdata[32], "R001", 4); /* Product Revision */
sg = scsi_sglist(cmd);
buffer = kmap_atomic(sg_page(sg)) + sg->offset;
memcpy(buffer, inqdata, sizeof(inqdata));
sg = scsi_sglist(cmd);
kunmap_atomic(buffer - sg->offset);
cmd->scsi_done(cmd);
}
break;
That strncpy() will indeed fail to copy the trailing null, but it looks
like that null isn't appropriate in the inquiry data.
So I suspect this is a valid usage of strncpy() and the checking is
just too strict.
otoh if this is the only place where we hit this issue then perhaps we
can switch to memcpy() and get on with life ;)
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [hnaz-linux-mm:master 156/523] include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
2020-05-20 1:48 ` Andrew Morton
@ 2020-05-20 2:08 ` Martin K. Petersen
2020-05-20 3:57 ` Daniel Axtens
1 sibling, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2020-05-20 2:08 UTC (permalink / raw)
To: Andrew Morton
Cc: Daniel Axtens, kbuild test robot, kbuild-all, Johannes Weiner,
Dmitry Vyukov, Linux Memory Management List, linux-scsi
Andrew,
> /* Vendor Identification */
>>>> strncpy(&inqdata[16], "RAID controller ", 16);
> That strncpy() will indeed fail to copy the trailing null, but it looks
> like that null isn't appropriate in the inquiry data.
Correct. These protocol strings are fixed-length / space-padded.
I.e. not null-terminated.
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [hnaz-linux-mm:master 156/523] include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
2020-05-20 1:48 ` Andrew Morton
2020-05-20 2:08 ` Martin K. Petersen
@ 2020-05-20 3:57 ` Daniel Axtens
1 sibling, 0 replies; 6+ messages in thread
From: Daniel Axtens @ 2020-05-20 3:57 UTC (permalink / raw)
To: Andrew Morton
Cc: kbuild test robot, kbuild-all, Johannes Weiner, Dmitry Vyukov,
Linux Memory Management List, linux-scsi
> inqdata[0] = TYPE_PROCESSOR;
> /* Periph Qualifier & Periph Dev Type */
> inqdata[1] = 0;
> /* rem media bit & Dev Type Modifier */
> inqdata[2] = 0;
> /* ISO, ECMA, & ANSI versions */
> inqdata[4] = 31;
> /* length of additional data */
> strncpy(&inqdata[8], "Areca ", 8);
> /* Vendor Identification */
>>>> strncpy(&inqdata[16], "RAID controller ", 16);
> /* Product Identification */
> strncpy(&inqdata[32], "R001", 4); /* Product Revision */
> That strncpy() will indeed fail to copy the trailing null, but it looks
> like that null isn't appropriate in the inquiry data.
>
> So I suspect this is a valid usage of strncpy() and the checking is
> just too strict.
>
> otoh if this is the only place where we hit this issue then perhaps we
> can switch to memcpy() and get on with life ;)
Hmm, yes, I think you're right and gcc is being a bit ambitious here -
although I can understand the warning given that the behaviour relied
upon here is rarely going to be what the developer intendend!
We could build the file with -Wno-stringop-truncation, but I do wonder
if memcpy might make the semantics more obvious...
Regards,
Daniel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [hnaz-linux-mm:master 156/523] include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
2020-05-19 9:23 [hnaz-linux-mm:master 156/523] include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy' kbuild test robot
2020-05-19 14:42 ` Daniel Axtens
@ 2020-05-19 14:42 ` Daniel Axtens
1 sibling, 0 replies; 6+ messages in thread
From: Daniel Axtens @ 2020-05-19 14:42 UTC (permalink / raw)
To: kbuild test robot
Cc: kbuild-all, Johannes Weiner, Dmitry Vyukov, Andrew Morton,
Linux Memory Management List, linux-scsi
This looks like an underlying SCSI issue that this patch has just
happened to expose?
+ scsi list
kbuild test robot <lkp@intel.com> writes:
> tree: https://github.com/hnaz/linux-mm master
> head: 2bbf0589bfeb27800c730b76eacf34528eee5418
> commit: 854834b3859d2d80e31750f658bc8e4031422912 [156/523] string.h: fix incompatibility between FORTIFY_SOURCE and KASAN
> config: arm-allyesconfig (attached as .config)
> compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
> reproduce:
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> git checkout 854834b3859d2d80e31750f658bc8e4031422912
> # save the attached .config to linux build tree
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kbuild test robot <lkp@intel.com>
>
> All warnings (new ones prefixed by >>, old ones prefixed by <<):
>
> drivers/scsi/arcmsr/arcmsr_hba.c: In function 'arcmsr_remap_pciregion':
> drivers/scsi/arcmsr/arcmsr_hba.c:286:30: warning: variable 'flags' set but not used [-Wunused-but-set-variable]
> 286 | unsigned long addr, range, flags;
> | ^~~~~
> drivers/scsi/arcmsr/arcmsr_hba.c: In function 'arcmsr_suspend':
> drivers/scsi/arcmsr/arcmsr_hba.c:1070:11: warning: variable 'intmask_org' set but not used [-Wunused-but-set-variable]
> 1070 | uint32_t intmask_org;
> | ^~~~~~~~~~~
> drivers/scsi/arcmsr/arcmsr_hba.c: In function 'arcmsr_done4abort_postqueue':
> drivers/scsi/arcmsr/arcmsr_hba.c:1410:29: warning: variable 'cdb_phy_hipart' set but not used [-Wunused-but-set-variable]
> 1410 | unsigned long ccb_cdb_phy, cdb_phy_hipart;
> | ^~~~~~~~~~~~~~
> drivers/scsi/arcmsr/arcmsr_hba.c: In function 'arcmsr_hbaD_postqueue_isr':
> drivers/scsi/arcmsr/arcmsr_hba.c:2448:36: warning: variable 'cdb_phy_hipart' set but not used [-Wunused-but-set-variable]
> 2448 | unsigned long flags, ccb_cdb_phy, cdb_phy_hipart;
> | ^~~~~~~~~~~~~~
> drivers/scsi/arcmsr/arcmsr_hba.c: In function 'arcmsr_hbaD_polling_ccbdone':
> drivers/scsi/arcmsr/arcmsr_hba.c:3498:36: warning: variable 'cdb_phy_hipart' set but not used [-Wunused-but-set-variable]
> 3498 | unsigned long flags, ccb_cdb_phy, cdb_phy_hipart;
> | ^~~~~~~~~~~~~~
> In file included from include/linux/bitmap.h:9,
> from include/linux/nodemask.h:95,
> from include/linux/mmzone.h:17,
> from include/linux/gfp.h:6,
> from include/linux/umh.h:4,
> from include/linux/kmod.h:9,
> from include/linux/module.h:16,
> from drivers/scsi/arcmsr/arcmsr_hba.c:47:
> In function 'strncpy',
> inlined from 'arcmsr_handle_virtual_command' at drivers/scsi/arcmsr/arcmsr_hba.c:3059:3:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 4 bytes from a string of the same length [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> In function 'strncpy',
> inlined from 'arcmsr_handle_virtual_command' at drivers/scsi/arcmsr/arcmsr_hba.c:3057:3:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 16 bytes from a string of the same length [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> In function 'strncpy',
> inlined from 'arcmsr_handle_virtual_command' at drivers/scsi/arcmsr/arcmsr_hba.c:3055:3:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 8 bytes from a string of the same length [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> --
> In file included from include/linux/bitmap.h:9,
> from include/linux/nodemask.h:95,
> from include/linux/mmzone.h:17,
> from include/linux/gfp.h:6,
> from include/linux/slab.h:15,
> from drivers/scsi/pm8001/pm8001_sas.c:41:
> In function 'strncpy',
> inlined from 'pm8001_issue_ssp_tmf' at drivers/scsi/pm8001/pm8001_sas.c:919:2:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' specified bound 8 equals destination size [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> --
> drivers/scsi/ips.c: In function 'ips_init_copperhead':
> drivers/scsi/ips.c:4700:10: warning: variable 'ConfigByte' set but not used [-Wunused-but-set-variable]
> 4700 | uint8_t ConfigByte[IPS_MAX_CONFIG_BYTES];
> | ^~~~~~~~~~
> drivers/scsi/ips.c: In function 'ips_init_copperhead_memio':
> drivers/scsi/ips.c:4794:10: warning: variable 'ConfigByte' set but not used [-Wunused-but-set-variable]
> 4794 | uint8_t ConfigByte[IPS_MAX_CONFIG_BYTES];
> | ^~~~~~~~~~
> drivers/scsi/ips.c: In function 'ips_init_phase1':
> drivers/scsi/ips.c:6839:10: warning: variable 'func' set but not used [-Wunused-but-set-variable]
> 6839 | uint8_t func;
> | ^~~~
> drivers/scsi/ips.c:6838:10: warning: variable 'bus' set but not used [-Wunused-but-set-variable]
> 6838 | uint8_t bus;
> | ^~~
> In file included from arch/arm/include/asm/io.h:23,
> from drivers/scsi/ips.c:164:
> In function 'strncpy',
> inlined from 'ips_send_cmd' at drivers/scsi/ips.c:3522:6:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 4 bytes from a string of the same length [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> In function 'strncpy',
> inlined from 'ips_send_cmd' at drivers/scsi/ips.c:3520:6:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 16 bytes from a string of the same length [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> In function 'strncpy',
> inlined from 'ips_send_cmd' at drivers/scsi/ips.c:3518:6:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 8 bytes from a string of the same length [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> In function 'strncpy',
> inlined from 'ips_inquiry' at drivers/scsi/ips.c:4041:2:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 4 bytes from a string of the same length [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> In function 'strncpy',
> inlined from 'ips_inquiry' at drivers/scsi/ips.c:4040:2:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 16 bytes from a string of the same length [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> In function 'strncpy',
> inlined from 'ips_inquiry' at drivers/scsi/ips.c:4039:2:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 8 bytes from a string of the same length [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> In function 'strncpy',
> inlined from 'ips_get_bios_version' at drivers/scsi/ips.c:2242:2:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 8 bytes from a string of the same length [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> In function 'strncpy',
> inlined from 'ips_write_driver_status' at drivers/scsi/ips.c:5626:2:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 4 bytes from a string of the same length [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> In function 'strncpy',
> inlined from 'ips_write_driver_status' at drivers/scsi/ips.c:5625:2:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 4 bytes from a string of the same length [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> In function 'strncpy',
> inlined from 'ips_write_driver_status' at drivers/scsi/ips.c:5627:2,
> inlined from 'ips_hainit' at drivers/scsi/ips.c:2433:7:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' output may be truncated copying 4 bytes from a string of length 7 [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> In function 'strncpy',
> inlined from 'ips_write_driver_status' at drivers/scsi/ips.c:5628:2,
> inlined from 'ips_hainit' at drivers/scsi/ips.c:2433:7:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' specified bound 4 equals destination size [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> --
> drivers/scsi/3w-sas.c: In function 'twl_scsiop_execute_scsi':
> drivers/scsi/3w-sas.c:298:22: warning: variable 'sglist' set but not used [-Wunused-but-set-variable]
> 298 | struct scatterlist *sglist = NULL, *sg;
> | ^~~~~~
> drivers/scsi/3w-sas.c: In function 'twl_scsi_biosparam':
> drivers/scsi/3w-sas.c:1411:23: warning: variable 'tw_dev' set but not used [-Wunused-but-set-variable]
> 1411 | TW_Device_Extension *tw_dev;
> | ^~~~~~
> In file included from include/linux/bitmap.h:9,
> from include/linux/nodemask.h:95,
> from include/linux/mmzone.h:17,
> from include/linux/gfp.h:6,
> from include/linux/umh.h:4,
> from include/linux/kmod.h:9,
> from include/linux/module.h:16,
> from drivers/scsi/3w-sas.c:53:
> In function 'strncpy',
> inlined from 'twl_reset_sequence' at drivers/scsi/3w-sas.c:1331:3:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' output truncated before terminating nul copying 11 bytes from a string of the same length [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> --
> In file included from include/linux/bitmap.h:9,
> from include/linux/nodemask.h:95,
> from include/linux/mmzone.h:17,
> from include/linux/gfp.h:6,
> from include/linux/slab.h:15,
> from include/linux/crypto.h:19,
> from include/crypto/hash.h:11,
> from include/linux/uio.h:10,
> from include/linux/socket.h:8,
> from include/uapi/linux/if.h:25,
> from include/scsi/libfc.h:12,
> from drivers/scsi/libfc/fc_elsct.c:17:
> In function 'strncpy',
> inlined from 'fc_ct_ms_fill.constprop' at include/scsi/fc_encode.h:263:3:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' output may be truncated copying 64 bytes from a string of length 79 [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
> In function 'strncpy',
> inlined from 'fc_ct_ms_fill.constprop' at include/scsi/fc_encode.h:275:3:
> include/linux/string.h:297:30: warning: '__builtin_strncpy' output may be truncated copying 64 bytes from a string of length 79 [-Wstringop-truncation]
> 297 | #define __underlying_strncpy __builtin_strncpy
> | ^
>>> include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
> 307 | return __underlying_strncpy(p, q, size);
> | ^~~~~~~~~~~~~~~~~~~~
>
> vim +/__underlying_strncpy +307 include/linux/string.h
>
> 299
> 300 __FORTIFY_INLINE char *strncpy(char *p, const char *q, __kernel_size_t size)
> 301 {
> 302 size_t p_size = __builtin_object_size(p, 0);
> 303 if (__builtin_constant_p(size) && p_size < size)
> 304 __write_overflow();
> 305 if (p_size < size)
> 306 fortify_panic(__func__);
> > 307 return __underlying_strncpy(p, q, size);
> 308 }
> 309
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-05-20 3:57 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-19 9:23 [hnaz-linux-mm:master 156/523] include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy' kbuild test robot
2020-05-19 14:42 ` Daniel Axtens
2020-05-20 1:48 ` Andrew Morton
2020-05-20 2:08 ` Martin K. Petersen
2020-05-20 3:57 ` Daniel Axtens
2020-05-19 14:42 ` Daniel Axtens
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox