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: <202312190535.sXcZRYU4-lkp@intel.com>
Date: Tue, 19 Dec 2023 06:01:31 +0800
From: kernel test robot <lkp@...el.com>
To: Heiko Stuebner <heiko.stuebner@...ll.eu>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
	Palmer Dabbelt <palmer@...osinc.com>,
	Andrew Jones <ajones@...tanamicro.com>,
	Conor Dooley <conor.dooley@...rochip.com>
Subject: drivers/scsi/qedi/qedi_debugfs.c:109:45: sparse: sparse: incorrect
 type in argument 2 (different address spaces)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   2cf4f94d8e8646803f8fb0facf134b0cd7fb691a
commit: 56e0790c7f9e59ba6a0f4b59981d1d6fbf43efb0 RISC-V: add infrastructure to allow different str* implementations
date:   11 months ago
config: riscv-randconfig-r133-20231218 (https://download.01.org/0day-ci/archive/20231219/202312190535.sXcZRYU4-lkp@intel.com/config)
compiler: clang version 18.0.0git (https://github.com/llvm/llvm-project 5ac12951b4e9bbfcc5791282d0961ec2b65575e9)
reproduce: (https://download.01.org/0day-ci/archive/20231219/202312190535.sXcZRYU4-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/202312190535.sXcZRYU4-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   WARNING: invalid argument to '-march': '_zicbom_zihintpause'
>> drivers/scsi/qedi/qedi_debugfs.c:109:45: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected char const *ct @@     got char const [noderef] __user *buffer @@
   drivers/scsi/qedi/qedi_debugfs.c:109:45: sparse:     expected char const *ct
   drivers/scsi/qedi/qedi_debugfs.c:109:45: sparse:     got char const [noderef] __user *buffer
   drivers/scsi/qedi/qedi_debugfs.c:128:23: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected char *buf @@     got char [noderef] __user *buffer @@
   drivers/scsi/qedi/qedi_debugfs.c:128:23: sparse:     expected char *buf
   drivers/scsi/qedi/qedi_debugfs.c:128:23: sparse:     got char [noderef] __user *buffer
   drivers/scsi/qedi/qedi_debugfs.c:154:41: sparse: sparse: restricted __le16 degrades to integer

vim +109 drivers/scsi/qedi/qedi_debugfs.c

ace7f46ba5fde72 Manish Rangankar   2016-12-01   13  
bd571195c9535c0 Arnd Bergmann      2017-03-02  @14  int qedi_do_not_recover;
ace7f46ba5fde72 Manish Rangankar   2016-12-01   15  static struct dentry *qedi_dbg_root;
ace7f46ba5fde72 Manish Rangankar   2016-12-01   16  
ace7f46ba5fde72 Manish Rangankar   2016-12-01   17  void
ace7f46ba5fde72 Manish Rangankar   2016-12-01   18  qedi_dbg_host_init(struct qedi_dbg_ctx *qedi,
779936faf4f1210 Arnd Bergmann      2018-02-02   19  		   const struct qedi_debugfs_ops *dops,
ace7f46ba5fde72 Manish Rangankar   2016-12-01   20  		   const struct file_operations *fops)
ace7f46ba5fde72 Manish Rangankar   2016-12-01   21  {
ace7f46ba5fde72 Manish Rangankar   2016-12-01   22  	char host_dirname[32];
ace7f46ba5fde72 Manish Rangankar   2016-12-01   23  
ace7f46ba5fde72 Manish Rangankar   2016-12-01   24  	sprintf(host_dirname, "host%u", qedi->host_no);
ace7f46ba5fde72 Manish Rangankar   2016-12-01   25  	qedi->bdf_dentry = debugfs_create_dir(host_dirname, qedi_dbg_root);
ace7f46ba5fde72 Manish Rangankar   2016-12-01   26  
ace7f46ba5fde72 Manish Rangankar   2016-12-01   27  	while (dops) {
ace7f46ba5fde72 Manish Rangankar   2016-12-01   28  		if (!(dops->name))
ace7f46ba5fde72 Manish Rangankar   2016-12-01   29  			break;
ace7f46ba5fde72 Manish Rangankar   2016-12-01   30  
26febfb38c7d679 Greg Kroah-Hartman 2019-01-22   31  		debugfs_create_file(dops->name, 0600, qedi->bdf_dentry, qedi,
ace7f46ba5fde72 Manish Rangankar   2016-12-01   32  				    fops);
ace7f46ba5fde72 Manish Rangankar   2016-12-01   33  		dops++;
ace7f46ba5fde72 Manish Rangankar   2016-12-01   34  		fops++;
ace7f46ba5fde72 Manish Rangankar   2016-12-01   35  	}
ace7f46ba5fde72 Manish Rangankar   2016-12-01   36  }
ace7f46ba5fde72 Manish Rangankar   2016-12-01   37  
ace7f46ba5fde72 Manish Rangankar   2016-12-01   38  void
ace7f46ba5fde72 Manish Rangankar   2016-12-01   39  qedi_dbg_host_exit(struct qedi_dbg_ctx *qedi)
ace7f46ba5fde72 Manish Rangankar   2016-12-01   40  {
ace7f46ba5fde72 Manish Rangankar   2016-12-01   41  	debugfs_remove_recursive(qedi->bdf_dentry);
ace7f46ba5fde72 Manish Rangankar   2016-12-01   42  	qedi->bdf_dentry = NULL;
ace7f46ba5fde72 Manish Rangankar   2016-12-01   43  }
ace7f46ba5fde72 Manish Rangankar   2016-12-01   44  
ace7f46ba5fde72 Manish Rangankar   2016-12-01   45  void
ace7f46ba5fde72 Manish Rangankar   2016-12-01   46  qedi_dbg_init(char *drv_name)
ace7f46ba5fde72 Manish Rangankar   2016-12-01   47  {
ace7f46ba5fde72 Manish Rangankar   2016-12-01   48  	qedi_dbg_root = debugfs_create_dir(drv_name, NULL);
ace7f46ba5fde72 Manish Rangankar   2016-12-01   49  }
ace7f46ba5fde72 Manish Rangankar   2016-12-01   50  
ace7f46ba5fde72 Manish Rangankar   2016-12-01   51  void
ace7f46ba5fde72 Manish Rangankar   2016-12-01   52  qedi_dbg_exit(void)
ace7f46ba5fde72 Manish Rangankar   2016-12-01   53  {
ace7f46ba5fde72 Manish Rangankar   2016-12-01   54  	debugfs_remove_recursive(qedi_dbg_root);
ace7f46ba5fde72 Manish Rangankar   2016-12-01   55  	qedi_dbg_root = NULL;
ace7f46ba5fde72 Manish Rangankar   2016-12-01   56  }
ace7f46ba5fde72 Manish Rangankar   2016-12-01   57  
ace7f46ba5fde72 Manish Rangankar   2016-12-01   58  static ssize_t
ace7f46ba5fde72 Manish Rangankar   2016-12-01   59  qedi_dbg_do_not_recover_enable(struct qedi_dbg_ctx *qedi_dbg)
ace7f46ba5fde72 Manish Rangankar   2016-12-01   60  {
bd571195c9535c0 Arnd Bergmann      2017-03-02   61  	if (!qedi_do_not_recover)
bd571195c9535c0 Arnd Bergmann      2017-03-02   62  		qedi_do_not_recover = 1;
ace7f46ba5fde72 Manish Rangankar   2016-12-01   63  
ace7f46ba5fde72 Manish Rangankar   2016-12-01   64  	QEDI_INFO(qedi_dbg, QEDI_LOG_DEBUGFS, "do_not_recover=%d\n",
bd571195c9535c0 Arnd Bergmann      2017-03-02   65  		  qedi_do_not_recover);
ace7f46ba5fde72 Manish Rangankar   2016-12-01   66  	return 0;
ace7f46ba5fde72 Manish Rangankar   2016-12-01   67  }
ace7f46ba5fde72 Manish Rangankar   2016-12-01   68  
ace7f46ba5fde72 Manish Rangankar   2016-12-01   69  static ssize_t
ace7f46ba5fde72 Manish Rangankar   2016-12-01   70  qedi_dbg_do_not_recover_disable(struct qedi_dbg_ctx *qedi_dbg)
ace7f46ba5fde72 Manish Rangankar   2016-12-01   71  {
bd571195c9535c0 Arnd Bergmann      2017-03-02   72  	if (qedi_do_not_recover)
bd571195c9535c0 Arnd Bergmann      2017-03-02   73  		qedi_do_not_recover = 0;
ace7f46ba5fde72 Manish Rangankar   2016-12-01   74  
ace7f46ba5fde72 Manish Rangankar   2016-12-01   75  	QEDI_INFO(qedi_dbg, QEDI_LOG_DEBUGFS, "do_not_recover=%d\n",
bd571195c9535c0 Arnd Bergmann      2017-03-02   76  		  qedi_do_not_recover);
ace7f46ba5fde72 Manish Rangankar   2016-12-01   77  	return 0;
ace7f46ba5fde72 Manish Rangankar   2016-12-01   78  }
ace7f46ba5fde72 Manish Rangankar   2016-12-01   79  
ace7f46ba5fde72 Manish Rangankar   2016-12-01   80  static struct qedi_list_of_funcs qedi_dbg_do_not_recover_ops[] = {
ace7f46ba5fde72 Manish Rangankar   2016-12-01   81  	{ "enable", qedi_dbg_do_not_recover_enable },
ace7f46ba5fde72 Manish Rangankar   2016-12-01   82  	{ "disable", qedi_dbg_do_not_recover_disable },
ace7f46ba5fde72 Manish Rangankar   2016-12-01   83  	{ NULL, NULL }
ace7f46ba5fde72 Manish Rangankar   2016-12-01   84  };
ace7f46ba5fde72 Manish Rangankar   2016-12-01   85  
779936faf4f1210 Arnd Bergmann      2018-02-02   86  const struct qedi_debugfs_ops qedi_debugfs_ops[] = {
ace7f46ba5fde72 Manish Rangankar   2016-12-01   87  	{ "gbl_ctx", NULL },
ace7f46ba5fde72 Manish Rangankar   2016-12-01   88  	{ "do_not_recover", qedi_dbg_do_not_recover_ops},
ace7f46ba5fde72 Manish Rangankar   2016-12-01   89  	{ "io_trace", NULL },
ace7f46ba5fde72 Manish Rangankar   2016-12-01   90  	{ NULL, NULL }
ace7f46ba5fde72 Manish Rangankar   2016-12-01   91  };
ace7f46ba5fde72 Manish Rangankar   2016-12-01   92  
ace7f46ba5fde72 Manish Rangankar   2016-12-01   93  static ssize_t
ace7f46ba5fde72 Manish Rangankar   2016-12-01   94  qedi_dbg_do_not_recover_cmd_write(struct file *filp, const char __user *buffer,
ace7f46ba5fde72 Manish Rangankar   2016-12-01   95  				  size_t count, loff_t *ppos)
ace7f46ba5fde72 Manish Rangankar   2016-12-01   96  {
ace7f46ba5fde72 Manish Rangankar   2016-12-01   97  	size_t cnt = 0;
ace7f46ba5fde72 Manish Rangankar   2016-12-01   98  	struct qedi_dbg_ctx *qedi_dbg =
ace7f46ba5fde72 Manish Rangankar   2016-12-01   99  			(struct qedi_dbg_ctx *)filp->private_data;
ace7f46ba5fde72 Manish Rangankar   2016-12-01  100  	struct qedi_list_of_funcs *lof = qedi_dbg_do_not_recover_ops;
ace7f46ba5fde72 Manish Rangankar   2016-12-01  101  
ace7f46ba5fde72 Manish Rangankar   2016-12-01  102  	if (*ppos)
ace7f46ba5fde72 Manish Rangankar   2016-12-01  103  		return 0;
ace7f46ba5fde72 Manish Rangankar   2016-12-01  104  
ace7f46ba5fde72 Manish Rangankar   2016-12-01  105  	while (lof) {
ace7f46ba5fde72 Manish Rangankar   2016-12-01  106  		if (!(lof->oper_str))
ace7f46ba5fde72 Manish Rangankar   2016-12-01  107  			break;
ace7f46ba5fde72 Manish Rangankar   2016-12-01  108  
ace7f46ba5fde72 Manish Rangankar   2016-12-01 @109  		if (!strncmp(lof->oper_str, buffer, strlen(lof->oper_str))) {
ace7f46ba5fde72 Manish Rangankar   2016-12-01  110  			cnt = lof->oper_func(qedi_dbg);
ace7f46ba5fde72 Manish Rangankar   2016-12-01  111  			break;
ace7f46ba5fde72 Manish Rangankar   2016-12-01  112  		}
ace7f46ba5fde72 Manish Rangankar   2016-12-01  113  
ace7f46ba5fde72 Manish Rangankar   2016-12-01  114  		lof++;
ace7f46ba5fde72 Manish Rangankar   2016-12-01  115  	}
ace7f46ba5fde72 Manish Rangankar   2016-12-01  116  	return (count - cnt);
ace7f46ba5fde72 Manish Rangankar   2016-12-01  117  }
ace7f46ba5fde72 Manish Rangankar   2016-12-01  118  

:::::: The code at line 109 was first introduced by commit
:::::: ace7f46ba5fde7273207c7122b0650ceb72510e0 scsi: qedi: Add QLogic FastLinQ offload iSCSI driver framework.

:::::: TO: Manish Rangankar <manish.rangankar@...ium.com>
:::::: CC: Martin K. Petersen <martin.petersen@...cle.com>

-- 
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