mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* drivers/soc/qcom/socinfo.c:277 qcom_show_pmic_model() error: buffer overflow 'pmic_models' 26 <= 26
@ 2020-08-08  6:28 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-08-08  6:28 UTC (permalink / raw)
  To: Dmitry Baryshkov; +Cc: kbuild-all, linux-kernel, Bjorn Andersson

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   049eb096da48db0421dd5e358b9b082a1a8a2025
commit: e9247e2ce5778678c8d631e26ef79dbccedbe6d0 soc: qcom: socinfo: fix printing of pmic_model
date:   6 weeks ago
config: x86_64-randconfig-m001-20200808 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

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

New smatch warnings:
drivers/soc/qcom/socinfo.c:277 qcom_show_pmic_model() error: buffer overflow 'pmic_models' 26 <= 26

Old smatch warnings:
drivers/soc/qcom/socinfo.c:278 qcom_show_pmic_model() error: buffer overflow 'pmic_models' 26 <= 26

vim +/pmic_models +277 drivers/soc/qcom/socinfo.c

   268	
   269	static int qcom_show_pmic_model(struct seq_file *seq, void *p)
   270	{
   271		struct socinfo *socinfo = seq->private;
   272		int model = SOCINFO_MINOR(le32_to_cpu(socinfo->pmic_model));
   273	
   274		if (model < 0)
   275			return -EINVAL;
   276	
 > 277		if (model <= ARRAY_SIZE(pmic_models) && pmic_models[model])
   278			seq_printf(seq, "%s\n", pmic_models[model]);
   279		else
   280			seq_printf(seq, "unknown (%d)\n", model);
   281	
   282		return 0;
   283	}
   284	

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

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

only message in thread, other threads:[~2020-08-08  7:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-08  6:28 drivers/soc/qcom/socinfo.c:277 qcom_show_pmic_model() error: buffer overflow 'pmic_models' 26 <= 26 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

all inboxes | Powered by JetHome®