From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933093Ab2HGXNG (ORCPT ); Tue, 7 Aug 2012 19:13:06 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:56573 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932993Ab2HGWiH (ORCPT ); Tue, 7 Aug 2012 18:38:07 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg KH , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Antonio Quartulli , Sven Eckelmann Subject: [ 029/109] batman-adv: fix skb->data assignment Date: Tue, 7 Aug 2012 15:34:48 -0700 Message-Id: <20120807222045.656376771@linuxfoundation.org> X-Mailer: git-send-email 1.7.10.1.362.g242cab3 In-Reply-To: <20120807222043.089735600@linuxfoundation.org> References: <20120807222043.089735600@linuxfoundation.org> User-Agent: quilt/0.60-20.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg KH 3.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Antonio Quartulli commit d2b6cc8e460494251442a877fcbc150faa175b4f upstream. skb_linearize(skb) possibly rearranges the skb internal data and then changes the skb->data pointer value. For this reason any other pointer in the code that was assigned skb->data before invoking skb_linearise(skb) must be re-assigned. In the current tt_query message handling code this is not done and therefore, in case of skb linearization, the pointer used to handle the packet header ends up in pointing to poisoned memory. The packet is then dropped but the translation-table mechanism is corrupted. Signed-off-by: Antonio Quartulli Signed-off-by: Sven Eckelmann Signed-off-by: Greg Kroah-Hartman --- net/batman-adv/routing.c | 2 ++ 1 file changed, 2 insertions(+) --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c @@ -627,6 +627,8 @@ int recv_tt_query(struct sk_buff *skb, s if (unlikely(skb_headlen(skb) < sizeof(struct tt_query_packet) + tt_len)) goto out; + /* skb_linearize() possibly changed skb->data */ + tt_query = (struct tt_query_packet *)skb->data; handle_tt_response(bat_priv, tt_query); } else {