net: add BUG_ON if kernel advertises msg_namelen > sizeof(struct sockaddr_storage)
authorHannes Frederic Sowa <hannes@stressinduktion.org>
Thu, 21 Nov 2013 02:14:34 +0000 (03:14 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 19 May 2014 05:54:01 +0000 (07:54 +0200)
commitb52a430ce161044be5e8c77a0e3275cc548e2558
tree85f4d0bf574e3ae6d6e7b380d84c7ea9324eb77f
parent4485f23cb4c08b21f0a4434a65c8adf0026d589a
net: add BUG_ON if kernel advertises msg_namelen > sizeof(struct sockaddr_storage)

[ Upstream commit 68c6beb373955da0886d8f4f5995b3922ceda4be ]

In that case it is probable that kernel code overwrote part of the
stack. So we should bail out loudly here.

The BUG_ON may be removed in future if we are sure all protocols are
conformant.

Suggested-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Willy Tarreau <w@1wt.eu>
net/socket.c