Re: overlayfs: caller_credentials option bypass creator_cred

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

 



Hi Mark,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v4.18-rc1]
[cannot apply to miklos-vfs/overlayfs-next next-20180618]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Mark-Salyzyn/overlayfs-caller_credentials-option-bypass-creator_cred/20180619-012937
config: i386-randconfig-x014-201824 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   fs//overlayfs/dir.c: In function 'ovl_create_or_link':
>> fs//overlayfs/dir.c:564:6: error: 'stat' undeclared (first use in this function)
         stat->mode, &dentry->d_name,
         ^~~~
   fs//overlayfs/dir.c:564:6: note: each undeclared identifier is reported only once for each function it appears in

vim +/stat +564 fs//overlayfs/dir.c

   532	
   533	static int ovl_create_or_link(struct dentry *dentry, struct inode *inode,
   534				      struct ovl_cattr *attr, bool origin)
   535	{
   536		int err;
   537		const struct cred *old_cred;
   538		struct cred *override_cred;
   539		struct dentry *parent = dentry->d_parent;
   540	
   541		err = ovl_copy_up(parent);
   542		if (err)
   543			return err;
   544	
   545		old_cred = ovl_override_creds(dentry->d_sb);
   546	
   547		/*
   548		 * When linking a file with copy up origin into a new parent, mark the
   549		 * new parent dir "impure".
   550		 */
   551		if (origin) {
   552			err = ovl_set_impure(parent, ovl_dentry_upper(parent));
   553			if (err)
   554				goto out_revert_creds;
   555		}
   556	
   557		err = -ENOMEM;
   558		override_cred = prepare_creds();
   559		if (override_cred) {
   560			override_cred->fsuid = inode->i_uid;
   561			override_cred->fsgid = inode->i_gid;
   562			if (!attr->hardlink) {
   563				err = security_dentry_create_files_as(dentry,
 > 564						stat->mode, &dentry->d_name,
   565						old_cred ? old_cred : current_cred(),
   566						override_cred);
   567				if (err) {
   568					put_cred(override_cred);
   569					goto out_revert_creds;
   570				}
   571			}
   572			put_cred(override_creds(override_cred));
   573			put_cred(override_cred);
   574	
   575			if (!ovl_dentry_is_whiteout(dentry))
   576				err = ovl_create_upper(dentry, inode, attr);
   577			else
   578				err = ovl_create_over_whiteout(dentry, inode, attr);
   579		}
   580	out_revert_creds:
   581		if (old_cred)
   582			revert_creds(old_cred);
   583		return err;
   584	}
   585	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux