Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp188827pxb; Tue, 15 Feb 2022 11:03:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJyEDu7kvCkaozK05tLk3leTPQZTgWrRX3r1vKodsdVS27lA9zR8wE4f1M1PrPfqWVq2ifnZ X-Received: by 2002:a17:907:3f94:: with SMTP id hr20mr397134ejc.481.1644951787390; Tue, 15 Feb 2022 11:03:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644951787; cv=none; d=google.com; s=arc-20160816; b=DJ4MSNPeBhuctVDFSNmEfmrFex/6Mcavcch0HoVyxLJVl9SfrO30iBshxN3d4VQMJr PSc+imPWxPPQGRAefa3Zg+KSYFQvjuAbtkb3SielTDl82c18JJA/bD6RobyEa0PNMlt6 0JWee4sw31djlCRdJF1NX5JwsYBetDt23J+PnRDSsG9JbayeyWAabqqK4KvrEYC6R/ri ImE3Q7s1yWRFosxo8jraYVeGL39eTVct0wGUm4PcstOqwFAJWkHzEWNuHWUDInnGAAS5 14j6/IXwPfxXxFCihWTUqS6aPmkpXzvQsTLgVyhO2QxgWng6L/66emLG0prrCzGQ7SOd RT5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from:cc :references:to:content-language:subject:user-agent:mime-version:date :message-id; bh=wtV8ywLHEn5O58O9QwzGl6Ja72IzQyBoJ0xCnmKvR7g=; b=xDCP5sBi1flfzvDqNNNOGIjsUuAgTIr/k61UcuOs6QN87viaCLNbiOp7A//gmIlb0S JmyLp+5SbaUcKc4Z8jDiDgJU80HCk5ZH89fg0LtEYGXvdLlx4C1QJiaIPop3uwqhSOho XUvsdcWAY1JAi+pZlblI7XIGnbhz2b00PmTWwrp9XX30s4ZJFStZU40KxQ32QHPHEKa0 DLdxxrczU2o4uXVOiykCOkj1Hv0x+ysmu/cCISZ3W7ahcVoAnlbOswK0U68L3DOba8Gy Uh5YdjjBVpoQz3plgFQH8ZSxwzzp4MhyPThrqFVyztJppB5K8LB5NpnHo4QMr5z4x3hQ LHXQ== ARC-Authentication-Results: i=1; mx.google.com; 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 f18si500270edd.434.2022.02.15.11.02.20; Tue, 15 Feb 2022 11:03:07 -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; 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 S236211AbiBOKHe (ORCPT + 99 others); Tue, 15 Feb 2022 05:07:34 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235480AbiBOKHe (ORCPT ); Tue, 15 Feb 2022 05:07:34 -0500 Received: from mx1.molgen.mpg.de (mx3.molgen.mpg.de [141.14.17.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44D727E5B5 for ; Tue, 15 Feb 2022 02:07:23 -0800 (PST) Received: from [192.168.0.2] (ip5f5aee0e.dynamic.kabel-deutschland.de [95.90.238.14]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id C918461EA1928; Tue, 15 Feb 2022 11:07:21 +0100 (CET) Message-ID: <232b507b-65bd-3857-78f9-4df888620823@molgen.mpg.de> Date: Tue, 15 Feb 2022 11:07:21 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: [PATCH] Bluetooth: Fix bt_skb_sendmmsg not allocating partial chunks Content-Language: en-US To: Luiz Augusto von Dentz References: <20220215015938.1950978-1-luiz.dentz@gmail.com> Cc: linux-bluetooth@vger.kernel.org From: Paul Menzel In-Reply-To: <20220215015938.1950978-1-luiz.dentz@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Dear Luiz, Am 15.02.22 um 02:59 schrieb Luiz Augusto von Dentz: > From: Luiz Augusto von Dentz > > Since bt_skb_sendmmsg can be used with the likes of SOCK_STREAM it > shall return the partial chunks it could allocate instead of freeing > everything as otherwise it can cause problems like bellow. Thank you for fixing the bug I found. Tested-by: Paul Menzel (Nokia N9 (MeeGo/Harmattan) > Link: https://lore.kernel.org/linux-bluetooth/aa3ee7ac-6c52-3861-1798-3cc1a37f6ebf@molgen.mpg.de/T/#m1f9673e4ab0d55a7dccf87905337ab2e67d689f1 The Linux kernel regression status, when expanding the bug entry: asks to add: Fixes: 81be03e026dc ("Bluetooth: RFCOMM: Replace use of memcpy_from_msg with bt_skb_sendmmsg") Reported-by: Paul Menzel Link: https://lore.kernel.org/r/d7206e12-1b99-c3be-84f4-df22af427ef5@molgen.mpg.de > Fixes: 81be03e026dc ("Bluetooth: RFCOMM: Replace use of memcpy_from_msg with bt_skb_sendmmsg") > Signed-off-by: Luiz Augusto von Dentz Maybe also add: BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215594 > --- > include/net/bluetooth/bluetooth.h | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h > index 4b3d0b16c185..a647e5fabdbd 100644 > --- a/include/net/bluetooth/bluetooth.h > +++ b/include/net/bluetooth/bluetooth.h > @@ -506,8 +506,7 @@ static inline struct sk_buff *bt_skb_sendmmsg(struct sock *sk, > > tmp = bt_skb_sendmsg(sk, msg, len, mtu, headroom, tailroom); > if (IS_ERR(tmp)) { > - kfree_skb(skb); > - return tmp; > + return skb; > } > > len -= tmp->len; Kind regards, Paul [1]: https://linux-regtracking.leemhuis.info/regzbot/mainline/