Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754951Ab1BGVmH (ORCPT ); Mon, 7 Feb 2011 16:42:07 -0500 Received: from 74-93-104-97-Washington.hfc.comcastbusiness.net ([74.93.104.97]:58748 "EHLO sunset.davemloft.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750931Ab1BGVmF (ORCPT ); Mon, 7 Feb 2011 16:42:05 -0500 Date: Mon, 07 Feb 2011 13:42:40 -0800 (PST) Message-Id: <20110207.134240.260080815.davem@davemloft.net> To: andrew.hendry@gmail.com Cc: apw@canonical.com, john@calva.com, linux-x25@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, tim.gardner@canonical.com Subject: Re: x25: possible skb leak on bad facilities From: David Miller In-Reply-To: <1297073295.9577.13.camel@jaunty> References: <20110206.202824.260090071.davem@davemloft.net> <1297073295.9577.13.camel@jaunty> X-Mailer: Mew version 6.3 on Emacs 23.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1219 Lines: 31 From: Andrew Hendry Date: Mon, 07 Feb 2011 21:08:15 +1100 > > Originally x25_parse_facilities returned > -1 for an error > 0 meaning 0 length facilities >>0 the length of the facilities parsed. > > 5ef41308f94dc introduced more error checking in x25_parse_facilities > however used 0 to indicate bad parsing > a6331d6f9a429 followed this further for DTE facilities, again using 0 for bad parsing. > > The meaning of 0 got confused in the callers. > If the facilities are messed up we can't determine where the data starts. > So patch makes all parsing errors return -1 and ensures callers close and don't use the skb further. > > Reported-by: Andy Whitcroft > Signed-off-by: Andrew Hendry Please reference the commit header line text when referring to SHA1 IDs, because when backporting to other GIT trees the SHA1 IDs might be different. I took care of this when applying your patch, thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/