From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751584AbdAPN1R (ORCPT ); Mon, 16 Jan 2017 08:27:17 -0500 Received: from a.mx.secunet.com ([62.96.220.36]:38680 "EHLO a.mx.secunet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751672AbdAPN1M (ORCPT ); Mon, 16 Jan 2017 08:27:12 -0500 Date: Mon, 16 Jan 2017 14:27:04 +0100 From: Steffen Klassert To: Colin King CC: Herbert Xu , "David S . Miller" , , Subject: Re: [PATCH] xfrm: state: fix potential null pointer dereference on afinfo Message-ID: <20170116132704.GQ3541@gauss.secunet.com> References: <20170113140703.20961-1-colin.king@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20170113140703.20961-1-colin.king@canonical.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [10.182.7.102] X-G-Data-MailSecurity-for-Exchange-State: 0 X-G-Data-MailSecurity-for-Exchange-Error: 0 X-G-Data-MailSecurity-for-Exchange-Sender: 23 X-G-Data-MailSecurity-for-Exchange-Server: d65e63f7-5c15-413f-8f63-c0d707471c93 X-EXCLAIMER-MD-CONFIG: 2c86f778-e09b-4440-8b15-867914633a10 X-G-Data-MailSecurity-for-Exchange-Guid: 495222B5-D2DD-477E-B9A9-5315442927D9 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 13, 2017 at 02:07:03PM +0000, Colin King wrote: > From: Colin Ian King > > afinfo is being null checked before a call afinfo->init_tempsel > so afinfo may be potentially null. ifinfo may still be null in > the case were it is not updated when family == tmpl->encap_family, > hence we may hit a null pointer dereference in the call to > afinfo->init_temprop. > > Fix this by adding a null ptr check before calling init_temprop. > > Signed-off-by: Colin Ian King I've applied already a fix for this from Florian Westphal. Thanks a lot anyway!