--- sock.c.orig Mon Mar 27 08:43:41 2000 +++ sock.c Mon Mar 27 08:52:16 2000 @@ -79,6 +79,10 @@ * Jay Schulist : Added SO_ATTACH_FILTER and SO_DETACH_FILTER. * Andi Kleen : Add sock_kmalloc()/sock_kfree_s() * Andi Kleen : Fix write_space callback + * Lorenzo `Gigi Sullivan' Cavallaro: Temporary Fix to local DoS due to + * too big buffer (AF_UNIX SOCK_DGRAM). + * Maybe this will broke something else. + * I apologize. * * To Fix: * @@ -566,6 +570,18 @@ skb->sk = sk; return skb; } + + /* + * kmalloc (mm/slab.c) checks the size to allocate through a + * `cache size struct'. + * If we try to allocate much more then the maximum, just report it + * backwardly. + * XXX Will this broke something, like sock_wait_for_wmem() + * defined in net/core/sock.c ? + * Is this the right way ? + */ + + sk->err = EMSGSIZE; } return NULL; }