diff options
author | Mohamed Ghannam <simo.ghannam@gmail.com> | 2018-01-03 16:06:06 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-01-04 14:19:26 -0500 |
commit | 7d11f77f84b27cef452cee332f4e469503084737 (patch) | |
tree | ac0c45274f5eaff4dfae1056843f59e585eee78b | |
parent | dfe8266b8dd10e12a731c985b725fcf7f0e537f0 (diff) |
RDS: null pointer dereference in rds_atomic_free_op
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>
-rw-r--r-- | net/rds/rdma.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/rds/rdma.c b/net/rds/rdma.c index 94729d9da437..634cfcb7bba6 100644 --- a/net/rds/rdma.c +++ b/net/rds/rdma.c | |||
@@ -877,6 +877,7 @@ int rds_cmsg_atomic(struct rds_sock *rs, struct rds_message *rm, | |||
877 | err: | 877 | err: |
878 | if (page) | 878 | if (page) |
879 | put_page(page); | 879 | put_page(page); |
880 | rm->atomic.op_active = 0; | ||
880 | kfree(rm->atomic.op_notifier); | 881 | kfree(rm->atomic.op_notifier); |
881 | 882 | ||
882 | return ret; | 883 | return ret; |