[cgroup:for-next 8/8] kernel/cgroup/cgroup.c:1400:3: warning: ignoring return value of 'strscpy', declared with attribute warn_unused_result

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git for-next
head:   e7fd37ba12170cc414be8b639dfc2c5f7172fac2
commit: e7fd37ba12170cc414be8b639dfc2c5f7172fac2 [8/8] cgroup: avoid copying strings longer than the buffers
config: ia64-defconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 7.2.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 e7fd37ba12170cc414be8b639dfc2c5f7172fac2
        # save the attached .config to linux build tree
        make.cross ARCH=ia64 

All warnings (new ones prefixed by >>):

   kernel/cgroup/cgroup.c: In function 'cgroup_file_name':
>> kernel/cgroup/cgroup.c:1400:3: warning: ignoring return value of 'strscpy', declared with attribute warn_unused_result [-Wunused-result]
      strscpy(buf, cft->name, CGROUP_FILE_NAME_MAX);
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/cgroup/cgroup.c: In function 'init_cgroup_root':
   kernel/cgroup/cgroup.c:1867:3: warning: ignoring return value of 'strscpy', declared with attribute warn_unused_result [-Wunused-result]
      strscpy(root->release_agent_path, opts->release_agent, PATH_MAX);
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/cgroup/cgroup.c:1869:3: warning: ignoring return value of 'strscpy', declared with attribute warn_unused_result [-Wunused-result]
      strscpy(root->name, opts->name, MAX_CGROUP_ROOT_NAMELEN);
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/strscpy +1400 kernel/cgroup/cgroup.c

  1388	
  1389	static char *cgroup_file_name(struct cgroup *cgrp, const struct cftype *cft,
  1390				      char *buf)
  1391	{
  1392		struct cgroup_subsys *ss = cft->ss;
  1393	
  1394		if (cft->ss && !(cft->flags & CFTYPE_NO_PREFIX) &&
  1395		    !(cgrp->root->flags & CGRP_ROOT_NOPREFIX))
  1396			snprintf(buf, CGROUP_FILE_NAME_MAX, "%s.%s",
  1397				 cgroup_on_dfl(cgrp) ? ss->name : ss->legacy_name,
  1398				 cft->name);
  1399		else
> 1400			strscpy(buf, cft->name, CGROUP_FILE_NAME_MAX);
  1401		return buf;
  1402	}
  1403	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [Monitors]

  Powered by Linux