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>] [thread-next>] [day] [month] [year] [list]
Message-ID: <202501170447.kNoyfjS5-lkp@intel.com>
Date: Fri, 17 Jan 2025 04:24:45 +0800
From: kernel test robot <lkp@...el.com>
To: Sean Anderson <sean.anderson@...ux.dev>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
	Tomi Valkeinen <tomi.valkeinen@...asonboard.com>
Subject: drivers/gpu/drm/xlnx/zynqmp_dp.c:2312:46: warning: 'snprintf' output
 may be truncated before the last format character

Hi Sean,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   ce69b4019001407f9cd738dd2ba217b3a8ab831b
commit: 28edaacb821c69241f6c0be6bbd29f7145f1b44f drm: zynqmp_dp: Add debugfs interface for compliance testing
date:   3 months ago
config: arm-randconfig-r013-20230520 (https://download.01.org/0day-ci/archive/20250117/202501170447.kNoyfjS5-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 12.4.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250117/202501170447.kNoyfjS5-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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202501170447.kNoyfjS5-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/gpu/drm/xlnx/zynqmp_dp.c: In function 'zynqmp_dp_bridge_debugfs_init':
>> drivers/gpu/drm/xlnx/zynqmp_dp.c:2312:46: warning: 'snprintf' output may be truncated before the last format character [-Wformat-truncation=]
    2312 |                 snprintf(name, sizeof(name), fmt, i);
         |                                              ^~~
   drivers/gpu/drm/xlnx/zynqmp_dp.c:2312:17: note: 'snprintf' output between 18 and 20 bytes into a destination of size 19
    2312 |                 snprintf(name, sizeof(name), fmt, i);
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/snprintf +2312 drivers/gpu/drm/xlnx/zynqmp_dp.c

  2278	
  2279	DEFINE_DEBUGFS_ATTRIBUTE(fops_zynqmp_dp_ignore_hpd, zynqmp_dp_ignore_hpd_get,
  2280				 zynqmp_dp_ignore_hpd_set, "%llu\n");
  2281	
  2282	static void zynqmp_dp_bridge_debugfs_init(struct drm_bridge *bridge,
  2283						  struct dentry *root)
  2284	{
  2285		struct zynqmp_dp *dp = bridge_to_dp(bridge);
  2286		struct dentry *test;
  2287		int i;
  2288	
  2289		dp->test.bw_code = DP_LINK_BW_5_4;
  2290		dp->test.link_cnt = dp->num_lanes;
  2291	
  2292		test = debugfs_create_dir("test", root);
  2293	#define CREATE_FILE(name) \
  2294		debugfs_create_file(#name, 0600, test, dp, &fops_zynqmp_dp_##name)
  2295		CREATE_FILE(pattern);
  2296		CREATE_FILE(enhanced);
  2297		CREATE_FILE(downspread);
  2298		CREATE_FILE(active);
  2299		CREATE_FILE(custom);
  2300		CREATE_FILE(rate);
  2301		CREATE_FILE(lanes);
  2302		CREATE_FILE(ignore_aux_errors);
  2303		CREATE_FILE(ignore_hpd);
  2304	
  2305		for (i = 0; i < dp->num_lanes; i++) {
  2306			static const char fmt[] = "lane%d_preemphasis";
  2307			char name[sizeof(fmt)];
  2308	
  2309			dp->debugfs_train_set[i].dp = dp;
  2310			dp->debugfs_train_set[i].lane = i;
  2311	
> 2312			snprintf(name, sizeof(name), fmt, i);
  2313			debugfs_create_file(name, 0600, test,
  2314					    &dp->debugfs_train_set[i],
  2315					    &fops_zynqmp_dp_preemphasis);
  2316	
  2317			snprintf(name, sizeof(name), "lane%d_swing", i);
  2318			debugfs_create_file(name, 0600, test,
  2319					    &dp->debugfs_train_set[i],
  2320					    &fops_zynqmp_dp_swing);
  2321		}
  2322	}
  2323	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ