I am working with/writing a kernel module which communicates with user processes using a custom socket family.
One of the features that I need in this module is "force shutdown", which will close the sockets and somehow notify the user process(es) that the communication has been broken.
I attempted to do the following in the module "shutdown" code:
sk = NULL;
for each open socket. However, the user process is not notified of this, and continues to listen on the socket; and when I try to terminate the process it attempts to close the socket (even though it has been closed in the kernel) and faults.
Any ides on how to properly close a socket from inside a kernel module? Perhaps I need to do something specific in sk_destruct?