Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1368647pxb; Wed, 2 Feb 2022 03:28:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJwtjg/XAryXdEJi433Bw98RI+A6eJO8Qs6/BJuFL9dXaxDKCiD6xBolUPKaWvZUMKZ+rZUw X-Received: by 2002:a17:90a:d144:: with SMTP id t4mr7525813pjw.18.1643801311441; Wed, 02 Feb 2022 03:28:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643801311; cv=none; d=google.com; s=arc-20160816; b=JZosey2pu8KLoNm1K+YW/vXrB7Z2yIlmyOGAeTb3uIfmHZt1EX+l6sHEwCj1FNTcId +evQHe8up2+1cNFCKVCkvBfuRkhMNy75fwxqY0FI5ZsWupjVRdX3zrSlHNxybMXxD3ZZ V7NtxSCiFK5N2GyKs6Byvn0FKmrfPyqa/kuSo07ec94UfBDIyONFXhoME+ginhissTo/ Gd/KQJ0Pvo1HNmvi19dGQOo88Mzl5JidnnCRMfoAH2ldR5RzvbcGOhjioekYClyCn+af XfQMYhe0+jUOGHP6/O1YZXi75zOLe9yfsD1hyuHLToW93umZ+PwRqgFzE9REeODCZ8Pj 7NgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=fkSgioWMLTkoGqDIWLCMutKn9jLySdUQ1z5vlGZxV6U=; b=ML5Osb0C2Rm9wK2DobEVd/2jBAJ0HoAgOxOzkSEjXdGhyKlMP74csY7rpKrWvYz1t8 wF8sXaD2mTBx7CSIvfnAEv7U0QZHcTk5WV/H4WGbjOXDz51Ar5PIguUl+vt5oHZ0mRo4 zV3ztZYwTc9sybIiV29bE5uISiq7hgVu4RQnTJg3UAVBpbTsANOxsLwyU/JT9x2G7nME cFVJgSkW2A6eEpRZ3heTJy8YCgwlJr97p9efIlMf1Jgjh75KNnEDT7DruCjb5PDB4Cui R4YN/tJiWSPlsx5/uGr3rwhNz0weRV2sOpOequo3mbP4D5Z31Ni4iZpHRoXsBuxcwKzK gzPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@semihalf-com.20210112.gappssmtp.com header.s=20210112 header.b=YpXqGIV2; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r201si20447002pgr.539.2022.02.02.03.28.14; Wed, 02 Feb 2022 03:28:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@semihalf-com.20210112.gappssmtp.com header.s=20210112 header.b=YpXqGIV2; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234665AbiBAUEA (ORCPT + 99 others); Tue, 1 Feb 2022 15:04:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235556AbiBAUD7 (ORCPT ); Tue, 1 Feb 2022 15:03:59 -0500 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 837D5C06173D for ; Tue, 1 Feb 2022 12:03:58 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id s9so34116938wrb.6 for ; Tue, 01 Feb 2022 12:03:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=fkSgioWMLTkoGqDIWLCMutKn9jLySdUQ1z5vlGZxV6U=; b=YpXqGIV2xajDvz/AyCf84Z84DIJMY5LWHcF7m1Wl+JNx9uLVn99PhIm02pgkxdNJci WQUhQlO5O5TL7tKJJtepsJDxS7TpCxfoW6UjSf7tiiCtlbcon42ptbIyMUEuy+J/BTqU U9mtJEm9935C9ygtdwfRa1JKqjOPxCyFYBs5EYb4uf8NHp03nuJC3DW7u55CYxJbbHle 0YmaEQYu8rGxRJbhJtHJCk9VIpR1sRsnv7jTEggIbYpQkPdXRPQ7Vk1DFtuUuWwmUQN5 uHSW+rpsKydP6AFn5Rk4HpL0wxv7P9rzbJ7OJvv2f1bHAzGsuCu6H1rHWYDY9mXZpz77 ZnJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=fkSgioWMLTkoGqDIWLCMutKn9jLySdUQ1z5vlGZxV6U=; b=buEbEgrEwOdqgxdyOPFjeNKGDrhsnX2kRIHTgusK49tEWax5+BR9ZtSUFSEgg1xR40 kv72AkZvH3ONmBmm4qMbMwR4yLtmrJ6oheOPJUV1p46oarPHeDpcSXUjpIh0REoIbokj z32+Ag/bgkSE/TEgn6BajGRlXyEqIbatE/JZUmVzMwY6c0UYmXGNdhJH2QkU6szb1ckV 6d0XJWra0sBR6emI8tcrTGIFbu7VJYWhquTW63V9FMjzaEzi3r9YvSTUJEJPxEdbAQpa i1kZF6TctuswlTnIPxetHS/4H0q5jWNLGxiYdTmm7y0J0Ygc4/V6esGRa59W00PZV/tU kpvg== X-Gm-Message-State: AOAM530WLBzCqkhOwP+vCqJvh2WjRo1rwgxzrvBQSfeqcFkcfBzSUePX LVOJj2eiAtFClX1Dj1QQQ0h/NFKeECTstg== X-Received: by 2002:adf:e6c9:: with SMTP id y9mr23944872wrm.389.1643745836719; Tue, 01 Feb 2022 12:03:56 -0800 (PST) Received: from biernacki.c.googlers.com.com (105.168.195.35.bc.googleusercontent.com. [35.195.168.105]) by smtp.gmail.com with ESMTPSA id m6sm3367280wmq.6.2022.02.01.12.03.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 12:03:56 -0800 (PST) From: Radoslaw Biernacki X-Google-Original-From: Radoslaw Biernacki To: linux-bluetooth , Luiz Augusto von Dentz , Marcel Holtmann Cc: CrosBT Upstreaming , Archie Pusaka , Miao-chen Chou , Jakub Kicinski , Johan Hedberg , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, upstream@semihalf.com, Radoslaw Biernacki , Angela Czubak , Marek Maslanka , Radoslaw Biernacki Subject: [PATCH v2 0/2] Bluetooth: Fix skb handling in net/bluetooth/mgmt.c Date: Tue, 1 Feb 2022 20:03:51 +0000 Message-Id: <20220201200353.1331443-1-rad@semihalf.ocm> X-Mailer: git-send-email 2.35.0.rc2.247.g8bbb082509-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Here is second version of the fix for skb handling in net/bluetooth/mgmt.c First patch is fixing the skb allocation which theoretically might push skb tail beyond its end. Second patch simplifies operations on eir while using skb. Patches adds two helper functions to eir.h to align to the goal of eliminating the necessity of intermediary buffers, which can be achieved with additional changes done in this spirit. v1->v2: - fix mgmt_device_connected() - add eir_skb_put_data() - function for skb handing with eir Radoslaw Biernacki (2): Bluetooth: Fix skb allocation in mgmt_remote_name() & mgmt_device_connected() Bluetooth: Improve skb handling in mgmt_device_connected() net/bluetooth/eir.h | 20 ++++++++++++++++++++ net/bluetooth/mgmt.c | 43 ++++++++++++++++--------------------------- 2 files changed, 36 insertions(+), 27 deletions(-) -- 2.35.0.rc2.247.g8bbb082509-goog