Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp5346199pxu; Wed, 21 Oct 2020 22:48:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUHSbdn57wuvVPXbdeF9gXdUbnlWJfIw5QV3IopKCB/sfiRM9VGNZaz1bO1UpRWpuf5+BB X-Received: by 2002:a17:906:3a1a:: with SMTP id z26mr691665eje.519.1603345701567; Wed, 21 Oct 2020 22:48:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603345701; cv=none; d=google.com; s=arc-20160816; b=bPPkdSfR/Brr9DOC3lJmgjekpIjp2rTtBa6Wz6G2hrBuCMujy/Nl2jCERLowIU2EJu 5dlPD/MD3YgHTHbMB1l8QtYX8vI2XmP7rsbAb8VMeIivFK4HR1UnDpx2vYUfdNtxyXdA ywRYoUhdwdZ1dt3vw2s2MgZ94vpC4qBYnl276jhSMubNYpEsDJ++/jdUIu1EJt87FbiC xr5loI0CAbgvlzCXt1mZ0DZZ03cjdHSObWN4d+fbMFXYsmLgmiY7k2/qu0EfgAl+SH9D PonWAmfEZzSsMe33P2lRsojx3BItH5+HUH0QB2RTedWPIuxqEVXGIIjLD8d4DnkTxQqg ZlFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=H/10uoXxZ1TPKQwUATI34Kv0Q0gHHOW25jc+JJMZOc0=; b=onh86Un8nokIdnfwW3P35iz0fpPPcsGQXXtBirmZJPEC63aOKAIBayM7JDHWvuDVx8 Tx5Tu61VDrvdHx8u1+9U+5zOPbnYaj+mfl5EyWg+h6GvZGkTADshSrQLJuK9/VVboyXz HkGoYTs+sCxJNgwJ9aV8DPRCISBh9fs8lq8S0CriOHtXu2afo89pIEv/05OUXS26+Nfd 5a/piwqg7J++Ono5ATyr1Kshb70/Svh3Cz7LB5pG0j58gGkrrcfxUFQr9i59yP8tBvuQ 3WBSgz0SXZJHIFDV23SNbqtS811CL89ap7RB4dDs0RfxNOkqDR1QUqSVP4Q2YBT+x2GW trvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="bwdgF/QC"; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i27si370387edb.55.2020.10.21.22.47.41; Wed, 21 Oct 2020 22:48:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="bwdgF/QC"; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438267AbgJUQfG (ORCPT + 99 others); Wed, 21 Oct 2020 12:35:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2438247AbgJUQfG (ORCPT ); Wed, 21 Oct 2020 12:35:06 -0400 Received: from mail-oi1-x241.google.com (mail-oi1-x241.google.com [IPv6:2607:f8b0:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C24EC0613CE for ; Wed, 21 Oct 2020 09:35:06 -0700 (PDT) Received: by mail-oi1-x241.google.com with SMTP id n3so2756172oie.1 for ; Wed, 21 Oct 2020 09:35:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=H/10uoXxZ1TPKQwUATI34Kv0Q0gHHOW25jc+JJMZOc0=; b=bwdgF/QCmbrNYBmt2SDNW32cc5r7Ds02ZWnpiMNntCWeQDrCLEEeU8CItmR8DooP4G Yl0HOpRMp97FZgJj3KtuaONIWlCjbGiqWRePIhLkeCX4XpXJIovLUh2U66MMT+3zSPom gcF7BTj6yXqO2lHoujWBAJF4Ral0Mgbj7vPAk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=H/10uoXxZ1TPKQwUATI34Kv0Q0gHHOW25jc+JJMZOc0=; b=NQSa/bQr83db3KuSTsQRdEyftPYcAN7Q5UlhgdPLJSGPqA6xpPqmyRpBhqT26k7Nhe XoQwdWet79F+OUohepLuBfRyVT3rbPUufhEoOoKW96BLSWff3VnhbIO6gTKKBv12gWKS qs9xtH1lXlAIVeB1nkmqVUCCF6E5KicmikH29MGoWVzn3d3jK8X/qyMuhoJlThOHA32Z En1ajtcRAFzEKApQdQfmnHdfpTCYGNVOQnA3BVXhJbhcCZC7KOyga1kOeYuLoJfTq8cm InMgXmxpEt6AkkQEkyxCZj/Rqht3zrVPr4Xz4fcevjg6upCWHqBe21Q6ZCE3jFXVUzlH hBng== X-Gm-Message-State: AOAM533HLMo91ecWY7rPQqP0IoRL8nrQgNijfva9gjIorfaJAqP1y4mC DJDXH76Wy7XfEjYBt4z9eA/DiLHwQ9XcbiNZynhmnA== X-Received: by 2002:aca:ab8b:: with SMTP id u133mr2708150oie.132.1603298105597; Wed, 21 Oct 2020 09:35:05 -0700 (PDT) MIME-Version: 1.0 References: <20201019172529.1179996-1-luiz.dentz@gmail.com> In-Reply-To: <20201019172529.1179996-1-luiz.dentz@gmail.com> From: Abhishek Pandit-Subedi Date: Wed, 21 Oct 2020 09:34:53 -0700 Message-ID: Subject: Re: [PATCH v2 1/2] Bluetooth: Fix not checking advertisement bondaries To: Luiz Augusto von Dentz Cc: Bluez mailing list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org On Mon, Oct 19, 2020 at 10:25 AM Luiz Augusto von Dentz wrote: > > From: Luiz Augusto von Dentz > > When receiving advertisements check if the length is actually within > the skb, this also make use of skb_pull to advance on the skb->data > instead of a custom ptr that way skb->len shall always indicates how > much data is remaining and can be used to perform checks if there is > enough data to parse. > > Fixes: a2ec905d1e160a33b2e210e45ad30445ef26ce0e ("Bluetooth: fix kernel oops in store_pending_adv_report") > Signed-off-by: Luiz Augusto von Dentz > --- > v2: Fixes rssi parsing. > > net/bluetooth/hci_event.c | 73 ++++++++++++++++++++++++++++++--------- > 1 file changed, 56 insertions(+), 17 deletions(-) Tested-by: Abhishek Pandit-Subedi --- I cherry-picked this to our 4.19 kernel and ran our LE Health tests on the Kohaku chromebook (AX201 controller). All tests are passing.