[PATCH net-next 2/4] security: bpf: Add LSM hooks for bpf object related syscall

From
James Morris <hidden>
Date
2017-10-12 00:31:34
Also in
netdev, selinux
Reply to
Chenbo Feng, 2017-10-04
On Wed, 4 Oct 2017, Chenbo Feng wrote:
quoted hunk ↗ jump to hunk
 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().
quoted hunk ↗ jump to hunk
+	if (security_bpf_prog(prog))
+		return -EPERM;
+
Same.
quoted hunk ↗ jump to hunk
+	err = security_bpf(cmd, &attr, size);
+	if (err)
+		return -EPERM;
Same.


- James

--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Thread (17 messages) 17 messages, 5 authors, last reply 2017-10-12
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help