From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3BAEC433E4 for ; Fri, 10 Jul 2020 17:08:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C8B5420657 for ; Fri, 10 Jul 2020 17:08:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727950AbgGJRIx convert rfc822-to-8bit (ORCPT ); Fri, 10 Jul 2020 13:08:53 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:42254 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726496AbgGJRIx (ORCPT ); Fri, 10 Jul 2020 13:08:53 -0400 Received: from marcel-macbook.fritz.box (p5b3d2638.dip0.t-ipconnect.de [91.61.38.56]) by mail.holtmann.org (Postfix) with ESMTPSA id B137CCED26; Fri, 10 Jul 2020 19:18:48 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: [Linux-kernel-mentees] [PATCH v3] net/bluetooth: Fix slab-out-of-bounds read in hci_extended_inquiry_result_evt() From: Marcel Holtmann In-Reply-To: <20200710160915.228980-1-yepeilin.cs@gmail.com> Date: Fri, 10 Jul 2020 19:08:51 +0200 Cc: Johan Hedberg , "David S. Miller" , Jakub Kicinski , Russell King , Greg Kroah-Hartman , Bluetooth Kernel Mailing List , "open list:NETWORKING [GENERAL]" , syzkaller-bugs@googlegroups.com, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: <43E6945B-1FFE-4283-9F1B-E84AFDCB528F@holtmann.org> References: <20200709130224.214204-1-yepeilin.cs@gmail.com> <20200710160915.228980-1-yepeilin.cs@gmail.com> To: Peilin Ye X-Mailer: Apple Mail (2.3608.80.23.2.2) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi Peilin, > Check upon `num_rsp` is insufficient. A malformed event packet with a > large `num_rsp` number makes hci_extended_inquiry_result_evt() go out > of bounds. Fix it. > > This patch fixes the following syzbot bug: > > https://syzkaller.appspot.com/bug?id=4bf11aa05c4ca51ce0df86e500fce486552dc8d2 > > Reported-by: syzbot+d8489a79b781849b9c46@syzkaller.appspotmail.com > Cc: stable@vger.kernel.org > Signed-off-by: Peilin Ye > --- > Change in v3: > - Minimum `skb->len` requirement was 1 byte inaccurate since `info` > starts from `skb->data + 1`. Fix it. > > Changes in v2: > - Use `skb->len` instead of `skb->truesize` as the length limit. > - Leave `num_rsp` as of type `int`. > > net/bluetooth/hci_event.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) patch has been applied to bluetooth-next tree. Regards Marcel