:::::: :::::: Manual check reason: "low confidence bisect report" :::::: Manual check reason: "low confidence static check warning: fs/9p/vfs_super.c:117:24: warning: use of uninitialized value '<unknown>' [CWE-457] [-Wanalyzer-use-of-uninitialized-value]" ::::::
BCC: [email protected] CC: [email protected] CC: [email protected] TO: Dominique Martinet <[email protected]> CC: Tyler Hicks <[email protected]> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 521a547ced6477c54b4b0cc206000406c221b4d6 commit: dafbe689736f62c696ac64809b17bdc752cfbe76 9p fid refcount: cleanup p9_fid_put calls date: 3 months ago :::::: branch date: 19 hours ago :::::: commit date: 3 months ago config: arm-randconfig-c002-20220917 (https://download.01.org/0day-ci/archive/20220919/[email protected]/config) compiler: arm-linux-gnueabi-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://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=dafbe689736f62c696ac64809b17bdc752cfbe76 git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git git fetch --no-tags linus master git checkout dafbe689736f62c696ac64809b17bdc752cfbe76 # save the config file COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross ARCH=arm KBUILD_USERCFLAGS='-fanalyzer -Wno-error' If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot <[email protected]> gcc_analyzer warnings: (new ones prefixed by >>) fs/9p/vfs_super.c: In function 'v9fs_mount': >> fs/9p/vfs_super.c:117:24: warning: use of uninitialized value '<unknown>' >> [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 117 | struct p9_fid *fid; | ^~~ 'v9fs_mount': event 1 | | 117 | struct p9_fid *fid; | | ^~~ | | | | | (1) use of uninitialized value '<unknown>' here | -- fs/9p/vfs_file.c: In function 'v9fs_file_open': >> fs/9p/vfs_file.c:47:24: warning: use of uninitialized value '<unknown>' >> [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 47 | struct p9_fid *fid, *writeback_fid; | ^~~ 'v9fs_file_open': event 1 | | 47 | struct p9_fid *fid, *writeback_fid; | | ^~~ | | | | | (1) use of uninitialized value '<unknown>' here | vim +117 fs/9p/vfs_super.c 9e82cf6a802a72 Eric Van Hensbergen 2005-09-09 99 9e82cf6a802a72 Eric Van Hensbergen 2005-09-09 100 /** d2d1ea93069bd7 Al Viro 2010-07-25 101 * v9fs_mount - mount a superblock 9e82cf6a802a72 Eric Van Hensbergen 2005-09-09 102 * @fs_type: file system type 9e82cf6a802a72 Eric Van Hensbergen 2005-09-09 103 * @flags: mount flags 9e82cf6a802a72 Eric Van Hensbergen 2005-09-09 104 * @dev_name: device name that was mounted 9e82cf6a802a72 Eric Van Hensbergen 2005-09-09 105 * @data: mount options 9e82cf6a802a72 Eric Van Hensbergen 2005-09-09 106 * 9e82cf6a802a72 Eric Van Hensbergen 2005-09-09 107 */ 9e82cf6a802a72 Eric Van Hensbergen 2005-09-09 108 d2d1ea93069bd7 Al Viro 2010-07-25 109 static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags, d2d1ea93069bd7 Al Viro 2010-07-25 110 const char *dev_name, void *data) 9e82cf6a802a72 Eric Van Hensbergen 2005-09-09 111 { 9e82cf6a802a72 Eric Van Hensbergen 2005-09-09 112 struct super_block *sb = NULL; 9e82cf6a802a72 Eric Van Hensbergen 2005-09-09 113 struct inode *inode = NULL; 9e82cf6a802a72 Eric Van Hensbergen 2005-09-09 114 struct dentry *root = NULL; 9e82cf6a802a72 Eric Van Hensbergen 2005-09-09 115 struct v9fs_session_info *v9ses = NULL; 6e195b0f7c8e50 Dominique Martinet 2021-11-02 116 umode_t mode = 0777 | S_ISVTX; bd238fb431f319 Latchesar Ionkov 2007-07-10 @117 struct p9_fid *fid; 9e82cf6a802a72 Eric Van Hensbergen 2005-09-09 118 int retval = 0; 9e82cf6a802a72 Eric Van Hensbergen 2005-09-09 119 5d3851530d6d68 Joe Perches 2011-11-28 120 p9_debug(P9_DEBUG_VFS, "\n"); 9e82cf6a802a72 Eric Van Hensbergen 2005-09-09 121 1dac06b20dcc80 Latchesar Ionkov 2006-01-08 122 v9ses = kzalloc(sizeof(struct v9fs_session_info), GFP_KERNEL); 9e82cf6a802a72 Eric Van Hensbergen 2005-09-09 123 if (!v9ses) d2d1ea93069bd7 Al Viro 2010-07-25 124 return ERR_PTR(-ENOMEM); 9e82cf6a802a72 Eric Van Hensbergen 2005-09-09 125 bd238fb431f319 Latchesar Ionkov 2007-07-10 126 fid = v9fs_session_init(v9ses, dev_name, data); bd238fb431f319 Latchesar Ionkov 2007-07-10 127 if (IS_ERR(fid)) { bd238fb431f319 Latchesar Ionkov 2007-07-10 128 retval = PTR_ERR(fid); 412a19b64ad17f Tejun Heo 2015-06-08 129 goto free_session; bd238fb431f319 Latchesar Ionkov 2007-07-10 130 } bd238fb431f319 Latchesar Ionkov 2007-07-10 131 9249e17fe094d8 David Howells 2012-06-25 132 sb = sget(fs_type, NULL, v9fs_set_super, flags, v9ses); 454e2398be9b9f David Howells 2006-06-23 133 if (IS_ERR(sb)) { 454e2398be9b9f David Howells 2006-06-23 134 retval = PTR_ERR(sb); f085312204f384 Sripathi Kodi 2010-07-12 135 goto clunk_fid; 454e2398be9b9f David Howells 2006-06-23 136 } aafee43b72863f Bharath Vedartham 2019-05-23 137 retval = v9fs_fill_super(sb, v9ses, flags); 71304feba33f4b Jan Kara 2017-04-12 138 if (retval) 71304feba33f4b Jan Kara 2017-04-12 139 goto release_sb; 9e82cf6a802a72 Eric Van Hensbergen 2005-09-09 140 fb89b45cdfdc8b Dominique Martinet 2014-01-10 141 if (v9ses->cache == CACHE_LOOSE || v9ses->cache == CACHE_FSCACHE) 98cd3fb0a2c376 Al Viro 2011-01-12 142 sb->s_d_op = &v9fs_cached_dentry_operations; 98cd3fb0a2c376 Al Viro 2011-01-12 143 else 98cd3fb0a2c376 Al Viro 2011-01-12 144 sb->s_d_op = &v9fs_dentry_operations; 98cd3fb0a2c376 Al Viro 2011-01-12 145 45089142b1497d Aneesh Kumar K.V 2011-07-25 146 inode = v9fs_get_inode(sb, S_IFDIR | mode, 0); 9e82cf6a802a72 Eric Van Hensbergen 2005-09-09 147 if (IS_ERR(inode)) { 9e82cf6a802a72 Eric Van Hensbergen 2005-09-09 148 retval = PTR_ERR(inode); 887b3ece65be7b Eric Van Hensbergen 2008-05-08 149 goto release_sb; 9e82cf6a802a72 Eric Van Hensbergen 2005-09-09 150 } df5d8c80f1871d Aneesh Kumar K.V 2011-03-24 151 48fde701aff662 Al Viro 2012-01-08 152 root = d_make_root(inode); 9e82cf6a802a72 Eric Van Hensbergen 2005-09-09 153 if (!root) { 9e82cf6a802a72 Eric Van Hensbergen 2005-09-09 154 retval = -ENOMEM; 887b3ece65be7b Eric Van Hensbergen 2008-05-08 155 goto release_sb; 9e82cf6a802a72 Eric Van Hensbergen 2005-09-09 156 } 9e82cf6a802a72 Eric Van Hensbergen 2005-09-09 157 sb->s_root = root; f085312204f384 Sripathi Kodi 2010-07-12 158 if (v9fs_proto_dotl(v9ses)) { f085312204f384 Sripathi Kodi 2010-07-12 159 struct p9_stat_dotl *st = NULL; 6e195b0f7c8e50 Dominique Martinet 2021-11-02 160 f085312204f384 Sripathi Kodi 2010-07-12 161 st = p9_client_getattr_dotl(fid, P9_STATS_BASIC); f085312204f384 Sripathi Kodi 2010-07-12 162 if (IS_ERR(st)) { f085312204f384 Sripathi Kodi 2010-07-12 163 retval = PTR_ERR(st); 5c25f347a7b00b Aneesh Kumar K.V 2010-08-24 164 goto release_sb; f085312204f384 Sripathi Kodi 2010-07-12 165 } 2b0143b5c986be David Howells 2015-03-17 166 d_inode(root)->i_ino = v9fs_qid2ino(&st->qid); 5e3cc1ee1405a7 Hou Tao 2019-01-24 167 v9fs_stat2inode_dotl(st, d_inode(root), 0); f085312204f384 Sripathi Kodi 2010-07-12 168 kfree(st); f085312204f384 Sripathi Kodi 2010-07-12 169 } else { f085312204f384 Sripathi Kodi 2010-07-12 170 struct p9_wstat *st = NULL; 6e195b0f7c8e50 Dominique Martinet 2021-11-02 171 f085312204f384 Sripathi Kodi 2010-07-12 172 st = p9_client_stat(fid); f085312204f384 Sripathi Kodi 2010-07-12 173 if (IS_ERR(st)) { f085312204f384 Sripathi Kodi 2010-07-12 174 retval = PTR_ERR(st); 5c25f347a7b00b Aneesh Kumar K.V 2010-08-24 175 goto release_sb; f085312204f384 Sripathi Kodi 2010-07-12 176 } f085312204f384 Sripathi Kodi 2010-07-12 177 2b0143b5c986be David Howells 2015-03-17 178 d_inode(root)->i_ino = v9fs_qid2ino(&st->qid); 5e3cc1ee1405a7 Hou Tao 2019-01-24 179 v9fs_stat2inode(st, d_inode(root), sb, 0); 51a87c552dfd42 Eric Van Hensbergen 2008-10-16 180 51a87c552dfd42 Eric Van Hensbergen 2008-10-16 181 p9stat_free(st); dda6b022f3222f Latchesar Ionkov 2007-11-06 182 kfree(st); f085312204f384 Sripathi Kodi 2010-07-12 183 } 85ff872d3f4a62 Aneesh Kumar K.V 2010-09-28 184 retval = v9fs_get_acl(inode, fid); 85ff872d3f4a62 Aneesh Kumar K.V 2010-09-28 185 if (retval) 85ff872d3f4a62 Aneesh Kumar K.V 2010-09-28 186 goto release_sb; dafbe689736f62 Dominique Martinet 2022-06-12 187 v9fs_fid_add(root, &fid); 9e82cf6a802a72 Eric Van Hensbergen 2005-09-09 188 5d3851530d6d68 Joe Perches 2011-11-28 189 p9_debug(P9_DEBUG_VFS, " simple set mount, return 0\n"); d2d1ea93069bd7 Al Viro 2010-07-25 190 return dget(sb->s_root); 9e82cf6a802a72 Eric Van Hensbergen 2005-09-09 191 887b3ece65be7b Eric Van Hensbergen 2008-05-08 192 clunk_fid: b48dbb998d70b7 Dominique Martinet 2022-06-12 193 p9_fid_put(fid); 00fbc6dfe7c448 Eric Van Hensbergen 2006-04-10 194 v9fs_session_close(v9ses); 412a19b64ad17f Tejun Heo 2015-06-08 195 free_session: 00fbc6dfe7c448 Eric Van Hensbergen 2006-04-10 196 kfree(v9ses); d2d1ea93069bd7 Al Viro 2010-07-25 197 return ERR_PTR(retval); df5d8c80f1871d Aneesh Kumar K.V 2011-03-24 198 1b5ab3e86712b6 Abhishek Kulkarni 2009-07-19 199 release_sb: 5c25f347a7b00b Aneesh Kumar K.V 2010-08-24 200 /* df5d8c80f1871d Aneesh Kumar K.V 2011-03-24 201 * we will do the session_close and root dentry release df5d8c80f1871d Aneesh Kumar K.V 2011-03-24 202 * in the below call. But we need to clunk fid, because we haven't df5d8c80f1871d Aneesh Kumar K.V 2011-03-24 203 * attached the fid to dentry so it won't get clunked df5d8c80f1871d Aneesh Kumar K.V 2011-03-24 204 * automatically. 5c25f347a7b00b Aneesh Kumar K.V 2010-08-24 205 */ b48dbb998d70b7 Dominique Martinet 2022-06-12 206 p9_fid_put(fid); 1b5ab3e86712b6 Abhishek Kulkarni 2009-07-19 207 deactivate_locked_super(sb); d2d1ea93069bd7 Al Viro 2010-07-25 208 return ERR_PTR(retval); 9e82cf6a802a72 Eric Van Hensbergen 2005-09-09 209 } 9e82cf6a802a72 Eric Van Hensbergen 2005-09-09 210 :::::: The code at line 117 was first introduced by commit :::::: bd238fb431f31989898423c8b6496bc8c4204a86 9p: Reorganization of 9p file system code :::::: TO: Latchesar Ionkov <[email protected]> :::::: CC: Eric Van Hensbergen <[email protected]> -- 0-DAY CI Kernel Test Service https://01.org/lkp _______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
