Skip to contentSkip to conversation

rds: signedness bug

PATCH Applied Dan Carpenter 2 participants 2 messages Sep 18, 2010 – Sep 19, 2010

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rds: signedness bug

In the original code if the copy_from_user() fails in rds_rdma_pages() then the error handling fails and we get a stack trace from kmalloc().

net/rds/rdma.c +1 -1
index 4806467..1a41deb 100644
@@ -522,7 +522,7 @@ int rds_cmsg_rdma_args(struct rds_sock *rs, struct rds_message *rm,
 	struct rds_rdma_args *args;
 	struct rds_iovec vec;
 	struct rm_rdma_op *op = &rm->rdma;
-	unsigned int nr_pages;
+	int nr_pages;
 	unsigned int nr_bytes;
 	struct page **pages = NULL;
 	struct rds_iovec __user *local_vec;