lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 2 Nov 2006 01:21:53 +0100
From:	Jesper Juhl <jesper.juhl@...il.com>
To:	linux-kernel@...r.kernel.org
Cc:	Jay Schulist <jschlst@...ba.org>,
	Arnaldo Carvalho de Melo <acme@...ectiva.com.br>,
	davem@...emloft.net, Jesper Juhl <jesper.juhl@...il.com>
Subject: [PATCH] LLC: Avoid potential NULL dereference in net/llc/af_llc.c::llc_ui_accept() .

Since skb_dequeue() may return NULL we risk dereferencing a NULL pointer at
  if (!skb->sk)
This patch avoids that by also testing for a NULL skb.


Signed-off-by: Jesper Juhl <jesper.juhl@...il.com>
---

diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c
index 2652ead..a3c885f 100644
--- a/net/llc/af_llc.c
+++ b/net/llc/af_llc.c
@@ -620,7 +620,7 @@ static int llc_ui_accept(struct socket *
 	        llc_sk(sk)->laddr.lsap);
 	skb = skb_dequeue(&sk->sk_receive_queue);
 	rc = -EINVAL;
-	if (!skb->sk)
+	if (!skb || !skb->sk)
 		goto frees;
 	rc = 0;
 	newsk = skb->sk;


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ