From: <gregkh@linuxfoundation.org>
To: glennrubenbakke@nordicsemi.no, glenn.ruben.bakke@nordicsemi.no,
gregkh@linuxfoundation.org, jukka.rissanen@linux.intel.com,
marcel@holtmann.org
Cc: <stable@vger.kernel.org>, <stable-commits@vger.kernel.org>
Subject: Patch "Bluetooth: 6lowpan: Fix memory corruption of ipv6 destination address" has been added to the 4.6-stable tree
Date: Sat, 04 Jun 2016 14:36:22 -0700 [thread overview]
Message-ID: <1465076182133108@kroah.com> (raw)
This is a note to let you know that I've just added the patch titled
Bluetooth: 6lowpan: Fix memory corruption of ipv6 destination address
to the 4.6-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
bluetooth-6lowpan-fix-memory-corruption-of-ipv6-destination-address.patch
and it can be found in the queue-4.6 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 55441070ca1cbd47ce1ad2959bbf4b47aed9b83b Mon Sep 17 00:00:00 2001
From: Glenn Ruben Bakke <glennrubenbakke@nordicsemi.no>
Date: Fri, 22 Apr 2016 18:06:11 +0200
Subject: Bluetooth: 6lowpan: Fix memory corruption of ipv6 destination address
From: Glenn Ruben Bakke <glennrubenbakke@nordicsemi.no>
commit 55441070ca1cbd47ce1ad2959bbf4b47aed9b83b upstream.
The memcpy of ipv6 header destination address to the skb control block
(sbk->cb) in header_create() results in currupted memory when bt_xmit()
is issued. The skb->cb is "released" in the return of header_create()
making room for lower layer to minipulate the skb->cb.
The value retrieved in bt_xmit is not persistent across header creation
and sending, and the lower layer will overwrite portions of skb->cb,
making the copied destination address wrong.
The memory corruption will lead to non-working multicast as the first 4
bytes of the copied destination address is replaced by a value that
resolves into a non-multicast prefix.
This fix removes the dependency on the skb control block between header
creation and send, by moving the destination address memcpy to the send
function path (setup_create, which is called from bt_xmit).
Signed-off-by: Glenn Ruben Bakke <glenn.ruben.bakke@nordicsemi.no>
Acked-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/bluetooth/6lowpan.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
--- a/net/bluetooth/6lowpan.c
+++ b/net/bluetooth/6lowpan.c
@@ -431,15 +431,18 @@ static int setup_header(struct sk_buff *
bdaddr_t *peer_addr, u8 *peer_addr_type)
{
struct in6_addr ipv6_daddr;
+ struct ipv6hdr *hdr;
struct lowpan_dev *dev;
struct lowpan_peer *peer;
bdaddr_t addr, *any = BDADDR_ANY;
u8 *daddr = any->b;
int err, status = 0;
+ hdr = ipv6_hdr(skb);
+
dev = lowpan_dev(netdev);
- memcpy(&ipv6_daddr, &lowpan_cb(skb)->addr, sizeof(ipv6_daddr));
+ memcpy(&ipv6_daddr, &hdr->daddr, sizeof(ipv6_daddr));
if (ipv6_addr_is_multicast(&ipv6_daddr)) {
lowpan_cb(skb)->chan = NULL;
@@ -489,15 +492,9 @@ static int header_create(struct sk_buff
unsigned short type, const void *_daddr,
const void *_saddr, unsigned int len)
{
- struct ipv6hdr *hdr;
-
if (type != ETH_P_IPV6)
return -EINVAL;
- hdr = ipv6_hdr(skb);
-
- memcpy(&lowpan_cb(skb)->addr, &hdr->daddr, sizeof(struct in6_addr));
-
return 0;
}
Patches currently in stable-queue which might be from glennrubenbakke@nordicsemi.no are
queue-4.6/bluetooth-6lowpan-fix-memory-corruption-of-ipv6-destination-address.patch
reply other threads:[~2016-06-04 21:36 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1465076182133108@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=glenn.ruben.bakke@nordicsemi.no \
--cc=glennrubenbakke@nordicsemi.no \
--cc=jukka.rissanen@linux.intel.com \
--cc=marcel@holtmann.org \
--cc=stable-commits@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.