aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-26 23:17:56 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-26 23:17:56 -0400
commit228428428138e231a155464239880201e5cc8b44 (patch)
tree89b437f5501d03ca36b717e232337426d0de77ca /net/core
parent78681ac08a611313595d13cafabae1183b71ef48 (diff)
parent6c3b8fc618905d7599dcc514c99ce4293d476f39 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: netns: fix ip_rt_frag_needed rt_is_expired netfilter: nf_conntrack_extend: avoid unnecessary "ct->ext" dereferences netfilter: fix double-free and use-after free netfilter: arptables in netns for real netfilter: ip{,6}tables_security: fix future section mismatch selinux: use nf_register_hooks() netfilter: ebtables: use nf_register_hooks() Revert "pkt_sched: sch_sfq: dump a real number of flows" qeth: use dev->ml_priv instead of dev->priv syncookies: Make sure ECN is disabled net: drop unused BUG_TRAP() net: convert BUG_TRAP to generic WARN_ON drivers/net: convert BUG_TRAP to generic WARN_ON
Diffstat (limited to 'net/core')
-rw-r--r--net/core/datagram.c8
-rw-r--r--net/core/dev.c10
-rw-r--r--net/core/request_sock.c2
-rw-r--r--net/core/skbuff.c20
-rw-r--r--net/core/stream.c6
-rw-r--r--net/core/user_dma.c5
6 files changed, 25 insertions, 26 deletions
diff --git a/net/core/datagram.c b/net/core/datagram.c
index 8a28fc93b724..dd61dcad6019 100644
--- a/net/core/datagram.c
+++ b/net/core/datagram.c
@@ -285,7 +285,7 @@ int skb_copy_datagram_iovec(const struct sk_buff *skb, int offset,
285 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 285 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
286 int end; 286 int end;
287 287
288 BUG_TRAP(start <= offset + len); 288 WARN_ON(start > offset + len);
289 289
290 end = start + skb_shinfo(skb)->frags[i].size; 290 end = start + skb_shinfo(skb)->frags[i].size;
291 if ((copy = end - offset) > 0) { 291 if ((copy = end - offset) > 0) {
@@ -315,7 +315,7 @@ int skb_copy_datagram_iovec(const struct sk_buff *skb, int offset,
315 for (; list; list = list->next) { 315 for (; list; list = list->next) {
316 int end; 316 int end;
317 317
318 BUG_TRAP(start <= offset + len); 318 WARN_ON(start > offset + len);
319 319
320 end = start + list->len; 320 end = start + list->len;
321 if ((copy = end - offset) > 0) { 321 if ((copy = end - offset) > 0) {
@@ -366,7 +366,7 @@ static int skb_copy_and_csum_datagram(const struct sk_buff *skb, int offset,
366 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 366 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
367 int end; 367 int end;
368 368
369 BUG_TRAP(start <= offset + len); 369 WARN_ON(start > offset + len);
370 370
371 end = start + skb_shinfo(skb)->frags[i].size; 371 end = start + skb_shinfo(skb)->frags[i].size;
372 if ((copy = end - offset) > 0) { 372 if ((copy = end - offset) > 0) {
@@ -402,7 +402,7 @@ static int skb_copy_and_csum_datagram(const struct sk_buff *skb, int offset,
402 for (; list; list=list->next) { 402 for (; list; list=list->next) {
403 int end; 403 int end;
404 404
405 BUG_TRAP(start <= offset + len); 405 WARN_ON(start > offset + len);
406 406
407 end = start + list->len; 407 end = start + list->len;
408 if ((copy = end - offset) > 0) { 408 if ((copy = end - offset) > 0) {
diff --git a/net/core/dev.c b/net/core/dev.c
index 53af7841018a..8d13a9b9f1df 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1973,7 +1973,7 @@ static void net_tx_action(struct softirq_action *h)
1973 struct sk_buff *skb = clist; 1973 struct sk_buff *skb = clist;
1974 clist = clist->next; 1974 clist = clist->next;
1975 1975
1976 BUG_TRAP(!atomic_read(&skb->users)); 1976 WARN_ON(atomic_read(&skb->users));
1977 __kfree_skb(skb); 1977 __kfree_skb(skb);
1978 } 1978 }
1979 } 1979 }
@@ -3847,7 +3847,7 @@ static void rollback_registered(struct net_device *dev)
3847 dev->uninit(dev); 3847 dev->uninit(dev);
3848 3848
3849 /* Notifier chain MUST detach us from master device. */ 3849 /* Notifier chain MUST detach us from master device. */
3850 BUG_TRAP(!dev->master); 3850 WARN_ON(dev->master);
3851 3851
3852 /* Remove entries from kobject tree */ 3852 /* Remove entries from kobject tree */
3853 netdev_unregister_kobject(dev); 3853 netdev_unregister_kobject(dev);
@@ -4169,9 +4169,9 @@ void netdev_run_todo(void)
4169 4169
4170 /* paranoia */ 4170 /* paranoia */
4171 BUG_ON(atomic_read(&dev->refcnt)); 4171 BUG_ON(atomic_read(&dev->refcnt));
4172 BUG_TRAP(!dev->ip_ptr); 4172 WARN_ON(dev->ip_ptr);
4173 BUG_TRAP(!dev->ip6_ptr); 4173 WARN_ON(dev->ip6_ptr);
4174 BUG_TRAP(!dev->dn_ptr); 4174 WARN_ON(dev->dn_ptr);
4175 4175
4176 if (dev->destructor) 4176 if (dev->destructor)
4177 dev->destructor(dev); 4177 dev->destructor(dev);
diff --git a/net/core/request_sock.c b/net/core/request_sock.c
index 2d3035d3abd7..7552495aff7a 100644
--- a/net/core/request_sock.c
+++ b/net/core/request_sock.c
@@ -123,7 +123,7 @@ void reqsk_queue_destroy(struct request_sock_queue *queue)
123 } 123 }
124 } 124 }
125 125
126 BUG_TRAP(lopt->qlen == 0); 126 WARN_ON(lopt->qlen != 0);
127 if (lopt_size > PAGE_SIZE) 127 if (lopt_size > PAGE_SIZE)
128 vfree(lopt); 128 vfree(lopt);
129 else 129 else
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index e4115672b6cf..4e0c92274189 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1200,7 +1200,7 @@ int skb_copy_bits(const struct sk_buff *skb, int offset, void *to, int len)
1200 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 1200 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
1201 int end; 1201 int end;
1202 1202
1203 BUG_TRAP(start <= offset + len); 1203 WARN_ON(start > offset + len);
1204 1204
1205 end = start + skb_shinfo(skb)->frags[i].size; 1205 end = start + skb_shinfo(skb)->frags[i].size;
1206 if ((copy = end - offset) > 0) { 1206 if ((copy = end - offset) > 0) {
@@ -1229,7 +1229,7 @@ int skb_copy_bits(const struct sk_buff *skb, int offset, void *to, int len)
1229 for (; list; list = list->next) { 1229 for (; list; list = list->next) {
1230 int end; 1230 int end;
1231 1231
1232 BUG_TRAP(start <= offset + len); 1232 WARN_ON(start > offset + len);
1233 1233
1234 end = start + list->len; 1234 end = start + list->len;
1235 if ((copy = end - offset) > 0) { 1235 if ((copy = end - offset) > 0) {
@@ -1475,7 +1475,7 @@ int skb_store_bits(struct sk_buff *skb, int offset, const void *from, int len)
1475 skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; 1475 skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
1476 int end; 1476 int end;
1477 1477
1478 BUG_TRAP(start <= offset + len); 1478 WARN_ON(start > offset + len);
1479 1479
1480 end = start + frag->size; 1480 end = start + frag->size;
1481 if ((copy = end - offset) > 0) { 1481 if ((copy = end - offset) > 0) {
@@ -1503,7 +1503,7 @@ int skb_store_bits(struct sk_buff *skb, int offset, const void *from, int len)
1503 for (; list; list = list->next) { 1503 for (; list; list = list->next) {
1504 int end; 1504 int end;
1505 1505
1506 BUG_TRAP(start <= offset + len); 1506 WARN_ON(start > offset + len);
1507 1507
1508 end = start + list->len; 1508 end = start + list->len;
1509 if ((copy = end - offset) > 0) { 1509 if ((copy = end - offset) > 0) {
@@ -1552,7 +1552,7 @@ __wsum skb_checksum(const struct sk_buff *skb, int offset,
1552 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 1552 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
1553 int end; 1553 int end;
1554 1554
1555 BUG_TRAP(start <= offset + len); 1555 WARN_ON(start > offset + len);
1556 1556
1557 end = start + skb_shinfo(skb)->frags[i].size; 1557 end = start + skb_shinfo(skb)->frags[i].size;
1558 if ((copy = end - offset) > 0) { 1558 if ((copy = end - offset) > 0) {
@@ -1581,7 +1581,7 @@ __wsum skb_checksum(const struct sk_buff *skb, int offset,
1581 for (; list; list = list->next) { 1581 for (; list; list = list->next) {
1582 int end; 1582 int end;
1583 1583
1584 BUG_TRAP(start <= offset + len); 1584 WARN_ON(start > offset + len);
1585 1585
1586 end = start + list->len; 1586 end = start + list->len;
1587 if ((copy = end - offset) > 0) { 1587 if ((copy = end - offset) > 0) {
@@ -1629,7 +1629,7 @@ __wsum skb_copy_and_csum_bits(const struct sk_buff *skb, int offset,
1629 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 1629 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
1630 int end; 1630 int end;
1631 1631
1632 BUG_TRAP(start <= offset + len); 1632 WARN_ON(start > offset + len);
1633 1633
1634 end = start + skb_shinfo(skb)->frags[i].size; 1634 end = start + skb_shinfo(skb)->frags[i].size;
1635 if ((copy = end - offset) > 0) { 1635 if ((copy = end - offset) > 0) {
@@ -1662,7 +1662,7 @@ __wsum skb_copy_and_csum_bits(const struct sk_buff *skb, int offset,
1662 __wsum csum2; 1662 __wsum csum2;
1663 int end; 1663 int end;
1664 1664
1665 BUG_TRAP(start <= offset + len); 1665 WARN_ON(start > offset + len);
1666 1666
1667 end = start + list->len; 1667 end = start + list->len;
1668 if ((copy = end - offset) > 0) { 1668 if ((copy = end - offset) > 0) {
@@ -2373,7 +2373,7 @@ __skb_to_sgvec(struct sk_buff *skb, struct scatterlist *sg, int offset, int len)
2373 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 2373 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
2374 int end; 2374 int end;
2375 2375
2376 BUG_TRAP(start <= offset + len); 2376 WARN_ON(start > offset + len);
2377 2377
2378 end = start + skb_shinfo(skb)->frags[i].size; 2378 end = start + skb_shinfo(skb)->frags[i].size;
2379 if ((copy = end - offset) > 0) { 2379 if ((copy = end - offset) > 0) {
@@ -2397,7 +2397,7 @@ __skb_to_sgvec(struct sk_buff *skb, struct scatterlist *sg, int offset, int len)
2397 for (; list; list = list->next) { 2397 for (; list; list = list->next) {
2398 int end; 2398 int end;
2399 2399
2400 BUG_TRAP(start <= offset + len); 2400 WARN_ON(start > offset + len);
2401 2401
2402 end = start + list->len; 2402 end = start + list->len;
2403 if ((copy = end - offset) > 0) { 2403 if ((copy = end - offset) > 0) {
diff --git a/net/core/stream.c b/net/core/stream.c
index 4a0ad152c9c4..a6b3437ff082 100644
--- a/net/core/stream.c
+++ b/net/core/stream.c
@@ -192,13 +192,13 @@ void sk_stream_kill_queues(struct sock *sk)
192 __skb_queue_purge(&sk->sk_error_queue); 192 __skb_queue_purge(&sk->sk_error_queue);
193 193
194 /* Next, the write queue. */ 194 /* Next, the write queue. */
195 BUG_TRAP(skb_queue_empty(&sk->sk_write_queue)); 195 WARN_ON(!skb_queue_empty(&sk->sk_write_queue));
196 196
197 /* Account for returned memory. */ 197 /* Account for returned memory. */
198 sk_mem_reclaim(sk); 198 sk_mem_reclaim(sk);
199 199
200 BUG_TRAP(!sk->sk_wmem_queued); 200 WARN_ON(sk->sk_wmem_queued);
201 BUG_TRAP(!sk->sk_forward_alloc); 201 WARN_ON(sk->sk_forward_alloc);
202 202
203 /* It is _impossible_ for the backlog to contain anything 203 /* It is _impossible_ for the backlog to contain anything
204 * when we get here. All user references to this socket 204 * when we get here. All user references to this socket
diff --git a/net/core/user_dma.c b/net/core/user_dma.c
index 8c6b706963ff..164b090d5ac3 100644
--- a/net/core/user_dma.c
+++ b/net/core/user_dma.c
@@ -27,7 +27,6 @@
27 27
28#include <linux/dmaengine.h> 28#include <linux/dmaengine.h>
29#include <linux/socket.h> 29#include <linux/socket.h>
30#include <linux/rtnetlink.h> /* for BUG_TRAP */
31#include <net/tcp.h> 30#include <net/tcp.h>
32#include <net/netdma.h> 31#include <net/netdma.h>
33 32
@@ -72,7 +71,7 @@ int dma_skb_copy_datagram_iovec(struct dma_chan *chan,
72 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 71 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
73 int end; 72 int end;
74 73
75 BUG_TRAP(start <= offset + len); 74 WARN_ON(start > offset + len);
76 75
77 end = start + skb_shinfo(skb)->frags[i].size; 76 end = start + skb_shinfo(skb)->frags[i].size;
78 copy = end - offset; 77 copy = end - offset;
@@ -101,7 +100,7 @@ int dma_skb_copy_datagram_iovec(struct dma_chan *chan,
101 for (; list; list = list->next) { 100 for (; list; list = list->next) {
102 int end; 101 int end;
103 102
104 BUG_TRAP(start <= offset + len); 103 WARN_ON(start > offset + len);
105 104
106 end = start + list->len; 105 end = start + list->len;
107 copy = end - offset; 106 copy = end - offset;