From patchwork Tue Jul 13 15:23:16 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Kehn X-Patchwork-Id: 58789 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 22B91B6F16 for ; Wed, 14 Jul 2010 01:30:17 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753957Ab0GMP36 (ORCPT ); Tue, 13 Jul 2010 11:29:58 -0400 Received: from web52004.mail.re2.yahoo.com ([206.190.49.251]:40443 "HELO web52004.mail.re2.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752510Ab0GMP36 (ORCPT ); Tue, 13 Jul 2010 11:29:58 -0400 X-Greylist: delayed 400 seconds by postgrey-1.27 at vger.kernel.org; Tue, 13 Jul 2010 11:29:57 EDT Received: (qmail 2192 invoked by uid 60001); 13 Jul 2010 15:23:16 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1279034596; bh=pjq2QPK5OQW1uWDuI2BVngQwtu1g2he/1ff6ZPDQ57w=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:MIME-Version:Content-Type; b=wkoYf4ekkv1CejSMJ9Nzjdj0YA9IVVnb74eqgflMmkhGANktIUzlhzuHsIhWee0On2IMARke+NSG1I8sejjhQpSA1aAdTZFAoOHFXe5O1IlQIVZ5PjULbnYNQSiuWuhVuVPAx5wcH5nS3FbBT2fL7USff3SlGizTZATO9v5XPhY= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:MIME-Version:Content-Type; b=lCdhJDpYF52yxgIHcb5WiptPo1D/68qy96kz7hjJJ434E+yg7ggdUjjlxdG2VEydyLllm3xq2tDe78RsU+8OzcUf6i2SmuaBTMcEI71jJoTcTs9MPoJ4cbGY77NPAWpzbiM+96LcNQhxuE/hgaDi63NDRPsVbiY/PNKVn2x62jk=; Message-ID: <734423.1943.qm@web52004.mail.re2.yahoo.com> X-YMail-OSG: R2kU0wwVM1lFun6YO3gsekyA1zOAouSxXi7_UH5.mIq.14n dU.26FN0rVr9wMHIyNhXQm0rQ8ogSiaP2km3.0diojCVyi3ThXZsJgQ2bAiW TwUJb58fvfNmCt242t7zsy1wfTLgtHxsWmiSPRUHvY8qkOMn4ZxZKaHeccbt RYTLKIHpFUFRLagP5_PgnrrolfSw1CGpixhb1Tmd6be6QPq5Sm8LH0OB1Fic .GkITSClFs2FFhwigKwnuCkpv8x_SpeTE39UvGpcacRMW6ukEnIXzibOS1C9 _hxtzNbZ_EQkAS8ISKqhmU_E3mClPAoUMm7gqyD.SyHr62jjCETXvMUyO4pf 7hQpHptLd.gs7 Received: from [207.235.117.133] by web52004.mail.re2.yahoo.com via HTTP; Tue, 13 Jul 2010 08:23:16 PDT X-Mailer: YahooMailClassic/11.2.4 YahooMailWebService/0.8.104.276605 Date: Tue, 13 Jul 2010 08:23:16 -0700 (PDT) From: Doug Kehn Subject: [PATCH net-next-2.6] net/core: neighbour update Oops To: davem@davemloft.net Cc: netdev@vger.kernel.org, eric.dumazet@gmail.com MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 Acked-by: Eric Dumazet --- 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) {