[brauner:fs.binfmt 2/2] fs/binfmt_misc.c:86:37: error: no member named 'binfmt_misc' in 'struct user_namespace'

From: kernel test robot
Date: Wed Oct 27 2021 - 20:30:12 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux.git fs.binfmt
head: d484ec2850c2cd85d06837319ef57d6cec24305a
commit: d484ec2850c2cd85d06837319ef57d6cec24305a [2/2] binfmt_misc: allow sandboxed mounts
config: arm-randconfig-c002-20211027 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 5db7568a6a1fcb408eb8988abdaff2a225a8eb72)
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
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux.git/commit/?id=d484ec2850c2cd85d06837319ef57d6cec24305a
git remote add brauner https://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux.git
git fetch --no-tags brauner fs.binfmt
git checkout d484ec2850c2cd85d06837319ef57d6cec24305a
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash fs/

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

All errors (new ones prefixed by >>):

>> fs/binfmt_misc.c:86:37: error: no member named 'binfmt_misc' in 'struct user_namespace'
misc = smp_load_acquire(&user_ns->binfmt_misc);
~~~~~~~ ^
include/asm-generic/barrier.h:171:26: note: expanded from macro 'smp_load_acquire'
__unqual_scalar_typeof(*p) ___p1 = READ_ONCE(*p); \
^
include/linux/compiler_types.h:279:13: note: expanded from macro '__unqual_scalar_typeof'
_Generic((x), \
^
>> fs/binfmt_misc.c:86:37: error: no member named 'binfmt_misc' in 'struct user_namespace'
misc = smp_load_acquire(&user_ns->binfmt_misc);
~~~~~~~ ^
include/asm-generic/barrier.h:171:26: note: expanded from macro 'smp_load_acquire'
__unqual_scalar_typeof(*p) ___p1 = READ_ONCE(*p); \
^
include/linux/compiler_types.h:286:15: note: expanded from macro '__unqual_scalar_typeof'
default: (x)))
^
>> fs/binfmt_misc.c:86:37: error: no member named 'binfmt_misc' in 'struct user_namespace'
misc = smp_load_acquire(&user_ns->binfmt_misc);
~~~~~~~ ^
include/asm-generic/barrier.h:171:48: note: expanded from macro 'smp_load_acquire'
__unqual_scalar_typeof(*p) ___p1 = READ_ONCE(*p); \
^
include/asm-generic/rwonce.h:49:33: note: expanded from macro 'READ_ONCE'
compiletime_assert_rwonce_type(x); \
^
include/asm-generic/rwonce.h:36:35: note: expanded from macro 'compiletime_assert_rwonce_type'
compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:322:22: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^~~~~~~~~
include/linux/compiler_types.h:310:23: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^~~~~~~~~
include/linux/compiler_types.h:302:9: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
>> fs/binfmt_misc.c:86:37: error: no member named 'binfmt_misc' in 'struct user_namespace'
misc = smp_load_acquire(&user_ns->binfmt_misc);
~~~~~~~ ^
include/asm-generic/barrier.h:171:48: note: expanded from macro 'smp_load_acquire'
__unqual_scalar_typeof(*p) ___p1 = READ_ONCE(*p); \
^
include/asm-generic/rwonce.h:49:33: note: expanded from macro 'READ_ONCE'
compiletime_assert_rwonce_type(x); \
^
include/asm-generic/rwonce.h:36:35: note: expanded from macro 'compiletime_assert_rwonce_type'
compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:322:22: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^~~~~~~~~
include/linux/compiler_types.h:310:23: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^~~~~~~~~
include/linux/compiler_types.h:302:9: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
>> fs/binfmt_misc.c:86:37: error: no member named 'binfmt_misc' in 'struct user_namespace'
misc = smp_load_acquire(&user_ns->binfmt_misc);
~~~~~~~ ^
include/asm-generic/barrier.h:171:48: note: expanded from macro 'smp_load_acquire'
__unqual_scalar_typeof(*p) ___p1 = READ_ONCE(*p); \
^
include/asm-generic/rwonce.h:49:33: note: expanded from macro 'READ_ONCE'
compiletime_assert_rwonce_type(x); \
^
include/asm-generic/rwonce.h:36:35: note: expanded from macro 'compiletime_assert_rwonce_type'
compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:322:22: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^~~~~~~~~
include/linux/compiler_types.h:310:23: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^~~~~~~~~
include/linux/compiler_types.h:302:9: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
>> fs/binfmt_misc.c:86:37: error: no member named 'binfmt_misc' in 'struct user_namespace'
misc = smp_load_acquire(&user_ns->binfmt_misc);
~~~~~~~ ^
include/asm-generic/barrier.h:171:48: note: expanded from macro 'smp_load_acquire'
__unqual_scalar_typeof(*p) ___p1 = READ_ONCE(*p); \
^
include/asm-generic/rwonce.h:49:33: note: expanded from macro 'READ_ONCE'
compiletime_assert_rwonce_type(x); \
^
include/asm-generic/rwonce.h:36:35: note: expanded from macro 'compiletime_assert_rwonce_type'
compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:322:22: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^~~~~~~~~
include/linux/compiler_types.h:310:23: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^~~~~~~~~
include/linux/compiler_types.h:302:9: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
>> fs/binfmt_misc.c:86:37: error: no member named 'binfmt_misc' in 'struct user_namespace'
misc = smp_load_acquire(&user_ns->binfmt_misc);
~~~~~~~ ^
include/asm-generic/barrier.h:171:48: note: expanded from macro 'smp_load_acquire'
__unqual_scalar_typeof(*p) ___p1 = READ_ONCE(*p); \
^
include/asm-generic/rwonce.h:49:33: note: expanded from macro 'READ_ONCE'
compiletime_assert_rwonce_type(x); \
^
include/asm-generic/rwonce.h:36:48: note: expanded from macro 'compiletime_assert_rwonce_type'
compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
^
include/linux/compiler_types.h:322:22: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^~~~~~~~~
include/linux/compiler_types.h:310:23: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^~~~~~~~~
include/linux/compiler_types.h:302:9: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
>> fs/binfmt_misc.c:86:37: error: no member named 'binfmt_misc' in 'struct user_namespace'
misc = smp_load_acquire(&user_ns->binfmt_misc);
~~~~~~~ ^
include/asm-generic/barrier.h:171:48: note: expanded from macro 'smp_load_acquire'
__unqual_scalar_typeof(*p) ___p1 = READ_ONCE(*p); \
^
include/asm-generic/rwonce.h:50:14: note: expanded from macro 'READ_ONCE'
__READ_ONCE(x); \
^
include/asm-generic/rwonce.h:44:65: note: expanded from macro '__READ_ONCE'
#define __READ_ONCE(x) (*(const volatile __unqual_scalar_typeof(x) *)&(x))
^
include/linux/compiler_types.h:279:13: note: expanded from macro '__unqual_scalar_typeof'
_Generic((x), \
^
>> fs/binfmt_misc.c:86:37: error: no member named 'binfmt_misc' in 'struct user_namespace'
misc = smp_load_acquire(&user_ns->binfmt_misc);
~~~~~~~ ^
include/asm-generic/barrier.h:171:48: note: expanded from macro 'smp_load_acquire'
__unqual_scalar_typeof(*p) ___p1 = READ_ONCE(*p); \
^
include/asm-generic/rwonce.h:50:14: note: expanded from macro 'READ_ONCE'
__READ_ONCE(x); \
^
include/asm-generic/rwonce.h:44:65: note: expanded from macro '__READ_ONCE'
#define __READ_ONCE(x) (*(const volatile __unqual_scalar_typeof(x) *)&(x))
^
include/linux/compiler_types.h:286:15: note: expanded from macro '__unqual_scalar_typeof'
default: (x)))
^
>> fs/binfmt_misc.c:86:37: error: no member named 'binfmt_misc' in 'struct user_namespace'
misc = smp_load_acquire(&user_ns->binfmt_misc);
~~~~~~~ ^
include/asm-generic/barrier.h:171:48: note: expanded from macro 'smp_load_acquire'
__unqual_scalar_typeof(*p) ___p1 = READ_ONCE(*p); \
^
include/asm-generic/rwonce.h:50:14: note: expanded from macro 'READ_ONCE'
__READ_ONCE(x); \
^
include/asm-generic/rwonce.h:44:72: note: expanded from macro '__READ_ONCE'
#define __READ_ONCE(x) (*(const volatile __unqual_scalar_typeof(x) *)&(x))
^
>> fs/binfmt_misc.c:86:37: error: no member named 'binfmt_misc' in 'struct user_namespace'
misc = smp_load_acquire(&user_ns->binfmt_misc);
~~~~~~~ ^
include/asm-generic/barrier.h:172:34: note: expanded from macro 'smp_load_acquire'
compiletime_assert_atomic_type(*p); \
^
include/linux/compiler_types.h:325:35: note: expanded from macro 'compiletime_assert_atomic_type'
compiletime_assert(__native_word(t), \
^
include/linux/compiler_types.h:290:10: note: expanded from macro '__native_word'
(sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || \
^
include/linux/compiler_types.h:322:22: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^~~~~~~~~
include/linux/compiler_types.h:310:23: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^~~~~~~~~
include/linux/compiler_types.h:302:9: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
>> fs/binfmt_misc.c:86:37: error: no member named 'binfmt_misc' in 'struct user_namespace'
misc = smp_load_acquire(&user_ns->binfmt_misc);
~~~~~~~ ^
include/asm-generic/barrier.h:172:34: note: expanded from macro 'smp_load_acquire'
compiletime_assert_atomic_type(*p); \
^
include/linux/compiler_types.h:325:35: note: expanded from macro 'compiletime_assert_atomic_type'
compiletime_assert(__native_word(t), \
^
include/linux/compiler_types.h:290:39: note: expanded from macro '__native_word'
(sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || \
^
include/linux/compiler_types.h:322:22: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^~~~~~~~~
include/linux/compiler_types.h:310:23: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^~~~~~~~~
include/linux/compiler_types.h:302:9: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
>> fs/binfmt_misc.c:86:37: error: no member named 'binfmt_misc' in 'struct user_namespace'
misc = smp_load_acquire(&user_ns->binfmt_misc);
~~~~~~~ ^
include/asm-generic/barrier.h:172:34: note: expanded from macro 'smp_load_acquire'
compiletime_assert_atomic_type(*p); \
^
include/linux/compiler_types.h:325:35: note: expanded from macro 'compiletime_assert_atomic_type'
compiletime_assert(__native_word(t), \
^
include/linux/compiler_types.h:291:10: note: expanded from macro '__native_word'
sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long))
^
include/linux/compiler_types.h:322:22: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^~~~~~~~~
include/linux/compiler_types.h:310:23: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^~~~~~~~~
include/linux/compiler_types.h:302:9: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
>> fs/binfmt_misc.c:86:37: error: no member named 'binfmt_misc' in 'struct user_namespace'
misc = smp_load_acquire(&user_ns->binfmt_misc);
~~~~~~~ ^
include/asm-generic/barrier.h:172:34: note: expanded from macro 'smp_load_acquire'
compiletime_assert_atomic_type(*p); \
^
include/linux/compiler_types.h:325:35: note: expanded from macro 'compiletime_assert_atomic_type'
compiletime_assert(__native_word(t), \
^
include/linux/compiler_types.h:291:38: note: expanded from macro '__native_word'
sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long))
^
include/linux/compiler_types.h:322:22: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^~~~~~~~~
include/linux/compiler_types.h:310:23: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^~~~~~~~~
include/linux/compiler_types.h:302:9: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
>> fs/binfmt_misc.c:86:37: error: no member named 'binfmt_misc' in 'struct user_namespace'
misc = smp_load_acquire(&user_ns->binfmt_misc);
~~~~~~~ ^
include/asm-generic/barrier.h:174:11: note: expanded from macro 'smp_load_acquire'
(typeof(*p))___p1; \
^
>> fs/binfmt_misc.c:86:8: error: assigning to 'struct binfmt_misc *' from incompatible type 'void'
misc = smp_load_acquire(&user_ns->binfmt_misc);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> fs/binfmt_misc.c:112:24: error: incomplete definition of type 'struct binfmt_misc'
list_for_each(l, &misc->entries) {
~~~~^
include/linux/list.h:571:14: note: expanded from macro 'list_for_each'
for (pos = (head)->next; pos != (head); pos = pos->next)
^~~~
fs/binfmt_misc.c:80:15: note: forward declaration of 'struct binfmt_misc'
static struct binfmt_misc *binfmt_misc(struct user_namespace *user_ns)
^
>> fs/binfmt_misc.c:112:24: error: incomplete definition of type 'struct binfmt_misc'
list_for_each(l, &misc->entries) {
~~~~^
include/linux/list.h:571:35: note: expanded from macro 'list_for_each'
for (pos = (head)->next; pos != (head); pos = pos->next)
^~~~
fs/binfmt_misc.c:80:15: note: forward declaration of 'struct binfmt_misc'
static struct binfmt_misc *binfmt_misc(struct user_namespace *user_ns)
^
fs/binfmt_misc.c:170:11: error: incomplete definition of type 'struct binfmt_misc'
if (!misc->enabled)
~~~~^
fs/binfmt_misc.c:80:15: note: forward declaration of 'struct binfmt_misc'
static struct binfmt_misc *binfmt_misc(struct user_namespace *user_ns)
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.


vim +86 fs/binfmt_misc.c

79
80 static struct binfmt_misc *binfmt_misc(struct user_namespace *user_ns)
81 {
82 while (user_ns) {
83 struct binfmt_misc *misc;
84
85 /* Pairs with smp_store_release() in bm_fill_super(). */
> 86 misc = smp_load_acquire(&user_ns->binfmt_misc);
87 if (misc)
88 return misc;
89
90 user_ns = user_ns->parent;
91 }
92
93 /*
94 * As the first user namespace is initialized with
95 * &init_binfmt_misc we should never come here.
96 */
97 WARN_ON_ONCE(1);
98 return ERR_PTR(-EINVAL);
99 }
100
101 /*
102 * Check if we support the binfmt
103 * if we do, return the node, else NULL
104 * locking is done in load_misc_binary
105 */
106 static Node *check_file(struct binfmt_misc *misc, struct linux_binprm *bprm)
107 {
108 char *p = strrchr(bprm->interp, '.');
109 struct list_head *l;
110
111 /* Walk all the registered handlers. */
> 112 list_for_each(l, &misc->entries) {
113 Node *e = list_entry(l, Node, list);
114 char *s;
115 int j;
116
117 /* Make sure this one is currently enabled. */
118 if (!test_bit(Enabled, &e->flags))
119 continue;
120
121 /* Do matching based on extension if applicable. */
122 if (!test_bit(Magic, &e->flags)) {
123 if (p && !strcmp(e->magic, p + 1))
124 return e;
125 continue;
126 }
127
128 /* Do matching based on magic & mask. */
129 s = bprm->buf + e->offset;
130 if (e->mask) {
131 for (j = 0; j < e->size; j++)
132 if ((*s++ ^ e->magic[j]) & e->mask[j])
133 break;
134 } else {
135 for (j = 0; j < e->size; j++)
136 if ((*s++ ^ e->magic[j]))
137 break;
138 }
139 if (j == e->size)
140 return e;
141 }
142 return NULL;
143 }
144

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip