2020-04-15 23:56:24

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH 1/8] apparmor: just use vfs_kern_mount to make .null

Hi Emanuele,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on char-misc/char-misc-testing]
[also build test ERROR on driver-core/driver-core-testing linus/master v5.7-rc1 next-20200415]
[cannot apply to security/next-testing]
[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/Emanuele-Giuseppe-Esposito/Simplefs-group-and-simplify-linux-fs-code/20200415-030834
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 885a64715fd81e6af6d94a038556e0b2e6deb19c
config: x86_64-rhel-7.6 (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 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 as appropriate
Reported-by: kbuild test robot <[email protected]>

Note: the linux-review/Emanuele-Giuseppe-Esposito/Simplefs-group-and-simplify-linux-fs-code/20200415-030834 HEAD 3016bd2448d788b615dc4b927f320d2463dd67da builds fine.
It only hurts bisectibility.

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

security/apparmor/apparmorfs.c: In function 'aa_mk_null_file':
>> security/apparmor/apparmorfs.c:2540:3: error: 'error' undeclared (first use in this function); did you mean 'errorf'?
error = PTR_ERR(dentry);
^~~~~
errorf
security/apparmor/apparmorfs.c:2540:3: note: each undeclared identifier is reported only once for each function it appears in
>> security/apparmor/apparmorfs.c:2566:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^

vim +2540 security/apparmor/apparmorfs.c

a71ada305801e9 John Johansen 2017-01-16 2525
a71ada305801e9 John Johansen 2017-01-16 2526 static int aa_mk_null_file(struct dentry *parent)
a71ada305801e9 John Johansen 2017-01-16 2527 {
4b30b45c1ddc88 Emanuele Giuseppe Esposito 2020-04-14 2528 struct file_system_type *type = parent->d_sb->s_type;
4b30b45c1ddc88 Emanuele Giuseppe Esposito 2020-04-14 2529 struct vfsmount *mount;
a71ada305801e9 John Johansen 2017-01-16 2530 struct dentry *dentry;
a71ada305801e9 John Johansen 2017-01-16 2531 struct inode *inode;
a71ada305801e9 John Johansen 2017-01-16 2532
4b30b45c1ddc88 Emanuele Giuseppe Esposito 2020-04-14 2533 mount = vfs_kern_mount(type, SB_KERNMOUNT, type->name, NULL);
4b30b45c1ddc88 Emanuele Giuseppe Esposito 2020-04-14 2534 if (IS_ERR(mount))
4b30b45c1ddc88 Emanuele Giuseppe Esposito 2020-04-14 2535 return PTR_ERR(mount);
a71ada305801e9 John Johansen 2017-01-16 2536
a71ada305801e9 John Johansen 2017-01-16 2537 inode_lock(d_inode(parent));
a71ada305801e9 John Johansen 2017-01-16 2538 dentry = lookup_one_len(NULL_FILE_NAME, parent, strlen(NULL_FILE_NAME));
a71ada305801e9 John Johansen 2017-01-16 2539 if (IS_ERR(dentry)) {
a71ada305801e9 John Johansen 2017-01-16 @2540 error = PTR_ERR(dentry);
a71ada305801e9 John Johansen 2017-01-16 2541 goto out;
a71ada305801e9 John Johansen 2017-01-16 2542 }
a71ada305801e9 John Johansen 2017-01-16 2543 inode = new_inode(parent->d_inode->i_sb);
a71ada305801e9 John Johansen 2017-01-16 2544 if (!inode) {
a71ada305801e9 John Johansen 2017-01-16 2545 error = -ENOMEM;
a71ada305801e9 John Johansen 2017-01-16 2546 goto out1;
a71ada305801e9 John Johansen 2017-01-16 2547 }
a71ada305801e9 John Johansen 2017-01-16 2548
a71ada305801e9 John Johansen 2017-01-16 2549 inode->i_ino = get_next_ino();
a71ada305801e9 John Johansen 2017-01-16 2550 inode->i_mode = S_IFCHR | S_IRUGO | S_IWUGO;
24d0d03c2edcd2 Deepa Dinamani 2017-05-08 2551 inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode);
a71ada305801e9 John Johansen 2017-01-16 2552 init_special_inode(inode, S_IFCHR | S_IRUGO | S_IWUGO,
a71ada305801e9 John Johansen 2017-01-16 2553 MKDEV(MEM_MAJOR, 3));
a71ada305801e9 John Johansen 2017-01-16 2554 d_instantiate(dentry, inode);
a71ada305801e9 John Johansen 2017-01-16 2555 aa_null.dentry = dget(dentry);
a71ada305801e9 John Johansen 2017-01-16 2556 aa_null.mnt = mntget(mount);
a71ada305801e9 John Johansen 2017-01-16 2557
a71ada305801e9 John Johansen 2017-01-16 2558 error = 0;
a71ada305801e9 John Johansen 2017-01-16 2559
a71ada305801e9 John Johansen 2017-01-16 2560 out1:
a71ada305801e9 John Johansen 2017-01-16 2561 dput(dentry);
a71ada305801e9 John Johansen 2017-01-16 2562 out:
a71ada305801e9 John Johansen 2017-01-16 2563 inode_unlock(d_inode(parent));
4b30b45c1ddc88 Emanuele Giuseppe Esposito 2020-04-14 2564 mntput(mount);
a71ada305801e9 John Johansen 2017-01-16 2565 return error;
a71ada305801e9 John Johansen 2017-01-16 @2566 }
a71ada305801e9 John Johansen 2017-01-16 2567

:::::: The code at line 2540 was first introduced by commit
:::::: a71ada305801e940ff69c2c58489778760e5148b apparmor: add special .null file used to "close" fds at exec

:::::: TO: John Johansen <[email protected]>
:::::: CC: John Johansen <[email protected]>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]


Attachments:
(No filename) (5.74 kB)
.config.gz (48.06 kB)
Download all attachments