diff options
author | Dan Carpenter <[email protected]> | 2010-10-13 09:13:12 +0000 |
---|---|---|
committer | Roland Dreier <[email protected]> | 2010-12-08 15:23:49 -0800 |
commit | 7182afea8d1afd432a17c18162cc3fd441d0da93 (patch) | |
tree | 6a39903f54a0b1b95cce0d3774d661d3b1f28977 /net/unix/sysctl_net_unix.c | |
parent | 59e57c622c3502346e8f930421ebc482d639520c (diff) |
IB/uverbs: Handle large number of entries in poll CQ
In ib_uverbs_poll_cq() code there is a potential integer overflow if
userspace passes in a large cmd.ne. The calls to kmalloc() would
allocate smaller buffers than intended, leading to memory corruption.
There iss also an information leak if resp wasn't all used.
Unprivileged userspace may call this function, although only if an
RDMA device that uses this function is present.
Fix this by copying CQ entries one at a time, which avoids the
allocation entirely, and also by moving this copying into a function
that makes sure to initialize all memory copied to userspace.
Special thanks to Jason Gunthorpe <[email protected]>
for his help and advice.
Cc: <[email protected]>
Signed-off-by: Dan Carpenter <[email protected]>
[ Monkey around with things a bit to avoid bad code generation by gcc
when designated initializers are used. - Roland ]
Signed-off-by: Roland Dreier <[email protected]>
Diffstat (limited to 'net/unix/sysctl_net_unix.c')
0 files changed, 0 insertions, 0 deletions