netfilter: nfnetlink_queue: fix secctx memory leak 13/170913/1 accepted/tizen/unified/20180227.063123 submit/tizen/20180227.012056
authorLiping Zhang <zlpnobody@gmail.com>
Tue, 28 Mar 2017 14:59:25 +0000 (22:59 +0800)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Fri, 23 Feb 2018 07:14:42 +0000 (16:14 +0900)
commitcae26b14b11813747cf03e66c661f95c3bbb28c4
tree70c2d0a35b3ec80d32f6f7b770928601090fb31a
parentc82182816690b53785bbec28c7fa09d736cbc099
netfilter: nfnetlink_queue: fix secctx memory leak

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>
[sw0312.kim: cherry-pick the commit 77c1c03c5b8 from mainline to fix already backported commit
 - the commit ef493bd930ae ("netfilter: nfnetlink_queue: add security context information") was backported for nether.service in tizen
 - change in net/netfilter/nfnetlink_queue.c is applied to net/netfilter/nfnetlink_queue_core.c]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: Ifbc5f96bb6039503b7390864936fe6eda2e53acb
net/netfilter/nfnetlink_queue_core.c