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-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 2 Dec 2022 02:42:26 +0800
From:   kernel test robot <lkp@...el.com>
To:     Di Shen <di.shen@...soc.com>, rafael@...nel.org,
        daniel.lezcano@...aro.org, amitk@...nel.org, rui.zhang@...el.com
Cc:     oe-kbuild-all@...ts.linux.dev, linux-pm@...r.kernel.org,
        linux-kernel@...r.kernel.org, xuewen.yan@...soc.com
Subject: Re: [PATCH] thermal/of: Allow users to set governor for a thermal
 zone in DT

Hi Di,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on rafael-pm/thermal]
[also build test WARNING on linus/master v6.1-rc7 next-20221201]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Di-Shen/thermal-of-Allow-users-to-set-governor-for-a-thermal-zone-in-DT/20221201-165820
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git thermal
patch link:    https://lore.kernel.org/r/20221201085423.10360-1-di.shen%40unisoc.com
patch subject: [PATCH] thermal/of: Allow users to set governor for a thermal zone in DT
config: ia64-allyesconfig
compiler: ia64-linux-gcc (GCC) 12.1.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
        # https://github.com/intel-lab-lkp/linux/commit/6ac4585641eca02d031f54111ca54507d5a3dc56
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Di-Shen/thermal-of-Allow-users-to-set-governor-for-a-thermal-zone-in-DT/20221201-165820
        git checkout 6ac4585641eca02d031f54111ca54507d5a3dc56
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=ia64 SHELL=/bin/bash drivers/

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

All warnings (new ones prefixed by >>):

   In function 'thermal_of_parameters_init',
       inlined from 'thermal_of_zone_register' at drivers/thermal/thermal_of.c:626:8:
>> drivers/thermal/thermal_of.c:370:17: warning: 'strncpy' specified bound 20 equals destination size [-Wstringop-truncation]
     370 |                 strncpy(tzp->governor_name, governor_name, THERMAL_NAME_LENGTH);
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/strncpy +370 drivers/thermal/thermal_of.c

   351	
   352	static struct thermal_zone_params *thermal_of_parameters_init(struct device_node *np)
   353	{
   354		struct thermal_zone_params *tzp;
   355		int coef[2];
   356		int ncoef = ARRAY_SIZE(coef);
   357		int prop, ret;
   358		const char *governor_name;
   359	
   360		tzp = kzalloc(sizeof(*tzp), GFP_KERNEL);
   361		if (!tzp)
   362			return ERR_PTR(-ENOMEM);
   363	
   364		tzp->no_hwmon = true;
   365	
   366		if (!of_property_read_u32(np, "sustainable-power", &prop))
   367			tzp->sustainable_power = prop;
   368	
   369		if (!of_property_read_string(np, "policy", &governor_name))
 > 370			strncpy(tzp->governor_name, governor_name, THERMAL_NAME_LENGTH);
   371	
   372		/*
   373		 * For now, the thermal framework supports only one sensor per
   374		 * thermal zone. Thus, we are considering only the first two
   375		 * values as slope and offset.
   376		 */
   377		ret = of_property_read_u32_array(np, "coefficients", coef, ncoef);
   378		if (ret) {
   379			coef[0] = 1;
   380			coef[1] = 0;
   381		}
   382	
   383		tzp->slope = coef[0];
   384		tzp->offset = coef[1];
   385	
   386		return tzp;
   387	}
   388	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (321658 bytes)

Powered by blists - more mailing lists