From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757688AbcIVTsu (ORCPT ); Thu, 22 Sep 2016 15:48:50 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:37713 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757450AbcIVTss (ORCPT ); Thu, 22 Sep 2016 15:48:48 -0400 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.0 \(3226\)) Subject: Re: [PATCH] Bluetooth: btwilink: Save the packet type before sending From: Marcel Holtmann In-Reply-To: <1474568442-4810-1-git-send-email-labbott@redhat.com> Date: Thu, 22 Sep 2016 21:48:43 +0200 Cc: "Gustavo F. Padovan" , Johan Hedberg , "open list:BLUETOOTH DRIVERS" , LKML , John Stultz Content-Transfer-Encoding: 7bit Message-Id: References: <1474568442-4810-1-git-send-email-labbott@redhat.com> To: Laura Abbott X-Mailer: Apple Mail (2.3226) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Laura, > Running with KASAN produces some messages: > > BUG: KASAN: use-after-free in ti_st_send_frame+0x9c/0x16c at addr > ffffffc064868fe8 > Read of size 1 by task kworker/u17:1/1266 > > > > Hardware name: HiKey Development Board (DT) > Workqueue: hci0 hci_cmd_work > Call trace: > [] dump_backtrace+0x0/0x178 > [] show_stack+0x20/0x28 > [] dump_stack+0xa8/0xe0 > [] print_trailer+0x110/0x174 > [] object_err+0x4c/0x5c > [] kasan_report_error+0x254/0x54c > [] kasan_report+0x64/0x70 > [] __asan_load1+0x4c/0x54 > [] ti_st_send_frame+0x9c/0x16c > [] hci_send_frame+0xb4/0x118 > [] hci_cmd_work+0xcc/0x154 > [] process_one_work+0x26c/0x7a4 > [] worker_thread+0x9c/0x73c > [] kthread+0x138/0x154 > [] ret_from_fork+0x10/0x40 > > The packet is being accessed for statistics after it has been freed. > Save the packet type before sending for statistics afterwards. > > Signed-off-by: Laura Abbott > --- > Originally found and tested on 4.4 based branch. > --- > drivers/bluetooth/btwilink.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) patch has been applied to bluetooth-next tree. Regards Marcel