[PATCH v5] Add flags option to get xattr method paired to __vfs_getxattr

kbuild test robot lkp at intel.com
Wed Aug 21 03:43:50 AEST 2019


Hi Mark,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[cannot apply to v5.3-rc5 next-20190820]
[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/Add-flags-option-to-get-xattr-method-paired-to-__vfs_getxattr/20190820-220307
config: i386-allmodconfig (attached as .config)
compiler: gcc-7 (Debian 7.4.0-10) 7.4.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp at intel.com>

All error/warnings (new ones prefixed by >>):

   security/smack/smack_lsm.c: In function 'smk_fetch':
>> security/smack/smack_lsm.c:308:26: error: 'buffer' undeclared (first use in this function); did you mean 'user'?
      skp = smk_import_entry(buffer, rc);
                             ^~~~~~
                             user
   security/smack/smack_lsm.c:308:26: note: each undeclared identifier is reported only once for each function it appears in
--
   security/integrity/evm/evm_main.c: In function 'evm_find_protected_xattrs':
>> security/integrity/evm/evm_main.c:103:8: error: 'inode' undeclared (first use in this function)
     if (!(inode->i_opflags & IOP_XATTR))
           ^~~~~
   security/integrity/evm/evm_main.c:103:8: note: each undeclared identifier is reported only once for each function it appears in
>> security/integrity/evm/evm_main.c:109:14: warning: assignment makes integer from pointer without a cast [-Wint-conversion]
      args.flags = xattr->name;
                 ^
--
   In file included from include/linux/stat.h:7:0,
                    from include/linux/module.h:10,
                    from fs/9p/acl.c:15:
   fs/9p/acl.c: In function 'v9fs_xattr_set_acl':
>> fs/9p/acl.c:258:14: error: 'inode' undeclared (first use in this function)
     if (S_ISLNK(inode->i_mode))
                 ^
   include/uapi/linux/stat.h:21:23: note: in definition of macro 'S_ISLNK'
    #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
                          ^
   fs/9p/acl.c:258:14: note: each undeclared identifier is reported only once for each function it appears in
     if (S_ISLNK(inode->i_mode))
                 ^
   include/uapi/linux/stat.h:21:23: note: in definition of macro 'S_ISLNK'
    #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
                          ^
--
   fs/afs/xattr.c: In function 'afs_xattr_get_cell':
>> fs/afs/xattr.c:334:6: error: 'size' undeclared (first use in this function); did you mean 'ksize'?
     if (size == 0)
         ^~~~
         ksize
   fs/afs/xattr.c:334:6: note: each undeclared identifier is reported only once for each function it appears in
--
   fs/ecryptfs/crypto.c: In function 'ecryptfs_write_metadata_to_xattr':
>> fs/ecryptfs/crypto.c:1131:23: error: 'args' undeclared (first use in this function); did you mean 'abs'?
     rc = __vfs_setxattr(&args);
                          ^~~~
                          abs
   fs/ecryptfs/crypto.c:1131:23: note: each undeclared identifier is reported only once for each function it appears in
--
   fs/ubifs/xattr.c: In function 'xattr_get':
>> fs/ubifs/xattr.c:676:63: error: 'name' undeclared (first use in this function); did you mean 'page'?
     return ubifs_xattr_get(args->inode, xattr_full_name(handler, name),
                                                                  ^~~~
                                                                  page
   fs/ubifs/xattr.c:676:63: note: each undeclared identifier is reported only once for each function it appears in
   fs/ubifs/xattr.c: In function 'xattr_set':
>> fs/ubifs/xattr.c:686:6: error: 'value' undeclared (first use in this function); did you mean 'false'?
     if (value)
         ^~~~~
         false
   fs/ubifs/xattr.c:694:1: warning: control reaches end of non-void function [-Wreturn-type]
    }
    ^
   fs/ubifs/xattr.c: In function 'xattr_get':
   fs/ubifs/xattr.c:678:1: warning: control reaches end of non-void function [-Wreturn-type]
    }
    ^
--
   fs/xfs/libxfs/xfs_attr.c: In function 'xfs_attr_set':
>> fs/xfs/libxfs/xfs_attr.c:327:13: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     args.value = value;
                ^

vim +308 security/smack/smack_lsm.c

d166c8024d620d Casey Schaufler     2014-08-27  271  
e114e473771c84 Casey Schaufler     2008-02-04  272  /**
e114e473771c84 Casey Schaufler     2008-02-04  273   * smk_fetch - Fetch the smack label from a file.
1a28979b322bb2 Lukasz Pawelczyk    2014-11-26  274   * @name: type of the label (attribute)
e114e473771c84 Casey Schaufler     2008-02-04  275   * @ip: a pointer to the inode
e114e473771c84 Casey Schaufler     2008-02-04  276   * @dp: a pointer to the dentry
e114e473771c84 Casey Schaufler     2008-02-04  277   *
e774ad683f425a Lukasz Pawelczyk    2015-04-20  278   * Returns a pointer to the master list entry for the Smack label,
e774ad683f425a Lukasz Pawelczyk    2015-04-20  279   * NULL if there was no label to fetch, or an error code.
e114e473771c84 Casey Schaufler     2008-02-04  280   */
2f823ff8bec03a Casey Schaufler     2013-05-22  281  static struct smack_known *smk_fetch(const char *name, struct inode *ip,
2f823ff8bec03a Casey Schaufler     2013-05-22  282  					struct dentry *dp)
e114e473771c84 Casey Schaufler     2008-02-04  283  {
e114e473771c84 Casey Schaufler     2008-02-04  284  	int rc;
2f823ff8bec03a Casey Schaufler     2013-05-22  285  	struct smack_known *skp = NULL;
7d823b0879d4e2 Mark Salyzyn        2019-08-19  286  	struct xattr_gs_args args;
e114e473771c84 Casey Schaufler     2008-02-04  287  
5d6c31910bc071 Andreas Gruenbacher 2016-09-29  288  	if (!(ip->i_opflags & IOP_XATTR))
e774ad683f425a Lukasz Pawelczyk    2015-04-20  289  		return ERR_PTR(-EOPNOTSUPP);
e114e473771c84 Casey Schaufler     2008-02-04  290  
7d823b0879d4e2 Mark Salyzyn        2019-08-19  291  	memset(&args, 0, sizeof(args));
7d823b0879d4e2 Mark Salyzyn        2019-08-19  292  	args.dentry = dp;
7d823b0879d4e2 Mark Salyzyn        2019-08-19  293  	args.inode = ip;
7d823b0879d4e2 Mark Salyzyn        2019-08-19  294  	args.name = name;
7d823b0879d4e2 Mark Salyzyn        2019-08-19  295  	args.buffer = kzalloc(SMK_LONGLABEL, GFP_KERNEL);
7d823b0879d4e2 Mark Salyzyn        2019-08-19  296  	args.size = SMK_LONGLABEL;
7d823b0879d4e2 Mark Salyzyn        2019-08-19  297  	args.flags = XATTR_NOSECURITY;
7d823b0879d4e2 Mark Salyzyn        2019-08-19  298  
7d823b0879d4e2 Mark Salyzyn        2019-08-19  299  	if (args.buffer == NULL)
e774ad683f425a Lukasz Pawelczyk    2015-04-20  300  		return ERR_PTR(-ENOMEM);
e114e473771c84 Casey Schaufler     2008-02-04  301  
7d823b0879d4e2 Mark Salyzyn        2019-08-19  302  	rc = __vfs_getxattr(&args);
e774ad683f425a Lukasz Pawelczyk    2015-04-20  303  	if (rc < 0)
e774ad683f425a Lukasz Pawelczyk    2015-04-20  304  		skp = ERR_PTR(rc);
e774ad683f425a Lukasz Pawelczyk    2015-04-20  305  	else if (rc == 0)
e774ad683f425a Lukasz Pawelczyk    2015-04-20  306  		skp = NULL;
e774ad683f425a Lukasz Pawelczyk    2015-04-20  307  	else
2f823ff8bec03a Casey Schaufler     2013-05-22 @308  		skp = smk_import_entry(buffer, rc);
f7112e6c9abf1c Casey Schaufler     2012-05-06  309  
f7112e6c9abf1c Casey Schaufler     2012-05-06  310  	kfree(buffer);
f7112e6c9abf1c Casey Schaufler     2012-05-06  311  
2f823ff8bec03a Casey Schaufler     2013-05-22  312  	return skp;
e114e473771c84 Casey Schaufler     2008-02-04  313  }
e114e473771c84 Casey Schaufler     2008-02-04  314  

:::::: The code at line 308 was first introduced by commit
:::::: 2f823ff8bec03a1e6f9e11fd0c4d54e4c7d09532 Smack: Improve access check performance

:::::: TO: Casey Schaufler <casey at schaufler-ca.com>
:::::: CC: Casey Schaufler <casey at schaufler-ca.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 69452 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linux-erofs/attachments/20190821/90b53de6/attachment.gz>


More information about the Linux-erofs mailing list