Passing a socket fd from user mode to a kernel module
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com User-agent: Thunderbird 2.0.0.16 (Windows/20080708) I have worked out what seem to be the correct kernel calls for this. converting the fd to a socket reference in the kernel module: file_socket sock_retain file_drop using the socket from a dedicated kernel thread: sock_send sock_receive cleanup: sock_shutdown sock_release Am I missing something? Joe Lowe _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... I have a file system kernel module that exposes a remote file system via a file system protocol over a socket. Creating/connecting the socket and performing initial authentication to the server is done in user mode. The socket is then handed to the kernel module via an ioctl to a control device. The primary problem is that the sock_retain and sock_release kernel calls are private exports and are not defined in the public kernel headers. Without these calls the socket will get torn down when the user mode process exits or closes the fd. This email sent to site_archiver@lists.apple.com
participants (1)
-
Joe Lowe