Received: by 10.192.165.148 with SMTP id m20csp350286imm; Fri, 20 Apr 2018 07:48:01 -0700 (PDT) X-Google-Smtp-Source: AIpwx486ABUTDKIqRC0XzPmx7QBFkUYiNPilLwdyMp0EFWaAjQXIZ7AHLCj+zKMcIoUwWusb/xvv X-Received: by 10.101.69.66 with SMTP id x2mr8126882pgr.24.1524235681900; Fri, 20 Apr 2018 07:48:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524235681; cv=none; d=google.com; s=arc-20160816; b=hBsktJ+NdnvyrM5O6cwS4gPLQA+tDNdSLAEONvRgkmwy9xHDRORlqh+7vOa16XtqTS 5MQxfisXz3s6UBCckyyjgUOQEje7rI8G4O9qrSDe/CQf4c3THllmrtXitIeF6Xay55ZD rGTEXTXBPd36KsN3FIJ5//aLpCpHB7wy4SqyTXhqANaOdqYKCHBDpbSJu/Z25t3Rx4Wv nnCM4gVZWW6VTRAtwCdytmSN7NSqk5RC4/s1c5BYq8Xly8n+xUU+CZDJidhZXP2TIQkf LNNvDUWOQf7tzOp+yYQcSOqogzvhozPSF5U9tKnWa7Y2hjQCDp+wjzTt0jMISYBPv9+o e0hQ== 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:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=4+WEc3M8/5ljuCA39qNVMRUuVZzlbveoffuwg8HvnaI=; b=cwYjb3u+MhFlR3q7cI4IjK4q9M2nURiI6nAa0lbeBll0Wu4aWxNSsYPl14K598ff9R kPXwfGBBw37jYTHURdIc6qSpJxs3E59UjCJBswX6Zt3IGotucnQaCtviFAfUH5h7Eb9s zHXuwlB5qDE/nFY5IZoq7f6wgyx+xbjTRChQB3Q+XBgMs6yiuuo03vV0P8MrmFptXK8j If/xTLoUpgW77zXlV4jQwVcksGqIgAXtYXJaLUJAjXITh6ZR6z4tTzeO1Mebq0VzBcEE D7yoZt6+5xAyuF41scx1oOasBKL39pN3KyChnCvrC+nqKZGdogc+MIsYxVrlbWqnT0SM ZBEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=C/7kPrMx; 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=pass (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 g14si4872375pgv.625.2018.04.20.07.47.47; Fri, 20 Apr 2018 07:48:01 -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=pass header.i=@gmail.com header.s=20161025 header.b=C/7kPrMx; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755419AbeDTOqc (ORCPT + 99 others); Fri, 20 Apr 2018 10:46:32 -0400 Received: from mail-wr0-f182.google.com ([209.85.128.182]:41554 "EHLO mail-wr0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755171AbeDTOq3 (ORCPT ); Fri, 20 Apr 2018 10:46:29 -0400 Received: by mail-wr0-f182.google.com with SMTP id v24-v6so23662198wra.8; Fri, 20 Apr 2018 07:46:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4+WEc3M8/5ljuCA39qNVMRUuVZzlbveoffuwg8HvnaI=; b=C/7kPrMx97EBpw5QpGJQNOzbbG/+6NMc8MR2NcgAkDQW3zfD4v2GmFEGlxt9WKkS7Y x69vDacO3stt3qiHwqaZBupfLPqkDj2Jnp1vFyMMMCEeqYwr9IsWVvHeLM4JGspz3Dso h6FIl+BJN3bvNIEk21F9SJEjEqlQE0VQV5NDWnb++TEJ5A0//k2fHrAvnwet8jhhxTzu DWxEcjb0w6AwrqpLGqknqalBX6X08JeWkl20mnvoOSKteDcjZSkFF8hlqQvl9TwvOrOP XDXhxIwF8ZnQ/LTkGXgZVEVK021Y5zZ5k7darO6Ig1DfA/llAUOX4eJ8UM4kdSz3wvYw itzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4+WEc3M8/5ljuCA39qNVMRUuVZzlbveoffuwg8HvnaI=; b=jjCs7oljvd8mnvT4nkyuqUaIcnkeQYxG1KKr1n16BX5ZBCEGwWLLegqDU8Jzwjbw5d 7WtvGSYLLbzfTm7qSzeg+2GlhlWroZHb5owMU5GjiP9KwfYSI+X53N9cNpYDGbRq2iOC qhsYBPXsRcbwsW+qsqPOVwU+aDLpqI4/1wIYUK+Ed+M+MW2LDZOtCRTEyfcxAU3dpe4y cxlJbK2k2BuWW//EHq8HypPI5kJgNdaUAE2ha/ITn2C6nzitC1fYDk/bmekmm/FpgR+N RRnTvxgPEktjjYry0u+nijECzWX0XLyxtJl3s3s2V+Vc7lBWBuG/jt5JyKHKpMt6+/ks 5hFw== X-Gm-Message-State: ALQs6tDoXxU6v5BdmMiz5IX1NqZLajk4xH3lPnQQMYGfnDQecQQOLUdm E5U229sJ//S/9rlHhbxSEHo= X-Received: by 2002:adf:e550:: with SMTP id z16-v6mr5188101wrm.194.1524235588115; Fri, 20 Apr 2018 07:46:28 -0700 (PDT) Received: from AHABDELS-M-M2VD ([192.135.27.141]) by smtp.gmail.com with ESMTPSA id v134sm1912296wmv.32.2018.04.20.07.46.26 (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 20 Apr 2018 07:46:26 -0700 (PDT) Date: Fri, 20 Apr 2018 16:46:25 +0200 From: Ahmed Abdelsalam To: David Lebrun Cc: davem@davemloft.net, dlebrun@google.com, kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] [net] ipv6: sr: fix NULL pointer dereference in seg6_do_srh_encap()- v4 pkts Message-Id: <20180420164625.b2d91c9f9738492eeaa8e3e7@gmail.com> In-Reply-To: <3627f25a-0c47-6428-aa76-5baf96993a4c@gmail.com> References: <1524232685-1203-1-git-send-email-amsalam20@gmail.com> <3627f25a-0c47-6428-aa76-5baf96993a4c@gmail.com> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.21; x86_64-apple-darwin10.8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 20 Apr 2018 15:38:08 +0100 David Lebrun wrote: > 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. > Yes, I did two tests for both IPv4 and IPv6. Sorry for this Language Bug. > > > > Fixes: 8936ef7604c11 ipv6: sr: fix NULL pointer dereference when setting encap source address > > Signed-off-by: Ahmed Abdelsalam > > Acked-by: David Lebrun -- Ahmed Abdelsalam