Untag and stop watch on network sockets before closing them.
This patch untags the network sockets tagged with qtaguid_tagSocket()
before closing them, releasing the socket from the qtaguid kernel
module. Without this patch, the socket won't be actually closed.
This patch also removes the socket watch right before closing it, which
forces the epoll to stop watching. Closing the file descriptor would
also stop the watch if no other copy of the socket is kept open.
Explicitly stoping the watch is safer.
Bug: 36264049
Test: Ran update_engine under strace; the /proc/net/xt_qtaguid/ctrl
is called and the socket object destroyed and removed from the epoll.
Change-Id: I75c8befe8929e8e60c9534e0e4072f63b2fab1f4
2 files changed