Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936064AbYBWAjf (ORCPT ); Fri, 22 Feb 2008 19:39:35 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1761156AbYBWAe0 (ORCPT ); Fri, 22 Feb 2008 19:34:26 -0500 Received: from ns1.suse.de ([195.135.220.2]:44742 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751979AbYBWAeW (ORCPT ); Fri, 22 Feb 2008 19:34:22 -0500 Date: Fri, 22 Feb 2008 16:30:23 -0800 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Stephen Hemminger , "David S. Miller" Subject: [patch 13/38] PKT_SCHED: ematch: oops from uninitialized variable (resend) Message-ID: <20080223003023.GN7268@suse.de> References: <20080223001946.979768610@mini.kroah.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="pkt_sched-ematch-oops-from-uninitialized-variable.patch" In-Reply-To: <20080223002907.GA7268@suse.de> User-Agent: Mutt/1.5.16 (2007-06-09) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2677 Lines: 65 2.6.24-stable review patch. If anyone has any objections, please let us know. ------------------ Upstream commit: 268bcca1e7b0d244afd07ea89cda672e61b0fc4a Setting up a meta match causes a kernel OOPS because of uninitialized elements in tree. [ 37.322381] BUG: unable to handle kernel NULL pointer dereference at 0000000000000000 [ 37.322381] IP: [] :em_meta:em_meta_destroy+0x17/0x80 [ 37.322381] Call Trace: [ 37.322381] [] tcf_em_tree_destroy+0x2d/0xa0 [ 37.322381] [] tcf_em_tree_validate+0x2dc/0x4a0 [ 37.322381] [] nla_parse+0x92/0xe0 [ 37.322381] [] :cls_basic:basic_change+0x202/0x3c0 [ 37.322381] [] kmem_cache_alloc+0x67/0xa0 [ 37.322381] [] tc_ctl_tfilter+0x3b1/0x580 [ 37.322381] [] rtnetlink_rcv_msg+0x0/0x260 [ 37.322381] [] netlink_rcv_skb+0x74/0xa0 [ 37.322381] [] rtnetlink_rcv+0x18/0x20 [ 37.322381] [] netlink_unicast+0x263/0x290 [ 37.322381] [] __alloc_skb+0x96/0x160 [ 37.322381] [] netlink_sendmsg+0x274/0x340 [ 37.322381] [] sock_sendmsg+0x12b/0x140 [ 37.322381] [] autoremove_wake_function+0x0/0x30 [ 37.322381] [] autoremove_wake_function+0x0/0x30 [ 37.322381] [] sock_sendmsg+0x12b/0x140 [ 37.322381] [] zone_statistics+0xb1/0xc0 [ 37.322381] [] sys_sendmsg+0x20e/0x360 [ 37.322381] [] sockfd_lookup_light+0x41/0x80 [ 37.322381] [] handle_mm_fault+0x3eb/0x7f0 [ 37.322381] [] system_call_after_swapgs+0x7b/0x80 Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/sched/ematch.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) --- a/net/sched/ematch.c +++ b/net/sched/ematch.c @@ -305,10 +305,9 @@ int tcf_em_tree_validate(struct tcf_prot struct tcf_ematch_tree_hdr *tree_hdr; struct tcf_ematch *em; - if (!rta) { - memset(tree, 0, sizeof(*tree)); + memset(tree, 0, sizeof(*tree)); + if (!rta) return 0; - } if (rtattr_parse_nested(tb, TCA_EMATCH_TREE_MAX, rta) < 0) goto errout; -- -- 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/