* CLONE_NEWNET requires CAP_NET_RAW (and the intended CAP_SYS_ADMIN)
@ 2009-11-03 20:15 Eric Paris
2009-11-04 13:33 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Eric Paris @ 2009-11-03 20:15 UTC (permalink / raw)
To: netdev; +Cc: nhorman, acme, dwalsh
We just saw today, because vsftpd just started using by default, that
CLONE_NEWNET requires both the intended CAP_SYS_ADMIN (see
kernel/nsproxy.c::copy_namespace()) and the unintended CAP_NET_RAW.
This is because tcp_sk_init() calls inet_ctl_sock_create() with
SOCK_RAW. Ultimately we end up in inet_create() which see that
answer->capability is equal to CAP_NET_RAW. So now it checks
capable(CAP_NET_RAW).
What you will find is that the generic __sock_create() has an argument
"int kern" which is passed to the security server to bypass checks which
were caused by the kernel, not because of userspace. That flag is not
passed down to the create() function in struct net_proto_family. I
think the easiest solution is to add the kern argument to the
net_proto_family create function and pass it along to the security
system so it can make the right decision.
I also see that the whole capability checking in struct inet_protosw
(and can, dccp, and sctp) seem overly complicated. Most of it (all but
inet) could just be deleted since they aren't doing anything. Inet
could replace it with just a single if (SOCK_RAW) which make the
security server changes very simple....
Did I explain my problem (I don't want to check CAP_NET_RAW)? Do people
see an issue with me passing kern down to create? Anyone have problems
with me ripping out the half ass unused security infrastructure?
-Eric
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-11-04 13:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-03 20:15 CLONE_NEWNET requires CAP_NET_RAW (and the intended CAP_SYS_ADMIN) Eric Paris
2009-11-04 13:33 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox