bug in 2.1.89 include/net/sock.h?

Bill Hawes (whawes@star.net)
Sat, 07 Mar 1998 18:08:24 -0500

This is a multi-part message in MIME format.
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

There seems to be a bug in the inline code for sock_queue_rcv_skb in
include/net/sock.h. After testing for the available space in the socket, the
skb_set_owner_r() routine updates the space. But if packet filtering is enabled,
the skb may be rejected by the filter, but the socket's space is never

The attached patch moves the call to skb_set_owner_r to follow the packet
filtering test.

Content-Type: text/plain; charset=us-ascii; name="inc_sock89-patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="inc_sock89-patch"

--- include/net/sock.h.old Sat Mar 7 15:13:06 1998
+++ include/net/sock.h Sat Mar 7 18:52:21 1998
@@ -731,7 +731,7 @@

- * This might not be the most apropriate place for this two
+ * This might not be the most appropriate place for this two
* but since they are used by a lot of the net related code
* at least they get declared on a include that is common to all
@@ -884,7 +884,6 @@
if (atomic_read(&sk->rmem_alloc) + skb->truesize >= (unsigned)sk->rcvbuf)
return -ENOMEM;
- skb_set_owner_r(skb, sk);

if (sk->filter)
@@ -894,7 +893,8 @@
#endif /* CONFIG_FILTER */

- skb_queue_tail(&sk->receive_queue,skb);
+ skb_set_owner_r(skb, sk);
+ skb_queue_tail(&sk->receive_queue, skb);
if (!sk->dead)
return 0;


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu