[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090421.181411.26595688.davem@davemloft.net>
Date: Tue, 21 Apr 2009 18:14:11 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: penguin-kernel@...ove.sakura.ne.jp
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().
From: Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>
Date: Wed, 22 Apr 2009 09:55:26 +0900
> David Miller wrote:
>> If poll() says to a listening socket that connections are
>> available, we MUST return a connection from accept() unless
>> there is a hard error.
>
> No application is permitted to assume that accept() returns a connection if
> poll() says that connections are available even if there is an assumption that
> none of sock->ops->accept(), newsock->ops->getname(), move_addr_to_user()
> fails, for there is security_socket_accept() hook which can interrupt between
> "poll()" and "accept()".
>
> There is a possibility that LSM module's policy changes from "allow picking
> the connection up from the listening socket" to "deny picking the connection
> up from the listening socket" after poll() said "connections are available".
> We allow this policy change and we tolerate breakage of the application
> expected semantics.
We had a similar situation with read()'s on UDP sockets.
When poll() says something, it has to stick.
This is not discussable. If these semantics are "necessary", then
what you're doing is definitely misdesigned in my opinion.
--
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