Re: [PATCH] fscrypt: Restore modular support

From: kbuild test robot
Date: Tue Dec 24 2019 - 06:45:18 EST


Hi Herbert,

I love your patch! Yet something to improve:

[auto build test ERROR on linux/master]
[also build test ERROR on f2fs/dev-test linus/master v5.5-rc3 next-20191220]
[cannot apply to ext4/dev tytso-fscrypt/master]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url: https://github.com/0day-ci/linux/commits/Herbert-Xu/fscrypt-Restore-modular-support/20191224-164226
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 1522d9da40bdfe502c91163e6d769332897201fa
config: x86_64-kexec (attached as .config)
compiler: gcc-7 (Debian 7.5.0-3) 7.5.0
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

ld: fs/super.o: in function `__put_super':
fs/super.c:296: undefined reference to `fscrypt_sb_free'
ld: fs/ext4/dir.o: in function `ext4_dir_open':
fs/ext4/dir.c:617: undefined reference to `fscrypt_get_encryption_info'
ld: fs/ext4/dir.o: in function `ext4_readdir':
fs/ext4/dir.c:118: undefined reference to `fscrypt_get_encryption_info'
ld: fs/ext4/dir.c:145: undefined reference to `fscrypt_fname_alloc_buffer'
ld: fs/ext4/dir.c:263: undefined reference to `fscrypt_fname_disk_to_usr'
ld: fs/ext4/dir.c:288: undefined reference to `fscrypt_fname_free_buffer'
ld: fs/ext4/file.o: in function `ext4_file_open':
fs/ext4/file.c:716: undefined reference to `fscrypt_file_open'
ld: fs/ext4/ialloc.o: in function `__ext4_new_inode':
fs/ext4/ialloc.c:772: undefined reference to `fscrypt_get_encryption_info'
ld: fs/ext4/ialloc.c:1145: undefined reference to `fscrypt_inherit_context'
ld: fs/ext4/inode.o: in function `ext4_block_write_begin':
fs/ext4/inode.c:1097: undefined reference to `fscrypt_decrypt_pagecache_blocks'
ld: fs/ext4/inode.o: in function `__ext4_block_zero_page_range':
fs/ext4/inode.c:3704: undefined reference to `fscrypt_decrypt_pagecache_blocks'
ld: fs/ext4/inode.o: in function `fscrypt_require_key':
include/linux/fscrypt.h:548: undefined reference to `fscrypt_get_encryption_info'
ld: fs/ext4/inode.o: in function `ext4_issue_zeroout':
fs/ext4/inode.c:406: undefined reference to `fscrypt_zeroout_range'
ld: fs/ext4/ioctl.o: in function `ext4_ioctl':
fs/ext4/ioctl.c:1141: undefined reference to `fscrypt_ioctl_set_policy'
ld: fs/ext4/ioctl.c:1186: undefined reference to `fscrypt_ioctl_get_policy'
ld: fs/ext4/ioctl.c:1191: undefined reference to `fscrypt_ioctl_get_policy_ex'
ld: fs/ext4/ioctl.c:1196: undefined reference to `fscrypt_ioctl_add_key'
ld: fs/ext4/ioctl.c:1201: undefined reference to `fscrypt_ioctl_remove_key'
ld: fs/ext4/ioctl.c:1206: undefined reference to `fscrypt_ioctl_remove_key_all_users'
ld: fs/ext4/ioctl.c:1211: undefined reference to `fscrypt_ioctl_get_key_status'
ld: fs/ext4/namei.o: in function `ext4_fname_setup_filename':
fs/ext4/ext4.h:2380: undefined reference to `fscrypt_setup_filename'
ld: fs/ext4/namei.o: in function `fscrypt_prepare_lookup':
include/linux/fscrypt.h:642: undefined reference to `__fscrypt_prepare_lookup'
ld: fs/ext4/namei.o: in function `htree_dirblock_to_tree':
>> fs/ext4/namei.c:1008: undefined reference to `fscrypt_get_encryption_info'
ld: fs/ext4/namei.c:1013: undefined reference to `fscrypt_fname_alloc_buffer'
ld: fs/ext4/namei.c:1048: undefined reference to `fscrypt_fname_disk_to_usr'
>> ld: fs/ext4/namei.c:1069: undefined reference to `fscrypt_fname_free_buffer'
ld: fs/ext4/namei.o: in function `ext4_lookup':
fs/ext4/namei.c:1709: undefined reference to `fscrypt_has_permitted_context'
ld: fs/ext4/namei.o: in function `fscrypt_prepare_rename':
include/linux/fscrypt.h:613: undefined reference to `__fscrypt_prepare_rename'
ld: fs/ext4/namei.o: in function `fscrypt_prepare_symlink':
include/linux/fscrypt.h:706: undefined reference to `__fscrypt_prepare_symlink'
ld: fs/ext4/namei.o: in function `fscrypt_encrypt_symlink':
include/linux/fscrypt.h:736: undefined reference to `__fscrypt_encrypt_symlink'
ld: fs/ext4/namei.o: in function `fscrypt_prepare_link':
include/linux/fscrypt.h:581: undefined reference to `__fscrypt_prepare_link'
ld: fs/ext4/page-io.o: in function `ext4_finish_bio':
fs/ext4/page-io.c:147: undefined reference to `fscrypt_free_bounce_page'
ld: fs/ext4/page-io.o: in function `ext4_bio_write_page':
fs/ext4/page-io.c:516: undefined reference to `fscrypt_encrypt_pagecache_blocks'
ld: fs/ext4/readpage.o: in function `decrypt_work':
fs/ext4/readpage.c:100: undefined reference to `fscrypt_decrypt_bio'
ld: fs/ext4/readpage.o: in function `bio_post_read_processing':
fs/ext4/readpage.c:126: undefined reference to `fscrypt_enqueue_decrypt_work'
ld: fs/ext4/super.o: in function `ext4_drop_inode':
fs/ext4/super.c:1111: undefined reference to `fscrypt_drop_inode'
ld: fs/ext4/super.o: in function `ext4_free_in_core_inode':
fs/ext4/super.c:1119: undefined reference to `fscrypt_free_inode'
ld: fs/ext4/super.o: in function `ext4_clear_inode':
fs/ext4/super.c:1184: undefined reference to `fscrypt_put_encryption_info'
ld: fs/ext4/symlink.o: in function `ext4_encrypted_get_link':
fs/ext4/symlink.c:49: undefined reference to `fscrypt_get_symlink'

vim +1008 fs/ext4/namei.c

ac27a0ec112a08 Dave Kleikamp 2006-10-11 978
ac27a0ec112a08 Dave Kleikamp 2006-10-11 979
ac27a0ec112a08 Dave Kleikamp 2006-10-11 980 /*
ac27a0ec112a08 Dave Kleikamp 2006-10-11 981 * This function fills a red-black tree with information from a
ac27a0ec112a08 Dave Kleikamp 2006-10-11 982 * directory block. It returns the number directory entries loaded
ac27a0ec112a08 Dave Kleikamp 2006-10-11 983 * into the tree. If there is an error it is returned in err.
ac27a0ec112a08 Dave Kleikamp 2006-10-11 984 */
ac27a0ec112a08 Dave Kleikamp 2006-10-11 985 static int htree_dirblock_to_tree(struct file *dir_file,
725d26d3f09ccb Aneesh Kumar K.V 2008-01-28 986 struct inode *dir, ext4_lblk_t block,
ac27a0ec112a08 Dave Kleikamp 2006-10-11 987 struct dx_hash_info *hinfo,
ac27a0ec112a08 Dave Kleikamp 2006-10-11 988 __u32 start_hash, __u32 start_minor_hash)
ac27a0ec112a08 Dave Kleikamp 2006-10-11 989 {
ac27a0ec112a08 Dave Kleikamp 2006-10-11 990 struct buffer_head *bh;
617ba13b31fbf5 Mingming Cao 2006-10-11 991 struct ext4_dir_entry_2 *de, *top;
90b0a97323f42e Carlos Maiolino 2012-09-17 992 int err = 0, count = 0;
a7550b30ab709f Jaegeuk Kim 2016-07-10 993 struct fscrypt_str fname_crypto_str = FSTR_INIT(NULL, 0), tmp_str;
ac27a0ec112a08 Dave Kleikamp 2006-10-11 994
725d26d3f09ccb Aneesh Kumar K.V 2008-01-28 995 dxtrace(printk(KERN_INFO "In htree dirblock_to_tree: block %lu\n",
725d26d3f09ccb Aneesh Kumar K.V 2008-01-28 996 (unsigned long)block));
4e19d6b65fb4fc Theodore Ts'o 2019-06-20 997 bh = ext4_read_dirblock(dir, block, DIRENT_HTREE);
dc6982ff4db1f4 Theodore Ts'o 2013-02-14 998 if (IS_ERR(bh))
dc6982ff4db1f4 Theodore Ts'o 2013-02-14 999 return PTR_ERR(bh);
b0336e8d2108e6 Darrick J. Wong 2012-04-29 1000
617ba13b31fbf5 Mingming Cao 2006-10-11 1001 de = (struct ext4_dir_entry_2 *) bh->b_data;
617ba13b31fbf5 Mingming Cao 2006-10-11 1002 top = (struct ext4_dir_entry_2 *) ((char *) de +
ac27a0ec112a08 Dave Kleikamp 2006-10-11 1003 dir->i_sb->s_blocksize -
617ba13b31fbf5 Mingming Cao 2006-10-11 1004 EXT4_DIR_REC_LEN(0));
643fa9612bf1a2 Chandan Rajendra 2018-12-12 1005 #ifdef CONFIG_FS_ENCRYPTION
1f3862b5575b13 Michael Halcrow 2015-04-12 1006 /* Check if the directory is encrypted */
592ddec7578a33 Chandan Rajendra 2018-12-12 1007 if (IS_ENCRYPTED(dir)) {
a7550b30ab709f Jaegeuk Kim 2016-07-10 @1008 err = fscrypt_get_encryption_info(dir);
c936e1ec2879e4 Theodore Ts'o 2015-05-31 1009 if (err < 0) {
1f3862b5575b13 Michael Halcrow 2015-04-12 1010 brelse(bh);
1f3862b5575b13 Michael Halcrow 2015-04-12 1011 return err;
1f3862b5575b13 Michael Halcrow 2015-04-12 1012 }
a7550b30ab709f Jaegeuk Kim 2016-07-10 1013 err = fscrypt_fname_alloc_buffer(dir, EXT4_NAME_LEN,
1f3862b5575b13 Michael Halcrow 2015-04-12 1014 &fname_crypto_str);
1f3862b5575b13 Michael Halcrow 2015-04-12 1015 if (err < 0) {
1f3862b5575b13 Michael Halcrow 2015-04-12 1016 brelse(bh);
1f3862b5575b13 Michael Halcrow 2015-04-12 1017 return err;
1f3862b5575b13 Michael Halcrow 2015-04-12 1018 }
1f3862b5575b13 Michael Halcrow 2015-04-12 1019 }
1f3862b5575b13 Michael Halcrow 2015-04-12 1020 #endif
3d0518f4758eca Wei Yongjun 2009-02-14 1021 for (; de < top; de = ext4_next_entry(de, dir->i_sb->s_blocksize)) {
f7c21177af0b32 Theodore Ts'o 2011-01-10 1022 if (ext4_check_dir_entry(dir, NULL, de, bh,
226ba972b08637 Tao Ma 2012-12-10 1023 bh->b_data, bh->b_size,
e6c4021190c828 Eric Sandeen 2006-12-06 1024 (block<<EXT4_BLOCK_SIZE_BITS(dir->i_sb))
e6c4021190c828 Eric Sandeen 2006-12-06 1025 + ((char *)de - bh->b_data))) {
64cb927371cd2e Al Viro 2013-07-01 1026 /* silently ignore the rest of the block */
64cb927371cd2e Al Viro 2013-07-01 1027 break;
e6c4021190c828 Eric Sandeen 2006-12-06 1028 }
b886ee3e778ec2 Gabriel Krisman Bertazi 2019-04-25 1029 ext4fs_dirhash(dir, de->name, de->name_len, hinfo);
ac27a0ec112a08 Dave Kleikamp 2006-10-11 1030 if ((hinfo->hash < start_hash) ||
ac27a0ec112a08 Dave Kleikamp 2006-10-11 1031 ((hinfo->hash == start_hash) &&
ac27a0ec112a08 Dave Kleikamp 2006-10-11 1032 (hinfo->minor_hash < start_minor_hash)))
ac27a0ec112a08 Dave Kleikamp 2006-10-11 1033 continue;
ac27a0ec112a08 Dave Kleikamp 2006-10-11 1034 if (de->inode == 0)
ac27a0ec112a08 Dave Kleikamp 2006-10-11 1035 continue;
592ddec7578a33 Chandan Rajendra 2018-12-12 1036 if (!IS_ENCRYPTED(dir)) {
2f61830ae33e29 Theodore Ts'o 2015-04-12 1037 tmp_str.name = de->name;
2f61830ae33e29 Theodore Ts'o 2015-04-12 1038 tmp_str.len = de->name_len;
2f61830ae33e29 Theodore Ts'o 2015-04-12 1039 err = ext4_htree_store_dirent(dir_file,
1f3862b5575b13 Michael Halcrow 2015-04-12 1040 hinfo->hash, hinfo->minor_hash, de,
1f3862b5575b13 Michael Halcrow 2015-04-12 1041 &tmp_str);
1f3862b5575b13 Michael Halcrow 2015-04-12 1042 } else {
d229959072eba4 Theodore Ts'o 2015-05-18 1043 int save_len = fname_crypto_str.len;
a7550b30ab709f Jaegeuk Kim 2016-07-10 1044 struct fscrypt_str de_name = FSTR_INIT(de->name,
a7550b30ab709f Jaegeuk Kim 2016-07-10 1045 de->name_len);
d229959072eba4 Theodore Ts'o 2015-05-18 1046
1f3862b5575b13 Michael Halcrow 2015-04-12 1047 /* Directory is encrypted */
a7550b30ab709f Jaegeuk Kim 2016-07-10 1048 err = fscrypt_fname_disk_to_usr(dir, hinfo->hash,
a7550b30ab709f Jaegeuk Kim 2016-07-10 1049 hinfo->minor_hash, &de_name,
1f3862b5575b13 Michael Halcrow 2015-04-12 1050 &fname_crypto_str);
ef1eb3aa50930f Eric Biggers 2016-09-15 1051 if (err) {
1f3862b5575b13 Michael Halcrow 2015-04-12 1052 count = err;
1f3862b5575b13 Michael Halcrow 2015-04-12 1053 goto errout;
1f3862b5575b13 Michael Halcrow 2015-04-12 1054 }
1f3862b5575b13 Michael Halcrow 2015-04-12 1055 err = ext4_htree_store_dirent(dir_file,
1f3862b5575b13 Michael Halcrow 2015-04-12 1056 hinfo->hash, hinfo->minor_hash, de,
1f3862b5575b13 Michael Halcrow 2015-04-12 1057 &fname_crypto_str);
d229959072eba4 Theodore Ts'o 2015-05-18 1058 fname_crypto_str.len = save_len;
1f3862b5575b13 Michael Halcrow 2015-04-12 1059 }
2f61830ae33e29 Theodore Ts'o 2015-04-12 1060 if (err != 0) {
1f3862b5575b13 Michael Halcrow 2015-04-12 1061 count = err;
1f3862b5575b13 Michael Halcrow 2015-04-12 1062 goto errout;
ac27a0ec112a08 Dave Kleikamp 2006-10-11 1063 }
ac27a0ec112a08 Dave Kleikamp 2006-10-11 1064 count++;
ac27a0ec112a08 Dave Kleikamp 2006-10-11 1065 }
1f3862b5575b13 Michael Halcrow 2015-04-12 1066 errout:
ac27a0ec112a08 Dave Kleikamp 2006-10-11 1067 brelse(bh);
643fa9612bf1a2 Chandan Rajendra 2018-12-12 1068 #ifdef CONFIG_FS_ENCRYPTION
a7550b30ab709f Jaegeuk Kim 2016-07-10 @1069 fscrypt_fname_free_buffer(&fname_crypto_str);
1f3862b5575b13 Michael Halcrow 2015-04-12 1070 #endif
ac27a0ec112a08 Dave Kleikamp 2006-10-11 1071 return count;
ac27a0ec112a08 Dave Kleikamp 2006-10-11 1072 }
ac27a0ec112a08 Dave Kleikamp 2006-10-11 1073

:::::: The code at line 1008 was first introduced by commit
:::::: a7550b30ab709ffb9bbe48669adf7d8556f3698f ext4 crypto: migrate into vfs's crypto engine

:::::: TO: Jaegeuk Kim <jaegeuk@xxxxxxxxxx>
:::::: CC: Theodore Ts'o <tytso@xxxxxxx>

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

Attachment: .config.gz
Description: application/gzip