Commit 70714ee9 authored by Andrew Morton's avatar Andrew Morton Committed by Jeff Garzik

[PATCH] netpoll: fix null ifa_list pointer dereference

This fixes a bug where netpoll can dereference a null ifa_list pointer when
not supplied an IP address at module load and the interface is up but no IP
is configured.

Bonus: unrelated netif_running cleanup

Signed-off by: Jeff Moyer <jmoyer@redhat.com>
Signed-off by: Matt Mackall <mpm@selenic.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent ccaf8b47
...@@ -565,7 +565,7 @@ int netpoll_setup(struct netpoll *np) ...@@ -565,7 +565,7 @@ int netpoll_setup(struct netpoll *np)
goto release; goto release;
} }
if (!(ndev->flags & IFF_UP)) { if (!netif_running(ndev)) {
unsigned short oflags; unsigned short oflags;
unsigned long atmost, atleast; unsigned long atmost, atleast;
...@@ -611,7 +611,7 @@ int netpoll_setup(struct netpoll *np) ...@@ -611,7 +611,7 @@ int netpoll_setup(struct netpoll *np)
rcu_read_lock(); rcu_read_lock();
in_dev = __in_dev_get(ndev); in_dev = __in_dev_get(ndev);
if (!in_dev) { if (!in_dev || !in_dev->ifa_list) {
rcu_read_unlock(); rcu_read_unlock();
printk(KERN_ERR "%s: no IP address for %s, aborting\n", printk(KERN_ERR "%s: no IP address for %s, aborting\n",
np->name, np->dev_name); np->name, np->dev_name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment