[viro-vfs:untested.persistency 57/58] security/integrity/ima/ima_fs.c:430:20: error: use of undeclared identifier 'ima_policy'

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

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git untested.persistency
head:   b3c987f7369f15318ee1284d9203737f09294b7e
commit: c6429afc4eb7e8fd9044f85e21c53285f1b96a8b [57/58] ima_fs: don't bother with removal of files in directory we'll be removing
config: x86_64-rhel-8.3-rust (https://download.01.org/0day-ci/archive/20240517/202405170447.fAkCQdzn-lkp@xxxxxxxxx/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240517/202405170447.fAkCQdzn-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202405170447.fAkCQdzn-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

>> security/integrity/ima/ima_fs.c:430:20: error: use of undeclared identifier 'ima_policy'
     430 |         securityfs_remove(ima_policy);
         |                           ^
   security/integrity/ima/ima_fs.c:431:2: error: use of undeclared identifier 'ima_policy'
     431 |         ima_policy = NULL;
         |         ^
   2 errors generated.


vim +/ima_policy +430 security/integrity/ima/ima_fs.c

f4bd857bc8ed99 Mimi Zohar      2009-02-04  397  
4af4662fa4a9dc Mimi Zohar      2009-02-04  398  /*
4af4662fa4a9dc Mimi Zohar      2009-02-04  399   * ima_release_policy - start using the new measure policy rules.
4af4662fa4a9dc Mimi Zohar      2009-02-04  400   *
4af4662fa4a9dc Mimi Zohar      2009-02-04  401   * Initially, ima_measure points to the default policy rules, now
f4bd857bc8ed99 Mimi Zohar      2009-02-04  402   * point to the new policy rules, and remove the securityfs policy file,
f4bd857bc8ed99 Mimi Zohar      2009-02-04  403   * assuming a valid policy.
4af4662fa4a9dc Mimi Zohar      2009-02-04  404   */
4af4662fa4a9dc Mimi Zohar      2009-02-04  405  static int ima_release_policy(struct inode *inode, struct file *file)
4af4662fa4a9dc Mimi Zohar      2009-02-04  406  {
0716abbb58e3c4 Dmitry Kasatkin 2014-10-03  407  	const char *cause = valid_policy ? "completed" : "failed";
0716abbb58e3c4 Dmitry Kasatkin 2014-10-03  408  
80eae209d63ac6 Petko Manolov   2015-12-02  409  	if ((file->f_flags & O_ACCMODE) == O_RDONLY)
9a11a18902bc3b Eric Richter    2016-10-13  410  		return seq_release(inode, file);
80eae209d63ac6 Petko Manolov   2015-12-02  411  
0112721df4edbd Sasha Levin     2015-12-22  412  	if (valid_policy && ima_check_policy() < 0) {
0112721df4edbd Sasha Levin     2015-12-22  413  		cause = "failed";
0112721df4edbd Sasha Levin     2015-12-22  414  		valid_policy = 0;
0112721df4edbd Sasha Levin     2015-12-22  415  	}
0112721df4edbd Sasha Levin     2015-12-22  416  
de636769c8c735 Petr Vorel      2018-04-24  417  	pr_info("policy update %s\n", cause);
0716abbb58e3c4 Dmitry Kasatkin 2014-10-03  418  	integrity_audit_msg(AUDIT_INTEGRITY_STATUS, NULL, NULL,
0716abbb58e3c4 Dmitry Kasatkin 2014-10-03  419  			    "policy_update", cause, !valid_policy, 0);
0716abbb58e3c4 Dmitry Kasatkin 2014-10-03  420  
4af4662fa4a9dc Mimi Zohar      2009-02-04  421  	if (!valid_policy) {
4af4662fa4a9dc Mimi Zohar      2009-02-04  422  		ima_delete_rules();
f4bd857bc8ed99 Mimi Zohar      2009-02-04  423  		valid_policy = 1;
0716abbb58e3c4 Dmitry Kasatkin 2014-10-03  424  		clear_bit(IMA_FS_BUSY, &ima_fs_flags);
4af4662fa4a9dc Mimi Zohar      2009-02-04  425  		return 0;
4af4662fa4a9dc Mimi Zohar      2009-02-04  426  	}
80eae209d63ac6 Petko Manolov   2015-12-02  427  
4af4662fa4a9dc Mimi Zohar      2009-02-04  428  	ima_update_policy();
2068626d1345f2 Mimi Zohar      2017-06-27  429  #if !defined(CONFIG_IMA_WRITE_POLICY) && !defined(CONFIG_IMA_READ_POLICY)
4af4662fa4a9dc Mimi Zohar      2009-02-04 @430  	securityfs_remove(ima_policy);
4af4662fa4a9dc Mimi Zohar      2009-02-04  431  	ima_policy = NULL;
2068626d1345f2 Mimi Zohar      2017-06-27  432  #elif defined(CONFIG_IMA_WRITE_POLICY)
38d859f991f3a0 Petko Manolov   2015-12-02  433  	clear_bit(IMA_FS_BUSY, &ima_fs_flags);
ffb122de9a60bd Petr Vorel      2018-04-20  434  #elif defined(CONFIG_IMA_READ_POLICY)
ffb122de9a60bd Petr Vorel      2018-04-20  435  	inode->i_mode &= ~S_IWUSR;
38d859f991f3a0 Petko Manolov   2015-12-02  436  #endif
4af4662fa4a9dc Mimi Zohar      2009-02-04  437  	return 0;
4af4662fa4a9dc Mimi Zohar      2009-02-04  438  }
4af4662fa4a9dc Mimi Zohar      2009-02-04  439  

:::::: The code at line 430 was first introduced by commit
:::::: 4af4662fa4a9dc62289c580337ae2506339c4729 integrity: IMA policy

:::::: TO: Mimi Zohar <zohar@xxxxxxxxxxxxxxxxxx>
:::::: CC: James Morris <jmorris@xxxxxxxxx>

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




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

  Powered by Linux