Re: [PATCH v2 3/4] overlay: Add the ability to remount volatile directories when safe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Sargun,

url:    https://github.com/0day-ci/linux/commits/Sargun-Dhillon/Make-overlayfs-volatile-mounts-reusable/20201127-172416
base:    be4df0cea08a8b59eb38d73de988b7ba8022df41
config: x86_64-randconfig-m001-20201127 (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@xxxxxxxxx>
Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

smatch warnings:
fs/overlayfs/readdir.c:1149 ovl_check_incompat() error: uninitialized symbol 'd'.

vim +/d +1149 fs/overlayfs/readdir.c

a9871ab1de6c660 Sargun Dhillon 2020-11-27  1129  static int ovl_check_incompat(struct ovl_fs *ofs, struct ovl_cache_entry *p,
a9871ab1de6c660 Sargun Dhillon 2020-11-27  1130  			      struct path *path)
a9871ab1de6c660 Sargun Dhillon 2020-11-27  1131  {
a9871ab1de6c660 Sargun Dhillon 2020-11-27  1132  	int err = -EINVAL;
a9871ab1de6c660 Sargun Dhillon 2020-11-27  1133  	struct dentry *d;
a9871ab1de6c660 Sargun Dhillon 2020-11-27  1134  
a9871ab1de6c660 Sargun Dhillon 2020-11-27  1135  	if (!strcmp(p->name, OVL_VOLATILEDIR_NAME)) {
a9871ab1de6c660 Sargun Dhillon 2020-11-27  1136  		d = lookup_one_len(p->name, path->dentry, p->len);
a9871ab1de6c660 Sargun Dhillon 2020-11-27  1137  		if (IS_ERR(d))
a9871ab1de6c660 Sargun Dhillon 2020-11-27  1138  			return PTR_ERR(d);
a9871ab1de6c660 Sargun Dhillon 2020-11-27  1139  
a9871ab1de6c660 Sargun Dhillon 2020-11-27  1140  		err = ovl_verify_volatile_info(ofs, d);
a9871ab1de6c660 Sargun Dhillon 2020-11-27  1141  		dput(d);
                                                                ^^^^^^^
dput() d here.

a9871ab1de6c660 Sargun Dhillon 2020-11-27  1142  	}
a9871ab1de6c660 Sargun Dhillon 2020-11-27  1143  
a9871ab1de6c660 Sargun Dhillon 2020-11-27  1144  	if (err == -EINVAL)
a9871ab1de6c660 Sargun Dhillon 2020-11-27  1145  		pr_err("incompat feature '%s' cannot be mounted\n", p->name);
a9871ab1de6c660 Sargun Dhillon 2020-11-27  1146  	else
a9871ab1de6c660 Sargun Dhillon 2020-11-27  1147  		pr_debug("incompat '%s' handled: %d\n", p->name, err);
a9871ab1de6c660 Sargun Dhillon 2020-11-27  1148  
a9871ab1de6c660 Sargun Dhillon 2020-11-27 @1149  	dput(d);
                                                        ^^^^^^
"d" is uninitialized and this is probably a double free.

a9871ab1de6c660 Sargun Dhillon 2020-11-27  1150  	return err;
a9871ab1de6c660 Sargun Dhillon 2020-11-27  1151  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux