projects
/
linux-2.6-microblaze.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
bpf, ringbuf: Deny reserve of buffers larger than ringbuf
[linux-2.6-microblaze.git]
/
kernel
/
bpf
/
ringbuf.c
diff --git
a/kernel/bpf/ringbuf.c
b/kernel/bpf/ringbuf.c
index
f25b719
..
b86d80c
100644
(file)
--- a/
kernel/bpf/ringbuf.c
+++ b/
kernel/bpf/ringbuf.c
@@
-315,6
+315,9
@@
static void *__bpf_ringbuf_reserve(struct bpf_ringbuf *rb, u64 size)
return NULL;
len = round_up(size + BPF_RINGBUF_HDR_SZ, 8);
+ if (len > rb->mask + 1)
+ return NULL;
+
cons_pos = smp_load_acquire(&rb->consumer_pos);
if (in_nmi()) {