linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* security/selinux/hooks.c:6620:2: warning: 'strncpy' specified bound 64 equals destination size
@ 2020-09-23  6:09 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-09-23  6:09 UTC (permalink / raw)
  To: Anshuman Khandual
  Cc: kbuild-all, linux-kernel, Andrew Morton,
	Linux Memory Management List, Vlastimil Babka

[-- Attachment #1: Type: text/plain, Size: 3887 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   805c6d3c19210c90c109107d189744e960eae025
commit: c62da0c35d58518ddb26ff641d2485596567fd96 mm/vma: define a default value for VM_DATA_DEFAULT_FLAGS
date:   6 months ago
config: microblaze-randconfig-r033-20200923 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout c62da0c35d58518ddb26ff641d2485596567fd96
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=microblaze 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   security/selinux/hooks.c: In function 'selinux_ib_endport_manage_subnet':
>> security/selinux/hooks.c:6620:2: warning: 'strncpy' specified bound 64 equals destination size [-Wstringop-truncation]
    6620 |  strncpy(ibendport.dev_name, dev_name, sizeof(ibendport.dev_name));
         |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c62da0c35d58518ddb26ff641d2485596567fd96
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout c62da0c35d58518ddb26ff641d2485596567fd96
vim +/strncpy +6620 security/selinux/hooks.c

cfc4d882d41780 Daniel Jurgens  2017-05-19  6603  
ab861dfca1652a Daniel Jurgens  2017-05-19  6604  static int selinux_ib_endport_manage_subnet(void *ib_sec, const char *dev_name,
ab861dfca1652a Daniel Jurgens  2017-05-19  6605  					    u8 port_num)
ab861dfca1652a Daniel Jurgens  2017-05-19  6606  {
ab861dfca1652a Daniel Jurgens  2017-05-19  6607  	struct common_audit_data ad;
ab861dfca1652a Daniel Jurgens  2017-05-19  6608  	int err;
ab861dfca1652a Daniel Jurgens  2017-05-19  6609  	u32 sid = 0;
ab861dfca1652a Daniel Jurgens  2017-05-19  6610  	struct ib_security_struct *sec = ib_sec;
ab861dfca1652a Daniel Jurgens  2017-05-19  6611  	struct lsm_ibendport_audit ibendport;
ab861dfca1652a Daniel Jurgens  2017-05-19  6612  
aa8e712cee93d5 Stephen Smalley 2018-03-01  6613  	err = security_ib_endport_sid(&selinux_state, dev_name, port_num,
aa8e712cee93d5 Stephen Smalley 2018-03-01  6614  				      &sid);
ab861dfca1652a Daniel Jurgens  2017-05-19  6615  
ab861dfca1652a Daniel Jurgens  2017-05-19  6616  	if (err)
ab861dfca1652a Daniel Jurgens  2017-05-19  6617  		return err;
70a5bb72b55e82 David Howells   2008-04-29  6618  
ab861dfca1652a Daniel Jurgens  2017-05-19  6619  	ad.type = LSM_AUDIT_DATA_IBENDPORT;
ab861dfca1652a Daniel Jurgens  2017-05-19 @6620  	strncpy(ibendport.dev_name, dev_name, sizeof(ibendport.dev_name));
ab861dfca1652a Daniel Jurgens  2017-05-19  6621  	ibendport.port = port_num;
ab861dfca1652a Daniel Jurgens  2017-05-19  6622  	ad.u.ibendport = &ibendport;
6b6bc6205d9879 Stephen Smalley 2018-03-05  6623  	return avc_has_perm(&selinux_state,
6b6bc6205d9879 Stephen Smalley 2018-03-05  6624  			    sec->sid, sid,
ab861dfca1652a Daniel Jurgens  2017-05-19  6625  			    SECCLASS_INFINIBAND_ENDPORT,
ab861dfca1652a Daniel Jurgens  2017-05-19  6626  			    INFINIBAND_ENDPORT__MANAGE_SUBNET, &ad);
ab861dfca1652a Daniel Jurgens  2017-05-19  6627  }
ab861dfca1652a Daniel Jurgens  2017-05-19  6628  

:::::: The code at line 6620 was first introduced by commit
:::::: ab861dfca1652aa09b26b7aa2899feb29b33dfd9 selinux: Add IB Port SMP access vector

:::::: TO: Daniel Jurgens <danielj@mellanox.com>
:::::: CC: Paul Moore <paul@paul-moore.com>

---
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: 29620 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-23  6:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-23  6:09 security/selinux/hooks.c:6620:2: warning: 'strncpy' specified bound 64 equals destination size kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox