[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200904212126.AJD95821.HFMOFtQJOVFLOS@I-love.SAKURA.ne.jp>
Date: Tue, 21 Apr 2009 21:26:36 +0900
From: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
To: davem@...emloft.net
Cc: paul.moore@...com, linux-security-module@...r.kernel.org,
netdev@...r.kernel.org
Subject: Re: [PATCH] LSM: Add security_socket_post_accept() and security_socket_post_recv_datagram().
David Miller wrote:
> I am saying that you shouldn't be dropping connections like
> this.
Please don't assume that we are talking about labeled networking.
I want to implement TCPwrapper-like filtering (which is automatically linked to
all processes).
> You've already accepted the packet, you cannot reneg on this.
TCPwrapper accepts the packet before it decides to drop the connection.
> You must either allow the socket to have the connection with
> current labels or give it a label appropriate for the socket.
The socket_post_accept() hook is not designed for modifying labels of a socket.
It is too late to modify because we have already accepted the packet.
+ * @socket_post_accept:
+ * This hook allows a security module to filter connections from unwanted
+ * peers based on the process accepting this connection.
+ * The connection will be aborted if this hook returns nonzero.
+ * This hook is not designed for updating security attributes of
+ * an accept()ed socket, for the accept()ed socket has already sent
+ * several packets (e.g. TCP's SYN/ACK packet and some ACK packets for
+ * incoming data) before this hook is called.
+ * @sock contains the listening socket structure.
+ * @newsock contains the newly created server socket for connection.
+ * Return 0 if permission is granted.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists