linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH net-next v6 01/11] bpf: Add eBPF program subtype and is_valid_subtype() verifier (fwd)
@ 2017-03-29 15:14 Julia Lawall
  2017-03-31 21:19 ` Mickaël Salaün
  0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2017-03-29 15:14 UTC (permalink / raw)
  Cc: linux-kernel, Mickaël Salaün, 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

[-- Attachment #1: Type: text/plain, Size: 2795 bytes --]

Size is unsigned, so not negative.

julia

---------- Forwarded message ----------
Date: Wed, 29 Mar 2017 23:06:01 +0800
From: kbuild test robot <fengguang.wu@intel.com>
To: kbuild@01.org
Cc: Julia Lawall <julia.lawall@lip6.fr>
Subject: Re: [PATCH net-next v6 01/11] bpf: Add eBPF program subtype and
    is_valid_subtype() verifier

In-Reply-To: <20170328234650.19695-2-mic@digikod.net>
TO: "Mickaël Salaün" <mic@digikod.net>

Hi Mickaël,

[auto build test WARNING on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Micka-l-Sala-n/Landlock-LSM-Toward-unprivileged-sandboxing/20170329-211258
:::::: branch date: 2 hours ago
:::::: commit date: 2 hours ago

>> kernel/bpf/syscall.c:1041:5-9: WARNING: Unsigned expression compared with zero: size < 0

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

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_BPF */
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 = {};
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_ADMIN) && sysctl_unprivileged_bpf_disabled)
99c55f7d Alexei Starovoitov 2014-09-26  1038  		return -EPERM;
99c55f7d Alexei Starovoitov 2014-09-26  1039
07d282ae Mickaël Salaün     2017-03-29  1040  	size = check_user_buf((void __user *)uattr, size, sizeof(attr));
07d282ae Mickaël Salaün     2017-03-29 @1041  	if (size < 0)
07d282ae Mickaël Salaün     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) != 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:

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next v6 01/11] bpf: Add eBPF program subtype and is_valid_subtype() verifier (fwd)
  2017-03-29 15:14 [PATCH net-next v6 01/11] bpf: Add eBPF program subtype and is_valid_subtype() verifier (fwd) Julia Lawall
@ 2017-03-31 21:19 ` Mickaël Salaün
  0 siblings, 0 replies; 2+ messages in thread
From: Mickaël Salaün @ 2017-03-31 21:19 UTC (permalink / raw)
  To: Julia Lawall
  Cc: linux-kernel, 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


[-- Attachment #1.1: Type: text/plain, Size: 3067 bytes --]

Good catch, thanks again Julia!

 Mickaël

On 29/03/2017 17:14, Julia Lawall wrote:
> Size is unsigned, so not negative.
> 
> julia
> 
> ---------- Forwarded message ----------
> Date: Wed, 29 Mar 2017 23:06:01 +0800
> From: kbuild test robot <fengguang.wu@intel.com>
> To: kbuild@01.org
> Cc: Julia Lawall <julia.lawall@lip6.fr>
> Subject: Re: [PATCH net-next v6 01/11] bpf: Add eBPF program subtype and
>     is_valid_subtype() verifier
> 
> In-Reply-To: <20170328234650.19695-2-mic@digikod.net>
> TO: "Mickaël Salaün" <mic@digikod.net>
> 
> Hi Mickaël,
> 
> [auto build test WARNING on net-next/master]
> 
> url:    https://github.com/0day-ci/linux/commits/Micka-l-Sala-n/Landlock-LSM-Toward-unprivileged-sandboxing/20170329-211258
> :::::: branch date: 2 hours ago
> :::::: commit date: 2 hours ago
> 
>>> kernel/bpf/syscall.c:1041:5-9: WARNING: Unsigned expression compared with zero: size < 0
> 
> 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
> 
> 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_BPF */
> 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 = {};
> 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_ADMIN) && sysctl_unprivileged_bpf_disabled)
> 99c55f7d Alexei Starovoitov 2014-09-26  1038  		return -EPERM;
> 99c55f7d Alexei Starovoitov 2014-09-26  1039
> 07d282ae Mickaël Salaün     2017-03-29  1040  	size = check_user_buf((void __user *)uattr, size, sizeof(attr));
> 07d282ae Mickaël Salaün     2017-03-29 @1041  	if (size < 0)
> 07d282ae Mickaël Salaün     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) != 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:
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-31 21:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-29 15:14 [PATCH net-next v6 01/11] bpf: Add eBPF program subtype and is_valid_subtype() verifier (fwd) Julia Lawall
2017-03-31 21:19 ` Mickaël Salaün

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).