aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChenbo Feng <fengc@google.com>2017-04-19 14:22:47 -0700
committerMoyster <oysterized@gmail.com>2017-05-20 19:26:17 +0200
commit2e3eef83c62657e5b1c32861a774e1a1cc122b14 (patch)
tree3b6371e5fc6d993b1845498b7839529bb9ee8dbf /include
parent1035d5a1aa4f92bb37c1badb6e970051bace8fe6 (diff)
ANDROID: Add untag hacks to inet_release function
To prevent protential risk of memory leak caused by closing socket with out untag it from qtaguid module, the qtaguid module now do not hold any socket file reference count. Instead, it will increase the sk_refcnt of the sk struct to prevent a reuse of the socket pointer. And when a socket is released. It will delete the tag if the socket is previously tagged so no more resources is held by xt_qtaguid moudle. A flag is added to the untag process to prevent possible kernel crash caused by fail to delete corresponding socket_tag_entry list. Bug: 36374484 Test: compile and run test under system/extra/test/iptables, run cts -m CtsNetTestCases -t android.net.cts.SocketRefCntTest Signed-off-by: Chenbo Feng <fengc@google.com> Change-Id: Iea7c3bf0c59b9774a5114af905b2405f6bc9ee52
Diffstat (limited to 'include')
-rw-r--r--include/linux/netfilter/xt_qtaguid.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/netfilter/xt_qtaguid.h b/include/linux/netfilter/xt_qtaguid.h
index ca60fbdec..1c671552e 100644
--- a/include/linux/netfilter/xt_qtaguid.h
+++ b/include/linux/netfilter/xt_qtaguid.h
@@ -10,4 +10,5 @@
#define XT_QTAGUID_SOCKET XT_OWNER_SOCKET
#define xt_qtaguid_match_info xt_owner_match_info
+int qtaguid_untag(struct socket *sock, bool kernel);
#endif /* _XT_QTAGUID_MATCH_H */