git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
netvsc: reduce maximum GSO size
[pandora-kernel.git]
/
kernel
/
relay.c
diff --git
a/kernel/relay.c
b/kernel/relay.c
index
226fade
..
a535fc9
100644
(file)
--- a/
kernel/relay.c
+++ b/
kernel/relay.c
@@
-164,10
+164,14
@@
depopulate:
*/
static struct rchan_buf *relay_create_buf(struct rchan *chan)
{
*/
static struct rchan_buf *relay_create_buf(struct rchan *chan)
{
- struct rchan_buf *buf = kzalloc(sizeof(struct rchan_buf), GFP_KERNEL);
- if (!buf)
+ struct rchan_buf *buf;
+
+ if (chan->n_subbufs > UINT_MAX / sizeof(size_t *))
return NULL;
return NULL;
+ buf = kzalloc(sizeof(struct rchan_buf), GFP_KERNEL);
+ if (!buf)
+ return NULL;
buf->padding = kmalloc(chan->n_subbufs * sizeof(size_t *), GFP_KERNEL);
if (!buf->padding)
goto free_buf;
buf->padding = kmalloc(chan->n_subbufs * sizeof(size_t *), GFP_KERNEL);
if (!buf->padding)
goto free_buf;
@@
-574,6
+578,8
@@
struct rchan *relay_open(const char *base_filename,
if (!(subbuf_size && n_subbufs))
return NULL;
if (!(subbuf_size && n_subbufs))
return NULL;
+ if (subbuf_size > UINT_MAX / n_subbufs)
+ return NULL;
chan = kzalloc(sizeof(struct rchan), GFP_KERNEL);
if (!chan)
chan = kzalloc(sizeof(struct rchan), GFP_KERNEL);
if (!chan)
@@
-1229,6
+1235,7
@@
static ssize_t subbuf_splice_actor(struct file *in,
struct splice_pipe_desc spd = {
.pages = pages,
.nr_pages = 0,
struct splice_pipe_desc spd = {
.pages = pages,
.nr_pages = 0,
+ .nr_pages_max = PIPE_DEF_BUFFERS,
.partial = partial,
.flags = flags,
.ops = &relay_pipe_buf_ops,
.partial = partial,
.flags = flags,
.ops = &relay_pipe_buf_ops,
@@
-1296,8
+1303,8
@@
static ssize_t subbuf_splice_actor(struct file *in,
ret += padding;
out:
ret += padding;
out:
- splice_shrink_spd(
pipe,
&spd);
-
return ret;
+ splice_shrink_spd(&spd);
+ return ret;
}
static ssize_t relay_file_splice_read(struct file *in,
}
static ssize_t relay_file_splice_read(struct file *in,