netfilter: nfnetlink_queue: fix secctx memory leak 11/170911/1 accepted/tizen/unified/20180227.063118 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:02:35 +0000 (16:02 +0900)
commitae917d482db537d71f480babb84905f106193d24
treeb432b5164e221f62ca7fc7ea47b33f79f732a8ff
parent1d5c7c583d9b43d1c59b853d6d05e5028ed01d8a
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