From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= Subject: Re: [PATCH net-next v6 01/11] bpf: Add eBPF program subtype and is_valid_subtype() verifier (fwd) Date: Fri, 31 Mar 2017 23:19:35 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="0tVLXNEI92e7PvWIT4vxfaEBh0tcpdoSv" Cc: linux-kernel@vger.kernel.org, Alexei Starovoitov , Andy Lutomirski , Arnaldo Carvalho de Melo , Casey Schaufler , Daniel Borkmann , David Drysdale , "David S . Miller" , "Eric W . Biederman" , James Morris , Jann Horn , Jonathan Corbet , Matthew Garrett , Michael Kerrisk , Kees Cook , Paul Moore , Sargun Dhillon , "Serge E . Hallyn" , Shuah Khan , Tejun Heo , Thomas Graf , To: Julia Lawall Return-path: List-Post: List-Help: List-Unsubscribe: List-Subscribe: In-Reply-To: List-Id: netdev.vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --0tVLXNEI92e7PvWIT4vxfaEBh0tcpdoSv Content-Type: multipart/mixed; boundary="p3fru9CKxWkAjcsTLnO5d6N5aad6JIRJt"; protected-headers="v1" From: =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= To: Julia Lawall Cc: linux-kernel@vger.kernel.org, Alexei Starovoitov , Andy Lutomirski , Arnaldo Carvalho de Melo , Casey Schaufler , Daniel Borkmann , David Drysdale , "David S . Miller" , "Eric W . Biederman" , James Morris , Jann Horn , Jonathan Corbet , Matthew Garrett , Michael Kerrisk , Kees Cook , Paul Moore , Sargun Dhillon , "Serge E . Hallyn" , Shuah Khan , Tejun Heo , Thomas Graf , Will Drewry , kernel-hardening@lists.openwall.com, linux-api@vger.kernel.org, linux-security-module@vger.kernel.org, netdev@vger.kernel.org, kbuild-all@01.org Message-ID: Subject: Re: [PATCH net-next v6 01/11] bpf: Add eBPF program subtype and is_valid_subtype() verifier (fwd) References: In-Reply-To: --p3fru9CKxWkAjcsTLnO5d6N5aad6JIRJt Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Good catch, thanks again Julia! Micka=EBl On 29/03/2017 17:14, Julia Lawall wrote: > Size is unsigned, so not negative. >=20 > julia >=20 > ---------- Forwarded message ---------- > Date: Wed, 29 Mar 2017 23:06:01 +0800 > From: kbuild test robot > To: kbuild@01.org > Cc: Julia Lawall > Subject: Re: [PATCH net-next v6 01/11] bpf: Add eBPF program subtype an= d > is_valid_subtype() verifier >=20 > In-Reply-To: <20170328234650.19695-2-mic@digikod.net> > TO: "Micka=EBl Sala=FCn" >=20 > Hi Micka=EBl, >=20 > [auto build test WARNING on net-next/master] >=20 > url: https://github.com/0day-ci/linux/commits/Micka-l-Sala-n/Landloc= k-LSM-Toward-unprivileged-sandboxing/20170329-211258 > :::::: branch date: 2 hours ago > :::::: commit date: 2 hours ago >=20 >>> kernel/bpf/syscall.c:1041:5-9: WARNING: Unsigned expression compared = with zero: size < 0 >=20 > git remote add linux-review https://github.com/0day-ci/linux > git remote update linux-review > git checkout 07d282aef4f60235407284c0be81d01e352e040b > vim +1041 kernel/bpf/syscall.c >=20 > f4324551 Daniel Mack 2016-11-23 1025 return -EINVAL; > f4324551 Daniel Mack 2016-11-23 1026 } > f4324551 Daniel Mack 2016-11-23 1027 > 7f677633 Alexei Starovoitov 2017-02-10 1028 return ret; > f4324551 Daniel Mack 2016-11-23 1029 } > f4324551 Daniel Mack 2016-11-23 1030 #endif /* CONFIG_CGROUP_B= PF */ > f4324551 Daniel Mack 2016-11-23 1031 > 99c55f7d Alexei Starovoitov 2014-09-26 1032 SYSCALL_DEFINE3(bpf, int,= cmd, union bpf_attr __user *, uattr, unsigned int, size) > 99c55f7d Alexei Starovoitov 2014-09-26 1033 { > 99c55f7d Alexei Starovoitov 2014-09-26 1034 union bpf_attr attr =3D = {}; > 99c55f7d Alexei Starovoitov 2014-09-26 1035 int err; > 99c55f7d Alexei Starovoitov 2014-09-26 1036 > 1be7f75d Alexei Starovoitov 2015-10-07 1037 if (!capable(CAP_SYS_ADM= IN) && sysctl_unprivileged_bpf_disabled) > 99c55f7d Alexei Starovoitov 2014-09-26 1038 return -EPERM; > 99c55f7d Alexei Starovoitov 2014-09-26 1039 > 07d282ae Micka=EBl Sala=FCn 2017-03-29 1040 size =3D check_user_= buf((void __user *)uattr, size, sizeof(attr)); > 07d282ae Micka=EBl Sala=FCn 2017-03-29 @1041 if (size < 0) > 07d282ae Micka=EBl Sala=FCn 2017-03-29 1042 return size; > 99c55f7d Alexei Starovoitov 2014-09-26 1043 > 99c55f7d Alexei Starovoitov 2014-09-26 1044 /* copy attributes from = user space, may be less than sizeof(bpf_attr) */ > 99c55f7d Alexei Starovoitov 2014-09-26 1045 if (copy_from_user(&attr= , uattr, size) !=3D 0) > 99c55f7d Alexei Starovoitov 2014-09-26 1046 return -EFAULT; > 99c55f7d Alexei Starovoitov 2014-09-26 1047 > 99c55f7d Alexei Starovoitov 2014-09-26 1048 switch (cmd) { > 99c55f7d Alexei Starovoitov 2014-09-26 1049 case BPF_MAP_CREATE: >=20 > --- > 0-DAY kernel test infrastructure Open Source Technology = Center > https://lists.01.org/pipermail/kbuild-all Intel Corpo= ration >=20 --p3fru9CKxWkAjcsTLnO5d6N5aad6JIRJt-- --0tVLXNEI92e7PvWIT4vxfaEBh0tcpdoSv Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEUysCyY8er9Axt7hqIt7+33O9apUFAljex+cACgkQIt7+33O9 apVZqggAgu5ylEt22VgNP+4RCV3v3jXAGvFvXBtzIMaUJ/rYxE1lewcayS6pNrnP kKHLfWDe/Kam6fmhNNZAnMxt+PRhzAsSOfcQ8L3ztCE2OhS7Ep0suBf9yKC8imSD O1VVRm7zdn4zVdebs0akpylTdi16f0PfGDXXNrTCpp+ZKiTOjJKh0aYe59ZDUGPL PDeMQuG7Vjparqcnz3ksUBeveTNaB1B++LuBitRGo4KBWootW/++TBwV0vjScxSa RBMZnFnzi9U8M5gKsv6NSiYDSaRlPiiEtallJsWztOacJTHTXDaPXc002wnncwMM D/JTROnn18BPJRk394VGcEV9VNwLfw== =MoLR -----END PGP SIGNATURE----- --0tVLXNEI92e7PvWIT4vxfaEBh0tcpdoSv--