[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200905221026.51789.remi.denis-courmont@nokia.com>
Date: Fri, 22 May 2009 10:26:51 +0300
From: "Rémi Denis-Courmont"
<remi.denis-courmont@...ia.com>
To: ext Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: David Miller <davem@...emloft.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Chris Van Hoof <vanhoof@...hat.com>,
Clark Williams <williams@...hat.com>
Subject: Re: [RFC 2/2] net: Allow protocols to provide an unlocked_recvmsg sk_prot method
On Thursday 21 May 2009 02:06:59 ext Arnaldo Carvalho de Melo wrote:
> So that the socket layer kwows which protocol uses locking and can ask
> for an unlocked recvmsg call inside recvmmsg, that takes the lock for a
> batch of packets.
>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
> ---
> include/linux/socket.h | 3 ++
> include/net/sock.h | 5 ++++
> net/core/sock.c | 11 +++++++--
> net/ipv4/udp.c | 52
> ++++++++++++++++++++++++++++++++++++++++------- net/socket.c |
> 39 ++++++++++++++++++++++++----------- 5 files changed, 87 insertions(+),
> 23 deletions(-)
>
> diff --git a/include/linux/socket.h b/include/linux/socket.h
> index 50c6c44..7ef30a3 100644
> --- a/include/linux/socket.h
> +++ b/include/linux/socket.h
> @@ -265,6 +265,9 @@ struct ucred {
> #define MSG_ERRQUEUE 0x2000 /* Fetch message from error queue */
> #define MSG_NOSIGNAL 0x4000 /* Do not generate SIGPIPE */
> #define MSG_MORE 0x8000 /* Sender will send more */
> +#ifdef __KERNEL__
> +#define MSG_UNLOCKED 0x10000 /* Don't lock the sock */
> +#endif
I might be missing something but... What prevents an evil userland from
setting the flag anyway and hitting the BUG case?
--
Rémi Denis-Courmont
Nokia Devices R&D, Maemo Software, Helsinki
--
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