[PATCH 2/2] NFSv4 account for selinux security context when deciding to share superblock

kernel test robot lkp at intel.com
Sat Feb 13 00:16:11 UTC 2021

Hi Olga,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on nfs/linux-next]
[also build test ERROR on pcmoore-selinux/next linus/master security/next-testing v5.11-rc7 next-20210211]
[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

url:    https://github.com/0day-ci/linux/commits/Olga-Kornievskaia/Add-new-hook-to-compare-new-mount-to-an-existing-mount/20210213-052321
base:   git://git.linux-nfs.org/projects/trondmy/linux-nfs.git linux-next
config: arm-defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
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/0day-ci/linux/commit/ff69e0bcc99716695e11ed2741b2e01d6014f960
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Olga-Kornievskaia/Add-new-hook-to-compare-new-mount-to-an-existing-mount/20210213-052321
        git checkout ff69e0bcc99716695e11ed2741b2e01d6014f960
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm 

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

All errors (new ones prefixed by >>):

   fs/nfs/super.c: In function 'nfs_compare_super':
>> fs/nfs/super.c:1179:5: error: implicit declaration of function 'security_sb_do_mnt_opts_match'; did you mean 'security_sb_set_mnt_opts'? [-Werror=implicit-function-declaration]
    1179 |    !security_sb_do_mnt_opts_match(sb, fc->security))
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         |     security_sb_set_mnt_opts
   cc1: some warnings being treated as errors

vim +1179 fs/nfs/super.c

  1165	static int nfs_compare_super(struct super_block *sb, struct fs_context *fc)
  1166	{
  1167		struct nfs_server *server = fc->s_fs_info, *old = NFS_SB(sb);
  1169		if (!nfs_compare_super_address(old, server))
  1170			return 0;
  1172		if (old->flags & NFS_MOUNT_UNSHARED)
  1173			return 0;
  1174		if (memcmp(&old->fsid, &server->fsid, sizeof(old->fsid)) != 0)
  1175			return 0;
  1176		if (!nfs_compare_userns(old, server))
  1177			return 0;
  1178		if ((old->has_sec_mnt_opts || fc->security) &&
> 1179				!security_sb_do_mnt_opts_match(sb, fc->security))
  1180			return 0;
  1181		return nfs_compare_mount_options(sb, server, fc);
  1182	}

0-DAY CI Kernel Test Service, Intel Corporation

More information about the Linux-security-module-archive mailing list