All of lore.kernel.org
 help / color / mirror / Atom feed
* [2.6 patch] net/llc/llc_conn.c: fix possible NULL dereference
@ 2007-05-19  5:13 Eugene Teo
  2007-05-19  5:30 ` Randy Dunlap
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Eugene Teo @ 2007-05-19  5:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: Arnaldo Carvalho de Melo

skb_peek() might return an empty list. skb should be checked before calling
llc_pdu_sn_hdr() with it.

Spotted by the Coverity checker.

Signed-off-by: Eugene Teo <eteo@redhat.com>

diff --git a/net/llc/llc_conn.c b/net/llc/llc_conn.c
index 3b8cfbe..28a3994 100644
--- a/net/llc/llc_conn.c
+++ b/net/llc/llc_conn.c
@@ -323,7 +323,8 @@ int llc_conn_remove_acked_pdus(struct sock *sk, u8 nr, u16
*how_many_unacked)

        if (!q_len)
                goto out;
-       skb = skb_peek(&llc->pdu_unack_q);
+       if (! (skb = skb_peek(&llc->pdu_unack_q)))
+               goto out;
        pdu = llc_pdu_sn_hdr(skb);

        /* finding position of last acked pdu in queue */


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-05-19  6:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-19  5:13 [2.6 patch] net/llc/llc_conn.c: fix possible NULL dereference Eugene Teo
2007-05-19  5:30 ` Randy Dunlap
2007-05-19  5:44   ` Eugene Teo
2007-05-19  5:49   ` Eugene Teo
2007-05-19  6:03     ` David Miller
2007-05-19  6:01   ` David Miller
2007-05-19  5:43 ` Herbert Xu
2007-05-19  5:59 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.