lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202111121014.WEzNHeyr-lkp@intel.com>
Date:   Fri, 12 Nov 2021 10:33:24 +0800
From:   kernel test robot <lkp@...el.com>
To:     Sidraya <sidraya.bj@...hpartnertech.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Praneeth Bajjuri <praneeth@...com>,
        Sunita Nadampalli <sunitan@...com>
Subject: [ti:ti-rt-linux-5.10.y 10189/10194]
 drivers/media/platform/vxe-vxd/encoder/vxe_v4l2.c:1339:25: warning:
 'strncpy' specified bound 32 equals destination size

Hi Sidraya,

First bad commit (maybe != root cause):

tree:   git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git ti-rt-linux-5.10.y
head:   aafb1bd67f22b44cf5f8072266002696adaa21b0
commit: caf6d714b87dee7429cb6b9cf60a3cba0061bfd6 [10189/10194] media: platform: Kconfig: Add Video decoder Kconfig and Makefile
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 11.2.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 remote add ti git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git
        git fetch --no-tags ti ti-rt-linux-5.10.y
        git checkout caf6d714b87dee7429cb6b9cf60a3cba0061bfd6
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=ia64 

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

All warnings (new ones prefixed by >>):

   drivers/media/platform/vxe-vxd/encoder/vxe_v4l2.c: In function 'vxe_query_ext_ctrl':
>> drivers/media/platform/vxe-vxd/encoder/vxe_v4l2.c:1339:25: warning: 'strncpy' specified bound 32 equals destination size [-Wstringop-truncation]
    1339 |                         strncpy(query->name, controls[i].name, sizeof(query->name));
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/vxe-vxd/encoder/vxe_v4l2.c:1316:33: warning: 'strncpy' specified bound 32 equals destination size [-Wstringop-truncation]
    1316 |                                 strncpy(query->name, controls[i].name, sizeof(query->name));
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/vxe-vxd/encoder/vxe_v4l2.c: In function 'vxe_queryctrl':
   drivers/media/platform/vxe-vxd/encoder/vxe_v4l2.c:1281:25: warning: 'strncpy' specified bound 32 equals destination size [-Wstringop-truncation]
    1281 |                         strncpy(query->name, controls[i].name, sizeof(query->name));
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/platform/vxe-vxd/encoder/vxe_v4l2.c:1264:33: warning: 'strncpy' specified bound 32 equals destination size [-Wstringop-truncation]
    1264 |                                 strncpy(query->name, controls[i].name, sizeof(query->name));
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/strncpy +1339 drivers/media/platform/vxe-vxd/encoder/vxe_v4l2.c

146db0290a0031 Sidraya 2021-11-02  1293  
146db0290a0031 Sidraya 2021-11-02  1294  static int vxe_query_ext_ctrl(struct file *file, void *priv,
146db0290a0031 Sidraya 2021-11-02  1295  			      struct v4l2_query_ext_ctrl *query)
146db0290a0031 Sidraya 2021-11-02  1296  {
146db0290a0031 Sidraya 2021-11-02  1297  	unsigned int queryid;
146db0290a0031 Sidraya 2021-11-02  1298  	int i, j;
146db0290a0031 Sidraya 2021-11-02  1299  
146db0290a0031 Sidraya 2021-11-02  1300  	query->reserved[0] = 0;
146db0290a0031 Sidraya 2021-11-02  1301  	query->reserved[1] = 0;
146db0290a0031 Sidraya 2021-11-02  1302  
146db0290a0031 Sidraya 2021-11-02  1303  	/* Enumerate controls */
146db0290a0031 Sidraya 2021-11-02  1304  	if ((query->id & V4L2_CTRL_FLAG_NEXT_CTRL) ||
146db0290a0031 Sidraya 2021-11-02  1305  	    (query->id & V4L2_CTRL_FLAG_NEXT_COMPOUND)) {
146db0290a0031 Sidraya 2021-11-02  1306  		queryid = query->id;
146db0290a0031 Sidraya 2021-11-02  1307  		queryid &= ~V4L2_CTRL_FLAG_NEXT_CTRL;
146db0290a0031 Sidraya 2021-11-02  1308  		queryid &= ~V4L2_CTRL_FLAG_NEXT_COMPOUND;
146db0290a0031 Sidraya 2021-11-02  1309  		for (i = 0; i < ARRAY_SIZE(controls); i++) {
146db0290a0031 Sidraya 2021-11-02  1310  			if (((!controls[i].compound && (query->id & V4L2_CTRL_FLAG_NEXT_CTRL)) ||
146db0290a0031 Sidraya 2021-11-02  1311  			     (controls[i].compound &&
146db0290a0031 Sidraya 2021-11-02  1312  				(query->id & V4L2_CTRL_FLAG_NEXT_COMPOUND))) &&
146db0290a0031 Sidraya 2021-11-02  1313  				controls[i].cid > queryid) {
146db0290a0031 Sidraya 2021-11-02  1314  				query->id = controls[i].cid;
146db0290a0031 Sidraya 2021-11-02  1315  				query->type = controls[i].type;
146db0290a0031 Sidraya 2021-11-02  1316  				strncpy(query->name, controls[i].name, sizeof(query->name));
146db0290a0031 Sidraya 2021-11-02  1317  				query->minimum = controls[i].minimum;
146db0290a0031 Sidraya 2021-11-02  1318  				query->maximum = controls[i].maximum;
146db0290a0031 Sidraya 2021-11-02  1319  				query->step = controls[i].step;
146db0290a0031 Sidraya 2021-11-02  1320  				query->default_value = controls[i].default_value;
146db0290a0031 Sidraya 2021-11-02  1321  				/* Our supported controls use int values */
146db0290a0031 Sidraya 2021-11-02  1322  				query->elem_size = 4;
146db0290a0031 Sidraya 2021-11-02  1323  				query->elems  = 1;
146db0290a0031 Sidraya 2021-11-02  1324  				query->nr_of_dims = 0;
146db0290a0031 Sidraya 2021-11-02  1325  				for (j = 0; j < V4L2_CTRL_MAX_DIMS; j++)
146db0290a0031 Sidraya 2021-11-02  1326  					query->dims[j] = 0;
146db0290a0031 Sidraya 2021-11-02  1327  				query->flags = 0;
146db0290a0031 Sidraya 2021-11-02  1328  				return 0;
146db0290a0031 Sidraya 2021-11-02  1329  			}
146db0290a0031 Sidraya 2021-11-02  1330  		}
146db0290a0031 Sidraya 2021-11-02  1331  		return -EINVAL;
146db0290a0031 Sidraya 2021-11-02  1332  	}
146db0290a0031 Sidraya 2021-11-02  1333  
146db0290a0031 Sidraya 2021-11-02  1334  	/* Return info on requested control */
146db0290a0031 Sidraya 2021-11-02  1335  	for (i = 0; i < ARRAY_SIZE(controls); i++) {
146db0290a0031 Sidraya 2021-11-02  1336  		if (controls[i].cid == query->id) {
146db0290a0031 Sidraya 2021-11-02  1337  			query->id = controls[i].cid;
146db0290a0031 Sidraya 2021-11-02  1338  			query->type = controls[i].type;
146db0290a0031 Sidraya 2021-11-02 @1339  			strncpy(query->name, controls[i].name, sizeof(query->name));
146db0290a0031 Sidraya 2021-11-02  1340  			query->minimum = controls[i].minimum;
146db0290a0031 Sidraya 2021-11-02  1341  			query->maximum = controls[i].maximum;
146db0290a0031 Sidraya 2021-11-02  1342  			query->step = controls[i].step;
146db0290a0031 Sidraya 2021-11-02  1343  			query->default_value = controls[i].default_value;
146db0290a0031 Sidraya 2021-11-02  1344  			/* Our supported controls use int values */
146db0290a0031 Sidraya 2021-11-02  1345  			query->elem_size = 4;
146db0290a0031 Sidraya 2021-11-02  1346  			query->elems  = 1;
146db0290a0031 Sidraya 2021-11-02  1347  			query->nr_of_dims = 0;
146db0290a0031 Sidraya 2021-11-02  1348  			for (j = 0; j < V4L2_CTRL_MAX_DIMS; j++)
146db0290a0031 Sidraya 2021-11-02  1349  				query->dims[j] = 0;
146db0290a0031 Sidraya 2021-11-02  1350  			query->flags = 0;
146db0290a0031 Sidraya 2021-11-02  1351  			return 0;
146db0290a0031 Sidraya 2021-11-02  1352  		}
146db0290a0031 Sidraya 2021-11-02  1353  	}
146db0290a0031 Sidraya 2021-11-02  1354  
146db0290a0031 Sidraya 2021-11-02  1355  	return -EINVAL;
146db0290a0031 Sidraya 2021-11-02  1356  }
146db0290a0031 Sidraya 2021-11-02  1357  

:::::: The code at line 1339 was first introduced by commit
:::::: 146db0290a0031e16b682f63d665bfaa8ebaf24a v4l: vxe-enc: Add IMG Encoder v4l2 Driver Interface function implementations

:::::: TO: Sidraya <sidraya.bj@...hpartnertech.com>
:::::: CC: Praneeth Bajjuri <praneeth@...com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Download attachment ".config.gz" of type "application/gzip" (62711 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ