Content-Type: multipart/mixed; boundary="===============7951686391249833374==" MIME-Version: 1.0 From: Yonghong Song To: kbuild-all@lists.01.org Subject: Re: [RFC PATCH bpf-next v2 12/17] bpf: implement query for target_proto and file dumper prog_id Date: Sat, 18 Apr 2020 23:36:26 -0700 Message-ID: <6111c39b-8a95-eba0-d511-4af7cb801dcf@fb.com> In-Reply-To: <202004162056.Dni4M08R%lkp@intel.com> List-Id: --===============7951686391249833374== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On 4/16/20 5:19 AM, kbuild test robot wrote: > Hi Yonghong, > = > [FYI, it's a private test report for your RFC patch.] > [auto build test ERROR on bpf-next/master] > [also build test ERROR on bpf/master net/master net-next/master linus/mas= ter v5.7-rc1 next-20200416] > [cannot apply to vhost/linux-next ipvs/master] > [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 specif= y the > base tree in git format-patch, please see https://urldefense.proofpoint.c= om/v2/url?u=3Dhttps-3A__stackoverflow.com_a_37406982&d=3DDwIBAg&c=3D5VD0RTt= NlTh3ycd41b3MUw&r=3DDA8e1B5r073vIqRrFz7MRA&m=3DLHMcEj8K8aldylxdqEXw1QKNZxwB= 9ohVMd4MJyHpQ_8&s=3DK9CBIzalCNAABYVV6OfY4D-6Fl9Gm27j0QVLr78cnvo&e=3D ] > = > url: https://github.com/0day-ci/linux/commits/Yonghong-Song/bpf-implem= ent-bpf-based-dumping-of-kernel-data-structures/20200416-064938 > base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git = master > config: i386-debian-10.3 (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=3Di386 > = > If you fix the issue, kindly add following tag as appropriate > Reported-by: kbuild test robot > = > All errors (new ones prefixed by >>): > = > kernel//bpf/dump.c: In function 'bpf_dump_query': >>> kernel//bpf/dump.c:143:28: error: 'struct bpfdump_target_info' has no m= ember named 'prog_ctx_type_name' > prog_ctx_type_name =3D tinfo->prog_ctx_type_name; Thanks for the report. Somehow RFC patch missed this so the whole series = cannot compile due to this. FYI, will fix the issue and send out another RFC patch soon. > ^~ > = > vim +143 kernel//bpf/dump.c > = > 95 = > 96 int bpf_dump_query(const union bpf_attr *attr, union bpf_attr __u= ser *uattr) > 97 { > 98 struct bpf_dump_info __user *ubpf_dinfo; > 99 struct bpfdump_target_info *tinfo; > 100 struct dumper_inode_info *i_info; > 101 struct bpf_dump_info bpf_dinfo; > 102 const char *prog_ctx_type_name; > 103 void * __user tname_buf; > 104 u32 tname_len, info_len; > 105 struct file *filp; > 106 struct fd qfd; > 107 int err =3D 0; > 108 = > 109 qfd =3D fdget(attr->info.dump_query_fd); > 110 filp =3D qfd.file; > 111 if (!filp) > 112 return -EBADF; > 113 = > 114 if (filp->f_op !=3D &bpf_dumper_ops && > 115 filp->f_inode->i_op !=3D &bpfdump_dir_iops) { > 116 err =3D -EINVAL; > 117 goto done; > 118 } > 119 = > 120 info_len =3D attr->info.info_len; > 121 ubpf_dinfo =3D u64_to_user_ptr(attr->info.info); > 122 err =3D bpf_check_uarg_tail_zero(ubpf_dinfo, sizeof(bpf_dinfo), > 123 info_len); > 124 if (err) > 125 goto done; > 126 info_len =3D min_t(u32, sizeof(bpf_dinfo), info_len); > 127 = > 128 memset(&bpf_dinfo, 0, sizeof(bpf_dinfo)); > 129 if (copy_from_user(&bpf_dinfo, ubpf_dinfo, info_len)) { > 130 err =3D -EFAULT; > 131 goto done; > 132 } > 133 = > 134 /* copy prog_id for dumpers */ > 135 if (filp->f_op =3D=3D &bpf_dumper_ops) { > 136 i_info =3D filp->f_inode->i_private; > 137 bpf_dinfo.prog_id =3D i_info->prog->aux->id; > 138 tinfo =3D i_info->tinfo; > 139 } else { > 140 tinfo =3D filp->f_inode->i_private; > 141 } > 142 = > > 143 prog_ctx_type_name =3D tinfo->prog_ctx_type_name; > 144 = > 145 tname_len =3D strlen(prog_ctx_type_name) + 1; > 146 if (bpf_dinfo.type_name_buf_len < tname_len) { > 147 err =3D -ENOSPC; > 148 goto done; > 149 } > 150 = > 151 /* copy prog_ctx_type_name */ > 152 tname_buf =3D u64_to_user_ptr(bpf_dinfo.prog_ctx_type_name); > 153 if (copy_to_user(tname_buf, prog_ctx_type_name, tname_len)) { > 154 err =3D -EFAULT; > 155 goto done; > 156 } > 157 = > 158 /* copy potentially updated bpf_dinfo and info_len */ > 159 if (copy_to_user(ubpf_dinfo, &bpf_dinfo, info_len) || > 160 put_user(info_len, &uattr->info.info_len)) > 161 return -EFAULT; > 162 = > 163 done: > 164 fdput(qfd); > 165 return err; > 166 } > 167 = > = > --- > 0-DAY CI Kernel Test Service, Intel Corporation > https://urldefense.proofpoint.com/v2/url?u=3Dhttps-3A__lists.01.org_hyper= kitty_list_kbuild-2Dall-40lists.01.org&d=3DDwIBAg&c=3D5VD0RTtNlTh3ycd41b3MU= w&r=3DDA8e1B5r073vIqRrFz7MRA&m=3DLHMcEj8K8aldylxdqEXw1QKNZxwB9ohVMd4MJyHpQ_= 8&s=3DfAl6kDNiR5pwjMzanMk8h2IJTWcp-pG4N_1ES9a6-0I&e=3D >=20 --===============7951686391249833374==--