Received: by 10.192.165.148 with SMTP id m20csp341299imm; Fri, 20 Apr 2018 07:39:08 -0700 (PDT) X-Google-Smtp-Source: AIpwx48K9S++KmQFD5pW+IqZw/Hf8/9YfSrTEuCK1XQPfiG8JU2pLRXMORcrLEtP386cXIYfMEVk X-Received: by 2002:a17:902:be08:: with SMTP id r8-v6mr10315179pls.289.1524235148075; Fri, 20 Apr 2018 07:39:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524235148; cv=none; d=google.com; s=arc-20160816; b=kBp39oDZL17T100lkB2GPr7zt7/6vCrrYwvqJGUWQAsyT/VFJBK88FUE3sc7w4oLf4 NdvqrHGMMAPrQpR98fvg2wsfwJI+mM/LblUUQKX2SrQ7dfM3ZhZeC9wz0Gfua/MA1NFA WHQcIhQNtDboVTQmh9ZS6HtDPavKcrJHtSGwfGof5jx3xBsyn0TcN2bmA4TqtYfgM/Qb YFpxxNYKtY4NJcHkqz1Oub6JJeyvnOs4bYNer7QwT10JfBFy3kQRLdY3etdxX2T+vFRC esnmAaiii/+vlPTvYnrcLk/0u8qPM2UwYgep0XLHBJmUCVSdv0u1YGmn7PBtA0R7elEC WyyA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature :arc-authentication-results; bh=4HtwrVISkoTY8XdZgEU17fyrbOr2DUs8NCI//GBLtnU=; b=t941tpQQ/nodsUwlzcFc1dmMjfV9yqOYvDI4YGF/hkOGw2KSQAGT6YVl/RRaI0gbTe tS6S33FZz9D5khcbkyqz/x9SF5myIpH9d6wC3viYCul6FDILaVCDqY0ObpvwfoH95N1X dKwQWSVU8lomlX34WWJrjNZrV2sYFb6GROeAePCzjEI+I4BBQj77N9kUM7taZui9c3oE fRlb40Sn5wVK6adp4H0PDvvB5XualahbmjOMQMW/PKvugCjGqWt+UG3tSDqgZ4JVX6VS 2e1ToQKIB+00+znJR/0YnmYvQGPATafVTeBLaba4y9OJp1UetlX+EyrS3JXps961OTDk Yscg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=MJvcsKn1; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5si5286366pfh.27.2018.04.20.07.38.54; Fri, 20 Apr 2018 07:39:08 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=MJvcsKn1; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755405AbeDTOhv (ORCPT + 99 others); Fri, 20 Apr 2018 10:37:51 -0400 Received: from mail-wr0-f174.google.com ([209.85.128.174]:42671 "EHLO mail-wr0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755339AbeDTOhp (ORCPT ); Fri, 20 Apr 2018 10:37:45 -0400 Received: by mail-wr0-f174.google.com with SMTP id s18-v6so23617307wrg.9; Fri, 20 Apr 2018 07:37:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=4HtwrVISkoTY8XdZgEU17fyrbOr2DUs8NCI//GBLtnU=; b=MJvcsKn10YT1VzIAVBtWveQ2JA1+uWwsH3AlLoJ5RjRTZw6G+9RNpH6qa0jQOkNlk6 Om0uUUCyxNnTm1uKqSXKAJlxdllVB3XmGL8/95O3Ck/ZCIg4AxVrfrmgFJVs/O9SY19i QVKL4RcRi2LaltF9GwmKBaMHAl6dQpCoXITlf0ybCQEW1JQlo7ajiQP5f+ClcwEM8yxA fIZ+34dVZgkSTvwiclZvaCRGKOrQbMEKOZNICYeqlUk4qosigZJ+iXrxGCMzL+0fDfKp KxUecHA0/keIpba37Zv3FpmEHiztJOJBwSORpe8DrEN00MRygrZreqitvomKyvi+mek3 GQWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=4HtwrVISkoTY8XdZgEU17fyrbOr2DUs8NCI//GBLtnU=; b=mOUJ3baE1BeVWejktMvr+JBQ3W1fu3aIxZm4POLkTV+W6OCwgeqt1xRmRrSA3XPTqJ au8fN7m2fcsXI2evNExU0cPd8DBpXDlLk3cv+dQeOJz2glEEMK81YFxV+dSWkwnFanoj Xl9pIwGaGilUlv0CAISfUSw9MaxQpE5Jr0JTB7ju1pUzWzBZrLImj0GpHMstxcN2Qitk zWADnywDJVfbBA4oCkQH5Ba/IqyUbUTaONj7PySRoSCClEOTdkOs3mO8714GabkRCuZ/ GjCs699AR9RQyqcm8VCd7lC35Sy9tuWTA0B6rNOmHXZ7ptnh98IjjVLPLDqvY0UPAsQ0 /lBQ== X-Gm-Message-State: ALQs6tBfDoe3f6xKlxpPDky6fcdQGhT25CN9tv2+mvfNwuoUBDcCy7WJ hBcvauAtkNmIGqgVMlEsdis003aL190= X-Received: by 10.80.128.5 with SMTP id 5mr14371099eda.130.1524235064152; Fri, 20 Apr 2018 07:37:44 -0700 (PDT) Received: from ?IPv6:2001:6a8:3081:6f11:294f:dfb7:ba0a:19b7? ([2001:6a8:3081:6f11:294f:dfb7:ba0a:19b7]) by smtp.gmail.com with ESMTPSA id i17sm3779806ede.13.2018.04.20.07.37.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Apr 2018 07:37:43 -0700 (PDT) Subject: Re: [PATCH] [net] ipv6: sr: fix NULL pointer dereference in seg6_do_srh_encap()- v4 pkts To: Ahmed Abdelsalam , davem@davemloft.net, dlebrun@google.com, kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <1524232685-1203-1-git-send-email-amsalam20@gmail.com> From: David Lebrun Message-ID: <3627f25a-0c47-6428-aa76-5baf96993a4c@gmail.com> Date: Fri, 20 Apr 2018 15:38:08 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1524232685-1203-1-git-send-email-amsalam20@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/20/2018 02:58 PM, Ahmed Abdelsalam wrote: > In case of seg6 in encap mode, seg6_do_srh_encap() calls set_tun_src() > in order to set the src addr of outer IPv6 header. > > The net_device is required for set_tun_src(). However calling ip6_dst_idev() > on dst_entry in case of IPv4 traffic results on the following bug. > > Using just dst->dev should fix this BUG. > Good catch, thanks for spotting this. If you actually tested your fix with IPv4 and IPv6 traffic, you should mention it in the commit message. Your current formulation suggests that you just guessed a fix without testing. > > Fixes: 8936ef7604c11 ipv6: sr: fix NULL pointer dereference when setting encap source address > Signed-off-by: Ahmed Abdelsalam Acked-by: David Lebrun