netfilter: nfnetlink_queue: fix secctx memory leak
authorLiping Zhang <zlpnobody@gmail.com>
Tue, 28 Mar 2017 14:59:25 +0000 (22:59 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Dec 2017 13:22:13 +0000 (14:22 +0100)
commitbec60b446b526c3b11c92eeaa3e2c4b8edb8a51f
tree8b436311ee93dd388ca213e7f0afa78de622b698
parentff1ddbb38b1916a03a31080f34d7d42257c5c5ac
netfilter: nfnetlink_queue: fix secctx memory leak

[ Upstream commit 77c1c03c5b8ef28e55bb0aff29b1e006037ca645 ]

We must call security_release_secctx to free the memory returned by
security_secid_to_secctx, otherwise memory may be leaked forever.

Fixes: ef493bd930ae ("netfilter: nfnetlink_queue: add security context information")
Signed-off-by: Liping Zhang <zlpnobody@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/netfilter/nfnetlink_queue.c