Like uverbs, strictly check the length parameter: this prevent ucma from processing truncated buffer.
Signed-off-by: Yann Droneaud <[email protected]> Link: http://mid.gmane.org/[email protected] --- drivers/infiniband/core/ucma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c index 92f2248..502e2a2 100644 --- a/drivers/infiniband/core/ucma.c +++ b/drivers/infiniband/core/ucma.c @@ -1573,7 +1573,7 @@ static ssize_t ucma_write(struct file *filp, const char __user *buf, if (copy_from_user(&hdr, buf, sizeof(hdr))) return -EFAULT; - if (hdr.in + sizeof(hdr) > len) + if (hdr.in + sizeof(hdr) != len) return -EINVAL; if (hdr.cmd >= ARRAY_SIZE(ucma_cmd_table)) -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
