Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1467601 > unrolled thread

[PATCH] net: ipconfig: Fix NULL pointer dereference on RARP/BOOTP/DHCP timeout

Started byGeert Uytterhoeven <geert+renesas@glider.be>
First post2016-08-22 15:10 +0200
Last post2016-08-23 06:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] net: ipconfig: Fix NULL pointer dereference on RARP/BOOTP/DHCP timeout Geert Uytterhoeven <geert+renesas@glider.be> - 2016-08-22 15:10 +0200
    Re: [PATCH] net: ipconfig: Fix NULL pointer dereference on  RARP/BOOTP/DHCP timeout David Miller <davem@davemloft.net> - 2016-08-23 06:10 +0200

#1467601 — [PATCH] net: ipconfig: Fix NULL pointer dereference on RARP/BOOTP/DHCP timeout

FromGeert Uytterhoeven <geert+renesas@glider.be>
Date2016-08-22 15:10 +0200
Subject[PATCH] net: ipconfig: Fix NULL pointer dereference on RARP/BOOTP/DHCP timeout
Message-ID<s8X9f-6I9-7@gated-at.bofh.it>
If no RARP, BOOTP, or DHCP response is received, ic_dev is never set,
causing a NULL pointer dereference in ic_close_devs():

    Sending DHCP requests ...... timed out!
    Unable to handle kernel NULL pointer dereference at virtual address 00000004

To fix this, add a check to avoid dereferencing ic_dev if it is still
NULL.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Fixes: 2647cffb2bc6fbed ("net: ipconfig: Support using "delayed" DHCP replies")
---
 net/ipv4/ipconfig.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index ba9cbeafbb2e0817..071a785c65eb7ab5 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -306,7 +306,7 @@ static void __init ic_close_devs(void)
 	while ((d = next)) {
 		next = d->next;
 		dev = d->dev;
-		if (dev != ic_dev->dev && !netdev_uses_dsa(dev)) {
+		if ((!ic_dev || dev != ic_dev->dev) && !netdev_uses_dsa(dev)) {
 			pr_debug("IP-Config: Downing %s\n", dev->name);
 			dev_change_flags(dev, d->flags);
 		}
-- 
1.9.1

[toc] | [next] | [standalone]


#1468262 — Re: [PATCH] net: ipconfig: Fix NULL pointer dereference on RARP/BOOTP/DHCP timeout

FromDavid Miller <davem@davemloft.net>
Date2016-08-23 06:10 +0200
SubjectRe: [PATCH] net: ipconfig: Fix NULL pointer dereference on RARP/BOOTP/DHCP timeout
Message-ID<s9bcd-7kd-3@gated-at.bofh.it>
In reply to#1467601
From: Geert Uytterhoeven <geert+renesas@glider.be>
Date: Mon, 22 Aug 2016 15:01:03 +0200

> If no RARP, BOOTP, or DHCP response is received, ic_dev is never set,
> causing a NULL pointer dereference in ic_close_devs():
> 
>     Sending DHCP requests ...... timed out!
>     Unable to handle kernel NULL pointer dereference at virtual address 00000004
> 
> To fix this, add a check to avoid dereferencing ic_dev if it is still
> NULL.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Fixes: 2647cffb2bc6fbed ("net: ipconfig: Support using "delayed" DHCP replies")

Applied.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web