Messages in this thread | | | Date | Thu, 5 Mar 1998 18:51:24 -0800 | From | "David S. Miller" <> | Subject | Re: minor patch for 2.1.88 net/core/sock.c |
| |
Date: Thu, 05 Mar 1998 11:48:17 -0500 From: Bill Hawes <whawes@star.net>
The attached patch fixes a minor problem in sock_kmalloc. The test for available space is done before the allocation and the size pre-added to the total, so repeating the test for space after the allocation is not correct.
Are you sure??? If while we sleep, we use up wmem space in the socket (for acks, or other dynamically created TCP output packets, which are generated in response to packets received) while kmalloc() sleeps, we can run into a situation where the sock_kmalloc() should not succeed.
I believe this change opens us to TCP buffer over-commit problems, please don't apply it until the change is scrutinized a bit more.
If anything the code is buggy, and the "+size" should be removed from the second test. If it fails, the free_skb() will subtract from the wmem space of the socket as a side effect and everything is kosher.
Later, David S. Miller davem@dm.cobaltmicro.com
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu
| |