diff options
author | Jarek Poplawski <jarkao2@gmail.com> | 2008-06-03 17:53:46 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-06-03 17:53:46 -0400 |
commit | 7dccf1f4e1696c79bff064c3770867cc53cbc71c (patch) | |
tree | 42c7c3b152d02345d41f9253bebb0dd12c23e4ce | |
parent | 537d59af73d894750cff14f90fe2b6d77fbab15b (diff) |
ax25: Fix NULL pointer dereference and lockup.
From: Jarek Poplawski <jarkao2@gmail.com>
There is only one function in AX25 calling skb_append(), and it really
looks suspicious: appends skb after previously enqueued one, but in
the meantime this previous skb could be removed from the queue.
This patch Fixes it the simple way, so this is not fully compatible with
the current method, but testing hasn't shown any problems.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ax25/ax25_subr.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/net/ax25/ax25_subr.c b/net/ax25/ax25_subr.c index d8f215733175..034aa10a5198 100644 --- a/net/ax25/ax25_subr.c +++ b/net/ax25/ax25_subr.c | |||
@@ -64,20 +64,15 @@ void ax25_frames_acked(ax25_cb *ax25, unsigned short nr) | |||
64 | 64 | ||
65 | void ax25_requeue_frames(ax25_cb *ax25) | 65 | void ax25_requeue_frames(ax25_cb *ax25) |
66 | { | 66 | { |
67 | struct sk_buff *skb, *skb_prev = NULL; | 67 | struct sk_buff *skb; |
68 | 68 | ||
69 | /* | 69 | /* |
70 | * Requeue all the un-ack-ed frames on the output queue to be picked | 70 | * Requeue all the un-ack-ed frames on the output queue to be picked |
71 | * up by ax25_kick called from the timer. This arrangement handles the | 71 | * up by ax25_kick called from the timer. This arrangement handles the |
72 | * possibility of an empty output queue. | 72 | * possibility of an empty output queue. |
73 | */ | 73 | */ |
74 | while ((skb = skb_dequeue(&ax25->ack_queue)) != NULL) { | 74 | while ((skb = skb_dequeue_tail(&ax25->ack_queue)) != NULL) |
75 | if (skb_prev == NULL) | 75 | skb_queue_head(&ax25->write_queue, skb); |
76 | skb_queue_head(&ax25->write_queue, skb); | ||
77 | else | ||
78 | skb_append(skb_prev, skb, &ax25->write_queue); | ||
79 | skb_prev = skb; | ||
80 | } | ||
81 | } | 76 | } |
82 | 77 | ||
83 | /* | 78 | /* |