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:   Tue, 10 Jan 2023 17:20:20 +0800
From:   kernel test robot <lkp@...el.com>
To:     Baokun Li <libaokun1@...wei.com>, linux-ext4@...r.kernel.org
Cc:     llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev, tytso@....edu,
        adilger.kernel@...ger.ca, jack@...e.cz, ritesh.list@...il.com,
        linux-kernel@...r.kernel.org, yi.zhang@...wei.com,
        yukuai3@...wei.com, libaokun1@...wei.com,
        syzbot+77d6fcc37bbb92f26048@...kaller.appspotmail.com
Subject: Re: [PATCH] ext4: fix task hung in ext4_xattr_delete_inode

Hi Baokun,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on tytso-ext4/dev]
[also build test WARNING on linus/master v6.2-rc3 next-20230110]
[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/Baokun-Li/ext4-fix-task-hung-in-ext4_xattr_delete_inode/20230110-120433
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
patch link:    https://lore.kernel.org/r/20230110042709.2136336-1-libaokun1%40huawei.com
patch subject: [PATCH] ext4: fix task hung in ext4_xattr_delete_inode
config: i386-randconfig-a004-20230109
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
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/2b538f0fbc0861c2073325963ff3532bf80b20c0
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Baokun-Li/ext4-fix-task-hung-in-ext4_xattr_delete_inode/20230110-120433
        git checkout 2b538f0fbc0861c2073325963ff3532bf80b20c0
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash fs/ext4/

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

>> fs/ext4/xattr.c:389:6: warning: variable 'inode' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
           if (parent->i_ino == ea_ino) {
               ^~~~~~~~~~~~~~~~~~~~~~~
   fs/ext4/xattr.c:442:7: note: uninitialized use occurs here
           iput(inode);
                ^~~~~
   fs/ext4/xattr.c:389:2: note: remove the 'if' if its condition is always false
           if (parent->i_ino == ea_ino) {
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ext4/xattr.c:386:21: note: initialize the variable 'inode' to silence this warning
           struct inode *inode;
                              ^
                               = NULL
   1 warning generated.


vim +389 fs/ext4/xattr.c

   382	
   383	static int ext4_xattr_inode_iget(struct inode *parent, unsigned long ea_ino,
   384					 u32 ea_inode_hash, struct inode **ea_inode)
   385	{
   386		struct inode *inode;
   387		int err;
   388	
 > 389		if (parent->i_ino == ea_ino) {
   390			ext4_error(parent->i_sb,
   391				   "Parent and EA inode have the same ino %lu", ea_ino);
   392			err = -EUCLEAN;
   393			goto error;
   394		}
   395	
   396		inode = ext4_iget(parent->i_sb, ea_ino, EXT4_IGET_NORMAL);
   397		if (IS_ERR(inode)) {
   398			err = PTR_ERR(inode);
   399			ext4_error(parent->i_sb,
   400				   "error while reading EA inode %lu err=%d", ea_ino,
   401				   err);
   402			return err;
   403		}
   404	
   405		if (is_bad_inode(inode)) {
   406			ext4_error(parent->i_sb,
   407				   "error while reading EA inode %lu is_bad_inode",
   408				   ea_ino);
   409			err = -EIO;
   410			goto error;
   411		}
   412	
   413		if (!(EXT4_I(inode)->i_flags & EXT4_EA_INODE_FL)) {
   414			ext4_error(parent->i_sb,
   415				   "EA inode %lu does not have EXT4_EA_INODE_FL flag",
   416				    ea_ino);
   417			err = -EINVAL;
   418			goto error;
   419		}
   420	
   421		ext4_xattr_inode_set_class(inode);
   422	
   423		/*
   424		 * Check whether this is an old Lustre-style xattr inode. Lustre
   425		 * implementation does not have hash validation, rather it has a
   426		 * backpointer from ea_inode to the parent inode.
   427		 */
   428		if (ea_inode_hash != ext4_xattr_inode_get_hash(inode) &&
   429		    EXT4_XATTR_INODE_GET_PARENT(inode) == parent->i_ino &&
   430		    inode->i_generation == parent->i_generation) {
   431			ext4_set_inode_state(inode, EXT4_STATE_LUSTRE_EA_INODE);
   432			ext4_xattr_inode_set_ref(inode, 1);
   433		} else {
   434			inode_lock(inode);
   435			inode->i_flags |= S_NOQUOTA;
   436			inode_unlock(inode);
   437		}
   438	
   439		*ea_inode = inode;
   440		return 0;
   441	error:
   442		iput(inode);
   443		return err;
   444	}
   445	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ