From patchwork Mon May 8 03:09:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hangbin Liu X-Patchwork-Id: 759509 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 3wLnYK1NnVz9s8P for ; Mon, 8 May 2017 13:09:57 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="SLSVd/4z"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752257AbdEHDJy (ORCPT ); Sun, 7 May 2017 23:09:54 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:36549 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751710AbdEHDJw (ORCPT ); Sun, 7 May 2017 23:09:52 -0400 Received: by mail-pf0-f194.google.com with SMTP id v14so8050616pfd.3 for ; Sun, 07 May 2017 20:09:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=y93f1D9ZwhyP9tYeaUx9IHT/NGi6fBIjhf6nSCSa2FI=; b=SLSVd/4z75u8lX5FqWE5p+KQFz73PVabDA1xJeQEw2G11ZoVt39arD9ETs1WhYXgxE uPlVEGkn/acIoepuJAwamlT6dAgCxvdF34y5Sr9Khb+wTi5L5U7/EnaQoPMRdUU08nD7 IvGdb0FiMjiJeesxNAWYESbuOYBHxLgsMdvzCCySe5QhEnHWN3DfM7Y+gOoJmyPt6Pxz 91uj23sNmW5pmXtlJ8jMV+8B9n8YoYsqQ2aTGUp8jXHlNL1RjwXD5wv0BeMIg8/0nMWb Q1ckb6VS3I0FlB4WV2+b2NWF5th19M9x/Yi/OFK+t/AiBFEpytDc0D9NrSBNwKMCzOkR FtOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=y93f1D9ZwhyP9tYeaUx9IHT/NGi6fBIjhf6nSCSa2FI=; b=svh77HK9R2++EuGZaWiWkmUkr5oU+aJCn7OZEYO0g7UmeDZHrJkbVaAefvcVe58nbr 34b2PhwAcwc0BfrIPxgFCfI+ciedxllLKFLb9shrWVLwZy1T2QZqlwDWFuH8+8t2Tx0e 2rRaph9hciTgGzdibvSlTrxv5Ccz9kVDEbK1Y/efrocXKNDuFf2wTKohKPgcI2CBI2Li hxOuBLVJ8k1G4UoSGg+izy98R4f1rOiRm8l/pBMhgbbNnWAc20OL/Er632uGwX433EsE N3FMAjVoYb+Rt0jnLpV3Iz6SbEjaxYydKoCGtCmHHeWdaugr1NGRFO9uXOIp4JdZe5zp uYVw== X-Gm-Message-State: AN3rC/4yTp0ptUTF9q77k6X6H8aaBy1L3TFwtISlVS7S9bI1rMDwoPlw gyuAUz692yt2Ww== X-Received: by 10.99.141.76 with SMTP id z73mr16114886pgd.118.1494212992288; Sun, 07 May 2017 20:09:52 -0700 (PDT) Received: from leo.usersys.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id r1sm12326426pfj.68.2017.05.07.20.09.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 May 2017 20:09:51 -0700 (PDT) From: Hangbin Liu To: netdev@vger.kernel.org Cc: Hangbin Liu Subject: [PATCH net] ipv6: make sure dev is not NULL before call ip6_frag_reasm Date: Mon, 8 May 2017 11:09:24 +0800 Message-Id: <1494212964-17861-1-git-send-email-liuhangbin@gmail.com> X-Mailer: git-send-email 2.5.5 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Since ip6_frag_reasm() will call __in6_dev_get(dev), which will access dev->ip6_ptr. We need to make sure dev is not NULL. Signed-off-by: Hangbin Liu --- net/ipv6/reassembly.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index e1da5b8..e3ebd62 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c @@ -348,7 +348,7 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb, fq->q.flags |= INET_FRAG_FIRST_IN; } - if (fq->q.flags == (INET_FRAG_FIRST_IN | INET_FRAG_LAST_IN) && + if (dev && fq->q.flags == (INET_FRAG_FIRST_IN | INET_FRAG_LAST_IN) && fq->q.meat == fq->q.len) { int res; unsigned long orefdst = skb->_skb_refdst;