diff options
author | 2022-07-24 17:55:58 +0800 | |
---|---|---|
committer | 2022-07-26 23:08:24 +0200 | |
commit | 9c9cb23e00ddf45679b21b4dacc11d1ae7961ebe (patch) | |
tree | 465e49197666e7be63090845a56c00cc4f05b722 /lib/mpi/mpi-bit.c | |
parent | bridge: Do not send empty IFLA_AF_SPEC attribute (diff) | |
download | wireguard-linux-9c9cb23e00ddf45679b21b4dacc11d1ae7961ebe.tar.xz wireguard-linux-9c9cb23e00ddf45679b21b4dacc11d1ae7961ebe.zip |
xfrm: fix refcount leak in __xfrm_policy_check()
The issue happens on an error path in __xfrm_policy_check(). When the
fetching process of the object `pols[1]` fails, the function simply
returns 0, forgetting to decrement the reference count of `pols[0]`,
which is incremented earlier by either xfrm_sk_policy_lookup() or
xfrm_policy_lookup(). This may result in memory leaks.
Fix it by decreasing the reference count of `pols[0]` in that path.
Fixes: 134b0fc544ba ("IPsec: propagate security module errors up from flow_cache_lookup")
Signed-off-by: Xin Xiong <xiongx18@fudan.edu.cn>
Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'lib/mpi/mpi-bit.c')
0 files changed, 0 insertions, 0 deletions