Re: [PATCH net] net: add validation for the socket syscall protocol argument

2015-12-14 Thread David Miller
From: Hannes Frederic Sowa Date: Mon, 14 Dec 2015 17:17:49 +0100 > diff --git a/net/socket.c b/net/socket.c > index 456fadb..d2f3d49 100644 > --- a/net/socket.c > +++ b/net/socket.c > @@ -1098,6 +1098,9 @@ int __sock_create(struct net *net, int family, int > type, int protocol, > r

Re: [PATCH net] net: add validation for the socket syscall protocol argument

2015-12-14 Thread Cong Wang
On Mon, Dec 14, 2015 at 8:17 AM, Hannes Frederic Sowa wrote: > --- a/net/socket.c > +++ b/net/socket.c > @@ -1098,6 +1098,9 @@ int __sock_create(struct net *net, int family, int > type, int protocol, > return -EAFNOSUPPORT; > if (type < 0 || type >= SOCK_MAX) >

[PATCH net] net: add validation for the socket syscall protocol argument

2015-12-14 Thread Hannes Frederic Sowa
郭永刚 reported that one could simply crash the kernel as root by using a simple program: int socket_fd; struct sockaddr_in addr; addr.sin_port = 0; addr.sin_addr.s_addr = INADDR_ANY; addr.sin_family = 10; socket_fd = socket(10,3,0x4000); c