Skip to contentSkip to conversation

RDS: null pointer dereference in rds_atomic_free_op

PATCH In review [email protected] 3 participants 3 messages Jan 3, 2018 – Jan 4, 2018 1 message not in the archive

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

PATCH 1/1 RDS: null pointer dereference in rds_atomic_free_op

From: Mohamed Ghannam <[email protected]>

set rm->atomic.op_active to 0 when rds_pin_pages() fails or the user supplied address is invalid,
this prevents a NULL pointer usage in rds_atomic_free_op()

---
 net/rds/rdma.c | 1 +
 1 file changed, 1 insertion(+)
net/rds/rdma.c +1 -0
index bc2f1e0977d6..398932fbaf27 100644
@@ -874,6 +874,7 @@ int rds_cmsg_atomic(struct rds_sock *rs, struct rds_message *rm,
 err:
 	if (page)
 		put_page(page);
+	rm->atomic.op_active = 0;
 	kfree(rm->atomic.op_notifier);
 
 	return ret;
Signature · 1 line
2.14.1

A message that is not in the archive (sent off-list or not yet received): 5a4d45ce.8b8a1c0a.1d072.e5e1-ATjtLOhZ0NVl57MIdRCFDg@public.gmane.org

#2 lore raw
Quoted 8 lines · On 1/3/2018 1:06 PM, [email protected] wrote:

From: Mohamed Ghannam <[email protected]>

set rm->atomic.op_active to 0 when rds_pin_pages() fails or the user supplied address is invalid,
this prevents a NULL pointer usage in rds_atomic_free_op()

---

Good catch !!

--
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