Skip to content

Commit

Permalink
RDS: null pointer dereference in rds_atomic_free_op
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
0x36 authored and davem330 committed Jan 4, 2018
1 parent dfe8266 commit 7d11f77
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/rds/rdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7d11f77

Please sign in to comment.