lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Sat, 23 Jul 2011 11:04:19 +0400 From: Michael Tokarev <mjt@....msk.ru> To: David Miller <davem@...emloft.net> CC: penguin-kernel@...ove.SAKURA.ne.jp, casey@...aufler-ca.com, anton@...ba.org, netdev@...r.kernel.org, linux-security-module@...r.kernel.org Subject: Re: [PATCH] net: Fix security_socket_sendmsg() bypass problem. 22.07.2011 19:22, David Miller wrote: > From: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp> > Date: Sat, 23 Jul 2011 00:12:53 +0900 > >> I think the regression for SMACK can be fixed with below patch. >> >> Should I pass nosec flags down to "struct security_operations"->sendmsg() >> so that SELinux checks sock_has_perm() for only once when multiple different >> destination's addresses are passed to sendmmsg()? >> >> static int selinux_socket_sendmsg(struct socket *sock, struct msghdr *msg, >> int size, int nosec) >> { >> return nosec ? 0 : sock_has_perm(current, sock->sk, SOCKET__WRITE); >> } > > Ugh, this takes away a non-trivial part of the performance gain of > sendmmsg(). > > I would instead rather that you check ahead of time whether this > actually is a send to different addresses. If they are all the > same, keep the nosec code path. Why to optimize for this case when destination addresses are the same? How common this usage case is, or even where it _can_ happen alot (I noticed samba.org address in the Cc list). When I saw recvmmsg()/sendmmsg() here, my first thought was an authoritative DNS server which can read several requests at a time and answer them all at once too - this way it all will go to different addresses. I understand the initial change takes away good portion of performance improvement, but I think the optimisation should be performed in a different place than for a not-so-common cenario. Thanks, /mjt -- 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