RDS: null pointer dereference in rds_atomic_free_op
authorMohamed Ghannam <simo.ghannam@gmail.com>
Wed, 3 Jan 2018 21:06:06 +0000 (21:06 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 4 Jan 2018 19:19:26 +0000 (14:19 -0500)
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()

Signed-off-by: Mohamed Ghannam <simo.ghannam@gmail.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rds/rdma.c

index 94729d9da43721b49e01b8d85a30e12bad5294cb..634cfcb7bba6833bde376706947c99f1cb103199 100644 (file)
@@ -877,6 +877,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;