[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.20.1710121129510.17334@t440.gateway.2wire.net>
Date: Thu, 12 Oct 2017 11:31:34 +1100 (AEDT)
From: James Morris <james.l.morris@...cle.com>
To: Chenbo Feng <chenbofeng.kernel@...il.com>
cc: netdev@...r.kernel.org, SELinux <Selinux@...ho.nsa.gov>,
linux-security-module@...r.kernel.org,
Jeffrey Vander Stoep <jeffv@...gle.com>,
Lorenzo Colitti <lorenzo@...gle.com>,
Alexei Starovoitov <alexei.starovoitov@...il.com>,
Daniel Borkmann <daniel@...earbox.net>,
Chenbo Feng <fengc@...gle.com>
Subject: Re: [PATCH net-next 2/4] security: bpf: Add LSM hooks for bpf object
related syscall
On Wed, 4 Oct 2017, Chenbo Feng wrote:
> int bpf_map_new_fd(struct bpf_map *map, int flags)
> {
> + if (security_bpf_map(map, OPEN_FMODE(flags)))
> + return -EPERM;
> +
Don't hardcode -EPERM here, return the actual error from
security_bpf_map().
> + if (security_bpf_prog(prog))
> + return -EPERM;
> +
Same.
> + err = security_bpf(cmd, &attr, size);
> + if (err)
> + return -EPERM;
Same.
- James
Powered by blists - more mailing lists