From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA96BC43381 for ; Sun, 17 Feb 2019 03:45:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8BA4921A4A for ; Sun, 17 Feb 2019 03:45:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726219AbfBQDpy (ORCPT ); Sat, 16 Feb 2019 22:45:54 -0500 Received: from m9785.mail.qiye.163.com ([220.181.97.85]:29062 "EHLO m9785.mail.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725794AbfBQDpy (ORCPT ); Sat, 16 Feb 2019 22:45:54 -0500 Received: from [192.168.0.107] (unknown [101.88.52.251]) by m9785.mail.qiye.163.com (Hmail) with ESMTPA id D93795C16C1; Sun, 17 Feb 2019 11:45:38 +0800 (CST) Subject: Re: [PATCH net-next] ip_tunnel: Fix DST_METADATA dst_entry handle in tnl_update_pmtu From: wenxu To: Alexei Starovoitov Cc: "David S. Miller" , rong.a.chen@intel.com, Network Development , Stephen Rothwell , LKP References: <1550278683-17239-1-git-send-email-wenxu@ucloud.cn> <41cd7ba4-7e87-3a3e-ad77-6caf0b46cbd1@ucloud.cn> Message-ID: <3c34b930-446f-a7de-bf54-5ee19b5bbd93@ucloud.cn> Date: Sun, 17 Feb 2019 11:45:38 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <41cd7ba4-7e87-3a3e-ad77-6caf0b46cbd1@ucloud.cn> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-HM-Spam-Status: e1kIGBQJHllBS1VLV1koWUFJQjdXWS1ZQUlXWQkOFx4IWUFZMjUtOjcyP0 FLVUtZBg++ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6PjI6URw6VjkDIwpDQgIzLDlN Sx8wCj9VSlVKTk5LSExOSkhCTUtNVTMWGhIXVQweFQMOOw4YFxQOH1UYFUVZV1kSC1lBWUpLSlVD Q1VOSVVJTkpZV1kIAVlBSENPTzcG X-HM-Tid: 0a68f98f371b2087kuqyd93795c16c1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 2019/2/17 上午11:35, wenxu wrote: > On 2019/2/17 上午12:34, Alexei Starovoitov wrote: >> On Sat, Feb 16, 2019 at 2:11 AM wrote: >>> From: wenxu >>> >>> BUG report in selftests: bpf: test_tunnel.sh >>> >>> Testing IPIP tunnel... >>> BUG: unable to handle kernel NULL pointer dereference at 0000000000000000 >>> PGD 0 P4D 0 >>> Oops: 0010 [#1] SMP PTI >>> CPU: 0 PID: 16822 Comm: ping Not tainted 5.0.0-rc3-00352-gc8b34e6 #1 >>> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1 04/01/2014 >>> RIP: 0010: (null) >>> Code: Bad RIP value. >>> RSP: 0018:ffffc9000104f9c8 EFLAGS: 00010286 >>> RAX: 0000000000000000 RBX: ffffe8ffffc071a8 RCX: 0000000000000000 >>> RDX: ffff888054e33000 RSI: ffff88807796f500 RDI: ffffe8ffffc07130 >>> RBP: ffff88807796f500 R08: ffff88806da4f0a0 R09: 0000000000000000 >>> R10: 0000000000000004 R11: ffff888054e33000 R12: 0000000000000054 >>> R13: ffff88805e714000 R14: ffff88806da4f0a0 R15: 0000000000000000 >>> FS: 00007f4c00431500(0000) GS:ffff88813fc00000(0000) knlGS:0000000000000000 >>> CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 >>> CR2: ffffffffffffffd6 CR3: 000000008276e000 CR4: 00000000000406f0 >>> Call Trace: >>> ? tnl_update_pmtu+0x21b/0x250 [ip_tunnel] >>> ? ip_md_tunnel_xmit+0x1b7/0xdc0 [ip_tunnel] >>> ? ipip_tunnel_xmit+0x90/0xc0 [ipip] >>> ? dev_hard_start_xmit+0x98/0x210 >>> ? __dev_queue_xmit+0x6a9/0x8e0 >>> >>> The bpf program set tunnel_key through bpf_skb_set_tunnel_key which will >>> drop the old dst_entry and create a DST_METADATA dst_entry. It will lead >>> the tunnel_update_pmtu operator the dst_entry incorrect. So It should be >>> check the dst_entry is valid. >>> >>> Fixes: c8b34e680a09 ("ip_tunnel: Add tnl_update_pmtu in ip_md_tunnel_xmit") >>> Signed-off-by: wenxu >> different fix for this issue was sent earlier: >> https://patchwork.ozlabs.org/patch/1042687/ >> I think it's more complete than this one. >> > sorry for didn't saw the patch before. But I think the patch I provide more simpler and  also complete for fix this problem > > > sorry for skip this patch. Thx!