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]
Message-ID: <202211052204.2NexxC29-lkp@intel.com>
Date:   Mon, 7 Nov 2022 10:46:19 +0300
From:   Dan Carpenter <error27@...il.com>
To:     oe-kbuild@...ts.linux.dev, 'Guanjun' <guanjun@...ux.alibaba.com>,
        herbert@...dor.apana.org.au, elliott@....com
Cc:     lkp@...el.com, oe-kbuild-all@...ts.linux.dev,
        zelin.deng@...ux.alibaba.com, artie.ding@...ux.alibaba.com,
        guanjun@...ux.alibaba.com, linux-crypto@...r.kernel.org,
        linux-kernel@...r.kernel.org, xuchun.shang@...ux.alibaba.com
Subject: Re: [PATCH v3 RESEND 2/9] crypto/ycc: Add ycc ring configuration

Hi 'Guanjun',

https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Guanjun/Drivers-for-Alibaba-YCC-Yitian-Cryptography-Complex-cryptographic-accelerator/20221103-154448
base:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
patch link:    https://lore.kernel.org/r/1667461243-48652-3-git-send-email-guanjun%40linux.alibaba.com
patch subject: [PATCH v3 RESEND 2/9] crypto/ycc: Add ycc ring configuration
config: ia64-randconfig-m031-20221104
compiler: ia64-linux-gcc (GCC) 12.1.0

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

smatch warnings:
drivers/crypto/ycc/ycc_ring.c:132 ycc_create_ring_debugfs() warn: passing zero to 'PTR_ERR'
drivers/crypto/ycc/ycc_ring.c:381 ycc_select_ring() warn: variable dereferenced before check 'found' (see line 374)

vim +/PTR_ERR +132 drivers/crypto/ycc/ycc_ring.c

9f7d1fe6059378 Zelin Deng 2022-11-03  101  static int ycc_create_ring_debugfs(struct ycc_ring *ring)
9f7d1fe6059378 Zelin Deng 2022-11-03  102  {
9f7d1fe6059378 Zelin Deng 2022-11-03  103  	struct dentry *debugfs;
9f7d1fe6059378 Zelin Deng 2022-11-03  104  	char name[8];
9f7d1fe6059378 Zelin Deng 2022-11-03  105  
9f7d1fe6059378 Zelin Deng 2022-11-03  106  	if (!ring || !ring->ydev || !ring->ydev->debug_dir)
9f7d1fe6059378 Zelin Deng 2022-11-03  107  		return -EINVAL;
9f7d1fe6059378 Zelin Deng 2022-11-03  108  
9f7d1fe6059378 Zelin Deng 2022-11-03  109  	snprintf(name, sizeof(name), "ring%02d", ring->ring_id);
9f7d1fe6059378 Zelin Deng 2022-11-03  110  	debugfs = debugfs_create_dir(name, ring->ydev->debug_dir);
9f7d1fe6059378 Zelin Deng 2022-11-03  111  	if (IS_ERR_OR_NULL(debugfs))
9f7d1fe6059378 Zelin Deng 2022-11-03  112  		goto out;
9f7d1fe6059378 Zelin Deng 2022-11-03  113  
9f7d1fe6059378 Zelin Deng 2022-11-03  114  	ring->debug_dir = debugfs;

The static checker is correct to complain.  Debugfs code is not required
to be checked.  It should just be:

	ring->debug_dir = debugfs_create_dir(name, ring->ydev->debug_dir);

	debugfs_create_file("status", 0400, ring->debug_dir, (void *)ring,
			    &ycc_ring_status_fops);
	debugfs_create_file("dump", 0400, ring->debug_dir, (void *)ring,
			    &ycc_ring_dump_fops);

	return 0;

9f7d1fe6059378 Zelin Deng 2022-11-03  115  
9f7d1fe6059378 Zelin Deng 2022-11-03  116  	debugfs = debugfs_create_file("status", 0400, ring->debug_dir,
9f7d1fe6059378 Zelin Deng 2022-11-03  117  				      (void *)ring, &ycc_ring_status_fops);
9f7d1fe6059378 Zelin Deng 2022-11-03  118  	if (IS_ERR_OR_NULL(debugfs))
9f7d1fe6059378 Zelin Deng 2022-11-03  119  		goto remove_debugfs;
9f7d1fe6059378 Zelin Deng 2022-11-03  120  
9f7d1fe6059378 Zelin Deng 2022-11-03  121  	debugfs = debugfs_create_file("dump", 0400, ring->debug_dir,
9f7d1fe6059378 Zelin Deng 2022-11-03  122  				      (void *)ring, &ycc_ring_dump_fops);
9f7d1fe6059378 Zelin Deng 2022-11-03  123  	if (IS_ERR_OR_NULL(debugfs))
9f7d1fe6059378 Zelin Deng 2022-11-03  124  		goto remove_debugfs;
9f7d1fe6059378 Zelin Deng 2022-11-03  125  
9f7d1fe6059378 Zelin Deng 2022-11-03  126  	return 0;
9f7d1fe6059378 Zelin Deng 2022-11-03  127  
9f7d1fe6059378 Zelin Deng 2022-11-03  128  remove_debugfs:
9f7d1fe6059378 Zelin Deng 2022-11-03  129  	debugfs_remove_recursive(ring->debug_dir);
9f7d1fe6059378 Zelin Deng 2022-11-03  130  out:
9f7d1fe6059378 Zelin Deng 2022-11-03  131  	ring->debug_dir = NULL;
9f7d1fe6059378 Zelin Deng 2022-11-03 @132  	return PTR_ERR(debugfs);
9f7d1fe6059378 Zelin Deng 2022-11-03  133  }

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ