Hi David,
[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on cifs/for-next]
[also build test ERROR on dm/for-next linus/master v5.8-rc5 next-20200717]
[cannot apply to security/next-testing pcmoore-selinux/next]
[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
https://git-scm.com/docs/git-format-patch]
url:
https://github.com/0day-ci/linux/commits/David-Howells/keys-Security-chan...
base:
git://git.samba.org/sfrench/cifs-2.6.git for-next
config: i386-randconfig-r032-20200719 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce (this is a W=1 build):
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
> security/keys/keyctl.c:1823:6: error: redefinition of
'keyctl_get_container_keyring'
1823 | long
keyctl_get_container_keyring(int container_fd, key_serial_t destringid)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from security/keys/keyctl.c:29:
security/keys/internal.h:393:20: note: previous definition of
'keyctl_get_container_keyring' was here
393 | static inline long keyctl_get_container_keyring(int container_fd, key_serial_t
destringid)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/keyctl_get_container_keyring +1823 security/keys/keyctl.c
1818
1819 /*
1820 * Get the container keyring attached to a container. The container is
1821 * referenced by a file descriptor referring to, say, a user_namespace.
1822 */
1823 long keyctl_get_container_keyring(int container_fd, key_serial_t
destringid)
1824 {
1825 struct user_namespace *user_ns;
1826 struct ns_common *ns;
1827 struct file *f;
1828 struct key *keyring;
1829 key_ref_t dest_ref;
1830 int ret = -EINVAL;
1831
1832 f = fget(container_fd);
1833 if (!f)
1834 return -EBADF;
1835
1836 if (!proc_ns_file(f))
1837 goto error_file;
1838 ns = get_proc_ns(file_inode(f));
1839 if (ns->ops->type != CLONE_NEWUSER)
1840 goto error_file;
1841 user_ns = container_of(ns, struct user_namespace, ns);
1842
1843 keyring = key_get(READ_ONCE(user_ns->container_keyring));
1844 if (!keyring) {
1845 down_write(&user_ns->keyring_sem);
1846 keyring = key_create_container_keyring(user_ns);
1847 up_write(&user_ns->keyring_sem);
1848 if (IS_ERR(keyring)) {
1849 ret = PTR_ERR(keyring);
1850 goto error_file;
1851 }
1852 }
1853
1854 /* Get the destination keyring if specified. We don't need LINK
1855 * permission on the container keyring as having the container fd is
1856 * sufficient to grant us that.
1857 */
1858 dest_ref = NULL;
1859 if (destringid) {
1860 dest_ref = lookup_user_key(destringid, KEY_LOOKUP_CREATE,
1861 KEY_NEED_KEYRING_ADD);
1862 if (IS_ERR(dest_ref)) {
1863 ret = PTR_ERR(dest_ref);
1864 goto error_keyring;
1865 }
1866
1867 ret = key_link(key_ref_to_ptr(dest_ref), keyring);
1868 if (ret < 0)
1869 goto error_dest;
1870 }
1871
1872 ret = key_serial(keyring);
1873
1874 error_dest:
1875 key_ref_put(dest_ref);
1876 error_keyring:
1877 key_put(keyring);
1878 error_file:
1879 fput(f);
1880 return ret;
1881 }
1882 #endif
1883
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org