]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
xfrm: do not call rcu_read_unlock when afinfo is NULL in xfrm_get_tos
authorXin Long <lucien.xin@gmail.com>
Sat, 17 Feb 2018 07:16:22 +0000 (15:16 +0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 27 Aug 2018 14:40:05 +0000 (16:40 +0200)
commit7761f73a93f44cbcc739274ee72c8da4ca5575bb
treed105ea760d00a30809628f5734497ec69222f634
parent255bf91d8c0284d1fe806c0878c157234058d658
xfrm: do not call rcu_read_unlock when afinfo is NULL in xfrm_get_tos

BugLink: http://bugs.launchpad.net/bugs/1786352
[ Upstream commit 143a4454daaf0e80a2b9f37159a0d6d2b61e64ed ]

When xfrm_policy_get_afinfo returns NULL, it will not hold rcu
read lock. In this case, rcu_read_unlock should not be called
in xfrm_get_tos, just like other places where it's calling
xfrm_policy_get_afinfo.

Fixes: f5e2bb4f5b22 ("xfrm: policy: xfrm_get_tos cannot fail")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
net/xfrm/xfrm_policy.c