diff mbox

[net-next-2.6] net/core: neighbour update Oops

Message ID 734423.1943.qm@web52004.mail.re2.yahoo.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Doug Kehn July 13, 2010, 3:23 p.m. UTC
When configuring DMVPN (GRE + openNHRP) and a GRE remote
address is configured a kernel Oops is observed.  The
obserseved Oops is caused by a NULL header_ops pointer
(neigh->dev->header_ops) in neigh_update_hhs() when

void (*update)(struct hh_cache*, const struct net_device*, const unsigned char *)
= neigh->dev->header_ops->cache_update;

is executed.  The dev associated with the NULL header_ops is
the GRE interface.  This patch guards against the
possibility that header_ops is NULL.

This Oops was first observed in kernel version 2.6.26.8.

Signed-off-by: Doug Kehn <rdkehn@yahoo.com>
---
 net/core/neighbour.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

Comments

Eric Dumazet July 13, 2010, 3:38 p.m. UTC | #1
Le mardi 13 juillet 2010 à 08:23 -0700, Doug Kehn a écrit :
> When configuring DMVPN (GRE + openNHRP) and a GRE remote
> address is configured a kernel Oops is observed.  The
> obserseved Oops is caused by a NULL header_ops pointer
> (neigh->dev->header_ops) in neigh_update_hhs() when
> 
> void (*update)(struct hh_cache*, const struct net_device*, const unsigned char *)
> = neigh->dev->header_ops->cache_update;
> 
> is executed.  The dev associated with the NULL header_ops is
> the GRE interface.  This patch guards against the
> possibility that header_ops is NULL.
> 
> This Oops was first observed in kernel version 2.6.26.8.
> 
> Signed-off-by: Doug Kehn <rdkehn@yahoo.com>

Acked-by: Eric Dumazet <eric.dumazet@gmail.com>

> ---
>  net/core/neighbour.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/net/core/neighbour.c b/net/core/neighbour.c
> index 6ba1c0e..a4e0a74 100644
> --- a/net/core/neighbour.c
> +++ b/net/core/neighbour.c
> @@ -949,7 +949,10 @@ static void neigh_update_hhs(struct neighbour *neigh)
>  {
>  	struct hh_cache *hh;
>  	void (*update)(struct hh_cache*, const struct net_device*, const unsigned char *)
> -		= neigh->dev->header_ops->cache_update;
> +		= NULL;
> +
> +	if (neigh->dev->header_ops)
> +		update = neigh->dev->header_ops->cache_update;
>  
>  	if (update) {
>  		for (hh = neigh->hh; hh; hh = hh->hh_next) {


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller July 15, 2010, 1:02 a.m. UTC | #2
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 13 Jul 2010 17:38:31 +0200

> Le mardi 13 juillet 2010 à 08:23 -0700, Doug Kehn a écrit :
>> When configuring DMVPN (GRE + openNHRP) and a GRE remote
>> address is configured a kernel Oops is observed.  The
>> obserseved Oops is caused by a NULL header_ops pointer
>> (neigh->dev->header_ops) in neigh_update_hhs() when
>> 
>> void (*update)(struct hh_cache*, const struct net_device*, const unsigned char *)
>> = neigh->dev->header_ops->cache_update;
>> 
>> is executed.  The dev associated with the NULL header_ops is
>> the GRE interface.  This patch guards against the
>> possibility that header_ops is NULL.
>> 
>> This Oops was first observed in kernel version 2.6.26.8.
>> 
>> Signed-off-by: Doug Kehn <rdkehn@yahoo.com>
> 
> Acked-by: Eric Dumazet <eric.dumazet@gmail.com>

Applied and queued up for -stable, thanks!
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 6ba1c0e..a4e0a74 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -949,7 +949,10 @@  static void neigh_update_hhs(struct neighbour *neigh)
 {
 	struct hh_cache *hh;
 	void (*update)(struct hh_cache*, const struct net_device*, const unsigned char *)
-		= neigh->dev->header_ops->cache_update;
+		= NULL;
+
+	if (neigh->dev->header_ops)
+		update = neigh->dev->header_ops->cache_update;
 
 	if (update) {
 		for (hh = neigh->hh; hh; hh = hh->hh_next) {