Hi Christian,
First bad commit (maybe != root cause):
tree:
https://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux.git
debugfs_namespaces
head: 4e2b1b4274aaf7efdd1c24460febdf001421e695
commit: 738289244f9f67ce3281dfece66c6e2f728b6501 [1/4] debugfs: add ns entry
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-rc1-42-g38eda53-dirty
git checkout 738289244f9f67ce3281dfece66c6e2f728b6501
make ARCH=x86_64 allmodconfig
make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
fs/nsfs.c:196:14: sparse: sparse: undefined identifier 'NS_GET_USERNS'
fs/nsfs.c:198:14: sparse: sparse: undefined identifier 'NS_GET_PARENT'
fs/nsfs.c:202:14: sparse: sparse: undefined identifier 'NS_GET_NSTYPE'
fs/nsfs.c:204:14: sparse: sparse: undefined identifier 'NS_GET_OWNER_UID'
> fs/nsfs.c:196:14: sparse: sparse: incompatible types for
'case' statement
fs/nsfs.c:198:14: sparse: sparse: incompatible types for
'case' statement
fs/nsfs.c:202:14: sparse: sparse: incompatible types for 'case' statement
fs/nsfs.c:204:14: sparse: sparse: incompatible types for 'case' statement
fs/nsfs.c:19:30: sparse: sparse: symbol 'ns_file_operations' redeclared with
different type (originally declared at include/linux/nsfs.h:6) - different modifiers
fs/nsfs.c:244:29: sparse: sparse: undefined identifier 'debugfs_real_fops'
fs/nsfs.c:196:14: sparse: sparse: Expected constant expression in case statement
fs/nsfs.c:198:14: sparse: sparse: Expected constant expression in case statement
fs/nsfs.c:202:14: sparse: sparse: Expected constant expression in case statement
fs/nsfs.c:204:14: sparse: sparse: Expected constant expression in case statement
vim +/case +196 fs/nsfs.c
6786741dbf99e44 Andrey Vagin 2016-09-06 186
6786741dbf99e44 Andrey Vagin 2016-09-06 187 static long ns_ioctl(struct
file *filp, unsigned int ioctl,
6786741dbf99e44 Andrey Vagin 2016-09-06 188 unsigned long arg)
6786741dbf99e44 Andrey Vagin 2016-09-06 189 {
d95fa3c76a66b6d Michael Kerrisk (man-pages 2017-01-25 190) struct user_namespace
*user_ns;
6786741dbf99e44 Andrey Vagin 2016-09-06 191 struct ns_common *ns =
get_proc_ns(file_inode(filp));
d95fa3c76a66b6d Michael Kerrisk (man-pages 2017-01-25 192) uid_t __user *argp;
d95fa3c76a66b6d Michael Kerrisk (man-pages 2017-01-25 193) uid_t uid;
6786741dbf99e44 Andrey Vagin 2016-09-06 194
6786741dbf99e44 Andrey Vagin 2016-09-06 195 switch (ioctl) {
6786741dbf99e44 Andrey Vagin 2016-09-06 @196 case NS_GET_USERNS:
6786741dbf99e44 Andrey Vagin 2016-09-06 197 return open_related_ns(ns,
ns_get_owner);
a7306ed8d94af72 Andrey Vagin 2016-09-06 198 case NS_GET_PARENT:
a7306ed8d94af72 Andrey Vagin 2016-09-06 199 if
(!ns->ops->get_parent)
a7306ed8d94af72 Andrey Vagin 2016-09-06 200 return -EINVAL;
a7306ed8d94af72 Andrey Vagin 2016-09-06 201 return open_related_ns(ns,
ns->ops->get_parent);
e5ff5ce6e20ee22 Michael Kerrisk (man-pages 2017-01-25 202) case NS_GET_NSTYPE:
e5ff5ce6e20ee22 Michael Kerrisk (man-pages 2017-01-25 203) return
ns->ops->type;
d95fa3c76a66b6d Michael Kerrisk (man-pages 2017-01-25 204) case NS_GET_OWNER_UID:
d95fa3c76a66b6d Michael Kerrisk (man-pages 2017-01-25 205) if (ns->ops->type !=
CLONE_NEWUSER)
d95fa3c76a66b6d Michael Kerrisk (man-pages 2017-01-25 206) return -EINVAL;
d95fa3c76a66b6d Michael Kerrisk (man-pages 2017-01-25 207) user_ns = container_of(ns,
struct user_namespace, ns);
d95fa3c76a66b6d Michael Kerrisk (man-pages 2017-01-25 208) argp = (uid_t __user *)
arg;
d95fa3c76a66b6d Michael Kerrisk (man-pages 2017-01-25 209) uid =
from_kuid_munged(current_user_ns(), user_ns->owner);
d95fa3c76a66b6d Michael Kerrisk (man-pages 2017-01-25 210) return put_user(uid,
argp);
6786741dbf99e44 Andrey Vagin 2016-09-06 211 default:
6786741dbf99e44 Andrey Vagin 2016-09-06 212 return -ENOTTY;
6786741dbf99e44 Andrey Vagin 2016-09-06 213 }
6786741dbf99e44 Andrey Vagin 2016-09-06 214 }
6786741dbf99e44 Andrey Vagin 2016-09-06 215
:::::: The code at line 196 was first introduced by commit
:::::: 6786741dbf99e44fb0c0ed85a37582b8a26f1c3b nsfs: add ioctl to get an owning user
namespace for ns file descriptor
:::::: TO: Andrey Vagin <avagin(a)openvz.org>
:::::: CC: Eric W. Biederman <ebiederm(a)xmission.com>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation