On Wed, Jan 12, 2022 at 12:16 PM Yonghong Song <yhs@xxxxxx> wrote: > + > + /* check __user tag */ > + t = btf_type_by_id(btf, mtype->type); > + if (btf_type_is_type_tag(t)) { > + tag_value = __btf_name_by_offset(btf, t->name_off); > + if (strcmp(tag_value, "user") == 0) > + tmp_flag = MEM_USER; > + } > + > stype = btf_type_skip_modifiers(btf, mtype->type, &id); Does LLVM guarantee that btf_tag will be the first in the modifiers? Looking at the selftest: +struct bpf_testmod_btf_type_tag_2 { + struct bpf_testmod_btf_type_tag_1 __user *p; +}; What if there are 'const' or 'volatile' modifiers on that pointer too? And in different order with btf_tag? BTF gets normalized or not? I wonder whether we should introduce something like btf_type_collect_modifiers() instead of btf_type_skip_modifiers() ?