Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp830886yba; Wed, 3 Apr 2019 21:44:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqxNYKM2LkW9fFok2H3c8uMOWySYRq/1MJU6DMfuDXOkwxrxKVo2ljRkybPesSNkMhTebWN6 X-Received: by 2002:a65:50c4:: with SMTP id s4mr3530329pgp.33.1554353053795; Wed, 03 Apr 2019 21:44:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554353053; cv=none; d=google.com; s=arc-20160816; b=ohgZ95NSbbKYde3CSE82JCMPXMeloD+RMI9amIydexnrkxG5j7+O6LbTYA7D3K/zS1 /zEvvT8Ln08Ef7cXlLlP7G5kAg6PlHXVAVNFjgj6Xu9Pi9BCMusMoKYi3/5xhkqLnkSv RJGfxwuoupYDAKmKXC+B9/m7cofp5QkzSe8apMwzDo6ZwqbQeRLRSogKzwoizWzvI/Kt uWJzg4cMsGzLQByRsZ+rXrlA4QLbOkiFXMv9D9Pk/APCDP8H9kg5aDNKYCvAZxUmkHIg /Nv6Qi40zJNJ5laiRrJdzf/zm4ihNFEchPO8LvY1jZTRdI0ia0mH32fWTpM1Jroi3ATK blSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=RfUrrH2L6El4d7CYn8gC5LU2GspMOxXtTgoeZzK4C9I=; b=smGTMKZeAz2XyTbSpSteKbBq1HIW7Dkzm5+3YBBIpggqa0EMCJWNlQKQBnfC09FT/y LNrv8nuCtv60VP74MZtS121etIBlULFMDYFXTbx7vfAEBTZAqaQtVHcFo/QOEuxXOAVA mNkHmdcavzPwPy/nJByIjQOCodr8rIrjAAgdO4fDztYKVhk3REnmi0YzK4RIm+EBlysD KhI8x//ueLv8TzTSTKzsAGWuH7msv3/Eaoh404bm7lrpumgGfF5F4CC9sYVpa4hUXCwq 48z6S2vyyohXskGg95c5J63ig1pHt20qwDjkrGZyaCpomuj6blUm+HIzHDCbIGxVE76h h03A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q3si14832176pff.61.2019.04.03.21.43.58; Wed, 03 Apr 2019 21:44:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726618AbfDDEnP (ORCPT + 99 others); Thu, 4 Apr 2019 00:43:15 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:35300 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725903AbfDDEnP (ORCPT ); Thu, 4 Apr 2019 00:43:15 -0400 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::d71]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id DE078144E3E02; Wed, 3 Apr 2019 21:43:14 -0700 (PDT) Date: Wed, 03 Apr 2019 21:43:14 -0700 (PDT) Message-Id: <20190403.214314.643123707100892779.davem@davemloft.net> To: hujunwei4@huawei.com Cc: kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, mingfangsen@huawei.com, liuzhiqiang26@huawei.com Subject: Re: [PATCH v4 net] ipv6: Fix dangling pointer when ipv6 fragment From: David Miller In-Reply-To: References: X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Wed, 03 Apr 2019 21:43:15 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: hujunwei Date: Tue, 2 Apr 2019 19:38:04 +0800 > From: Junwei Hu > > At the beginning of ip6_fragment func, the prevhdr pointer is > obtained in the ip6_find_1stfragopt func. > However, all the pointers pointing into skb header may change > when calling skb_checksum_help func with > skb->ip_summed = CHECKSUM_PARTIAL condition. > The prevhdr pointe will be dangling if it is not reloaded after > calling __skb_linearize func in skb_checksum_help func. > > Here, I add a variable, nexthdr_offset, to evaluate the offset, > which does not changes even after calling __skb_linearize func. > > Fixes: 405c92f7a541 ("ipv6: add defensive check for CHECKSUM_PARTIAL skbs in ip_fragment") > Signed-off-by: Junwei Hu > Reported-by: Wenhao Zhang > Reported-by: syzbot+e8ce541d095e486074fc@syzkaller.appspotmail.com > Reviewed-by: Zhiqiang Liu > Acked-by: Martin KaFai Lau > --- > V3->V4: > - fix build warning Applied and queued up for -stable.