Re: [RFC 2/9] Revert "lsm: Remove the socket_post_accept() hook"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Serge E. Hallyn wrote:
> Quoting Samir Bellabes (sam@xxxxxxxxx):
> > This reverts commit 8651d5c0b1f874c5b8307ae2b858bc40f9f02482.
> > 
> > snet needs to reintroduce this hook, as it was designed to be: a hook for
> > updating security informations on objects.
> > 
> > Signed-off-by: Samir Bellabes <sam@xxxxxxxxx>
> 
> Acked-by: Serge Hallyn <serue@xxxxxxxxxx>
> 
> (contingent of course on the proposed user actually going in :)
> 
> > diff --git a/net/socket.c b/net/socket.c
> > index 8984973..fcd4f2b 100644
> > --- a/net/socket.c
> > +++ b/net/socket.c
> > @@ -1557,6 +1557,8 @@ SYSCALL_DEFINE4(accept4, int, fd, struct sockaddr __user *, upeer_sockaddr,
> >  	fd_install(newfd, newfile);
> >  	err = newfd;
> > 
> > +	security_socket_post_accept(sock, newsock);
> > +
> >  out_put:
> >  	fput_light(sock->file, fput_needed);
> >  out:

I think we should call security_socket_post_accept() before fd_install().
Otherwise, other threads which share fd tables can use
security-informations-not-yet-updated accept()ed sockets.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux