Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761881AbZJIXnO (ORCPT ); Fri, 9 Oct 2009 19:43:14 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1761653AbZJIXnN (ORCPT ); Fri, 9 Oct 2009 19:43:13 -0400 Received: from kroah.org ([198.145.64.141]:51492 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761701AbZJIXmw (ORCPT ); Fri, 9 Oct 2009 19:42:52 -0400 X-Mailbox-Line: From gregkh@mini.kroah.org Fri Oct 9 16:34:40 2009 Message-Id: <20091009233440.560038564@mini.kroah.org> User-Agent: quilt/0.48-1 Date: Fri, 09 Oct 2009 16:34:46 -0700 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: stable-review@kernel.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Jarek Poplawski , "David S. Miller" Subject: [patch 35/37] ax25: Fix possible oops in ax25_make_new References: <20091009233411.852013234@mini.kroah.org> Content-Disposition: inline; filename=ax25-fix-possible-oops-in-ax25_make_new.patch In-Reply-To: <20091009233812.GA15982@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1411 Lines: 36 2.6.31-stable review patch. If anyone has any objections, please let us know. ------------------ From: Jarek Poplawski [ Upstream commit 8c185ab6185bf5e67766edb000ce428269364c86 ] In ax25_make_new, if kmemdup of digipeat returns an error, there would be an oops in sk_free while calling sk_destruct, because sk_protinfo is NULL at the moment; move sk->sk_destruct initialization after this. BTW of reported-by: Bernard Pidoux F6BVP Signed-off-by: Jarek Poplawski Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ax25/af_ax25.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/ax25/af_ax25.c +++ b/net/ax25/af_ax25.c @@ -893,7 +893,6 @@ struct sock *ax25_make_new(struct sock * sock_init_data(NULL, sk); - sk->sk_destruct = ax25_free_sock; sk->sk_type = osk->sk_type; sk->sk_priority = osk->sk_priority; sk->sk_protocol = osk->sk_protocol; @@ -931,6 +930,7 @@ struct sock *ax25_make_new(struct sock * } sk->sk_protinfo = ax25; + sk->sk_destruct = ax25_free_sock; ax25->sk = sk; return sk; -- 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/