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=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 35D20C4320A for ; Thu, 5 Aug 2021 13:06:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1D90260F10 for ; Thu, 5 Aug 2021 13:06:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241608AbhHENGv convert rfc822-to-8bit (ORCPT ); Thu, 5 Aug 2021 09:06:51 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:53490 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240184AbhHENGt (ORCPT ); Thu, 5 Aug 2021 09:06:49 -0400 Received: from smtpclient.apple (p5b3d23f8.dip0.t-ipconnect.de [91.61.35.248]) by mail.holtmann.org (Postfix) with ESMTPSA id CC48ECECF0; Thu, 5 Aug 2021 15:06:32 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) Subject: Re: [PATCH] Bluetooth: increase BTNAMSIZ to 21 chars to fix potential buffer overflow From: Marcel Holtmann In-Reply-To: <20210804150951.116814-1-colin.king@canonical.com> Date: Thu, 5 Aug 2021 15:06:32 +0200 Cc: Karsten Keil , Johan Hedberg , Luiz Augusto von Dentz , "David S. Miller" , Jakub Kicinski , Andrei Emeltchenko , Gustavo Padovan , "open list:NETWORKING [GENERAL]" , BlueZ , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: References: <20210804150951.116814-1-colin.king@canonical.com> To: Colin King X-Mailer: Apple Mail (2.3654.100.0.2.22) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Colin, > An earlier commit replaced using batostr to using %pMR sprintf for the > construction of session->name. Static analysis detected that this new > method can use a total of 21 characters (including the trailing '\0') > so we need to increase the BTNAMSIZ from 18 to 21 to fix potential > buffer overflows. > > Addresses-Coverity: ("Out-of-bounds write") > Fixes: fcb73338ed53 ("Bluetooth: Use %pMR in sprintf/seq_printf instead of batostr") > Signed-off-by: Colin Ian King > --- > net/bluetooth/cmtp/cmtp.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) patch has been applied to bluetooth-next tree. Regards Marcel