mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-25 03:50:24 +09:00
RDMA/i40iw: Fix potential use after free
[ Upstream commit da046d5f89 ]
Release variable dst after logging dst->error to avoid possible use after
free.
Link: https://lore.kernel.org/r/1573022651-37171-1-git-send-email-bianpan2016@163.com
Signed-off-by: Pan Bian <bianpan2016@163.com>
Reviewed-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
f3ebf81ee6
commit
3161ea6733
@@ -2074,9 +2074,9 @@ static int i40iw_addr_resolve_neigh_ipv6(struct i40iw_device *iwdev,
|
||||
dst = i40iw_get_dst_ipv6(&src_addr, &dst_addr);
|
||||
if (!dst || dst->error) {
|
||||
if (dst) {
|
||||
dst_release(dst);
|
||||
i40iw_pr_err("ip6_route_output returned dst->error = %d\n",
|
||||
dst->error);
|
||||
dst_release(dst);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user