[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1384583569.8604.4.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Fri, 15 Nov 2013 22:32:49 -0800
From: Eric Dumazet <eric.dumazet@...il.com>
To: Hannes Frederic Sowa <hannes@...essinduktion.org>
Cc: mpb <mpb.mail@...il.com>, netdev@...r.kernel.org
Subject: Re: [PATCH v2] socket: don't return uninitialized addresses on
concurrent socket shutdown
On Sat, 2013-11-16 at 06:48 +0100, Hannes Frederic Sowa wrote:
> If a blocking read waits on a socket which gets concurrently shut down we
> return 0 as error and so indicate success to the socket functions which
> thus copy an uninitialized stack allocated address back to the user.
> Fix this by clearing the 128 byte size (on x86-64) address first.
>
> This patch fixes the problem for recvfrom, recvmsg and recvmmsg.
>
> Reported-by: mpb <mpb.mail@...il.com>
> Signed-off-by: Hannes Frederic Sowa <hannes@...essinduktion.org>
> ---
Are you clearing 128 bytes on every recvfrom() system call, just in case
of this shutdown() issue ?
Can't we avoid this overhead ?
msg.msg_namelen should be set to 0 in this case.
--
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