Skip to contentSkip to conversation

Fix for ipv6_setsockopt NULL dereference

DISCUSSION Applied Olaf Kirch 3 participants 4 messages Mar 9, 2007 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Olaf Kirch

author
#1 lore raw
In reply to a message not in the archive

I came across this bug in http://bugzilla.kernel.org/show_bug.cgi?id=8155

Here's a potential fix.

Olaf

Signature · 24 lines
Olaf Kirch  |  --- o --- Nous sommes du soleil we love when we play
[email protected] |    / | \   sol.dhoop.naytheet.ah kin.ir.samse.qurax
--
Fix NULL pointer derefence in ipv6_setsockopt, as described in bug #8155.

Signed-off-by: [email protected]

---
 net/ipv6/ipv6_sockglue.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: build-2.6/net/ipv6/ipv6_sockglue.c
===================================================================
--- build-2.6.orig/net/ipv6/ipv6_sockglue.c
+++ build-2.6/net/ipv6/ipv6_sockglue.c
@@ -413,7 +413,7 @@ static int do_ipv6_setsockopt(struct soc
 		}
 
 		/* routing header option needs extra check */
-		if (optname == IPV6_RTHDR && opt->srcrt) {
+		if (optname == IPV6_RTHDR && opt && opt->srcrt) {
 			struct ipv6_rt_hdr *rthdr = opt->srcrt;
 			switch (rthdr->type) {
 			case IPV6_SRCRT_TYPE_0:
maintainer Applied
#4 lore raw
In reply to Olaf Kirch

From: Olaf Kirch <[email protected]>
Date: Fri, 9 Mar 2007 15:15:54 +0100

Quoted 12 lines

I came across this bug in http://bugzilla.kernel.org/show_bug.cgi?id=8155

Here's a potential fix.

Olaf

Signature · 6 lines
Olaf Kirch  |  --- o --- Nous sommes du soleil we love when we play
[email protected] |    / | \   sol.dhoop.naytheet.ah kin.ir.samse.qurax
--
Fix NULL pointer derefence in ipv6_setsockopt, as described in bug #8155.

Signed-off-by: [email protected]

Applied, thanks a lot Olaf.

I'll push this to -stable too.

maintainer
#3 lore raw
In reply to YOSHIFUJI Hideaki / 吉藤英明

From: YOSHIFUJI Hideaki / 吉藤英明 <[email protected]>
Date: Fri, 09 Mar 2007 23:40:25 +0900 (JST)

Quoted 11 lines

In article <[email protected]> (at Fri, 9 Mar 2007 15:15:54 +0100), Olaf Kirch <[email protected]> says:

Quoted 1 line

I came across this bug in http://bugzilla.kernel.org/show_bug.cgi?id=8155

:

Quoted 3 lines

Fix NULL pointer derefence in ipv6_setsockopt, as described in bug #8155.

Signed-off-by [email protected]

I also ack to push this to -stable.

Thank you for reviewing.