From: Steffen Klassert Subject: Re: [PATCH ipsec-next] xfrm: policy: fix netlink/pf_key policy lookups Date: Tue, 20 Nov 2018 08:36:50 +0100 Message-ID: <20181120073650.GD3581@gauss3.secunet.de> References: <20181115015157.10314-1-fw@strlen.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Cc: , To: Florian Westphal Return-path: Received: from a.mx.secunet.com ([62.96.220.36]:48770 "EHLO a.mx.secunet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726840AbeKTSEe (ORCPT ); Tue, 20 Nov 2018 13:04:34 -0500 Content-Disposition: inline In-Reply-To: <20181115015157.10314-1-fw@strlen.de> Sender: netdev-owner@vger.kernel.org List-ID: On Thu, Nov 15, 2018 at 02:51:57AM +0100, Florian Westphal wrote: > Colin Ian King says: > Static analysis with CoverityScan found a potential issue [..] > It seems that pointer pol is set to NULL and then a check to see if it > is non-null is used to set pol to tmp; howeverm this check is always > going to be false because pol is always NULL. > > Fix this and update test script to catch this. Updated script only: > ./xfrm_policy.sh ; echo $? > RTNETLINK answers: No such file or directory > FAIL: ip -net ns3 xfrm policy get src 10.0.1.0/24 dst 10.0.2.0/24 dir out > RTNETLINK answers: No such file or directory > [..] > PASS: policy before exception matches > PASS: ping to .254 bypassed ipsec tunnel > PASS: direct policy matches > PASS: policy matches > 1 > > Fixes: 6be3b0db6db ("xfrm: policy: add inexact policy search tree infrastructure") > Reported-by: Colin Ian King > Signed-off-by: Florian Westphal Applied, thanks everyone!