Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2319265pxb; Mon, 20 Sep 2021 18:42:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0lAWVR+GQEuTFM5rT7eoXmOaeH5Qv2T77dhpWJkL+6M9jyEOsZbDHZOt5159v3puTTuN3 X-Received: by 2002:a17:906:7848:: with SMTP id p8mr31245404ejm.212.1632188534869; Mon, 20 Sep 2021 18:42:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632188534; cv=none; d=google.com; s=arc-20160816; b=kmDp39WSx8cy61EhyPLLUPmAdl+b150Q373KvEzmKXFBY+rdlMkVqzy6uX5n9X1GW9 TtIdos5YK0YBbCYB5eVHBY2eEIez9gl59OUxZ6mUeitf1bRwM5yvIsxCEQWZgy6lVvPg OUMmv7JAwyFn9HMCXepZ14PfzYRl5PF+f++yIxUXIcWPosYO9Hg6XSjbnrfLhG1HgWZa rCshHpyJs8PmNc0hrdHILEzQPWoxhb3Ao5O5Pj6ZJ+0FuSO8+NgUlgk3RAIl1CR99LV3 XQCMa8c+Lxt67lBF09zWx+rfM3ur9WCs+jCZNgJZxToWhzUYmHZtGUDqyaL4XZYs2Ihq xTrQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bUgJuh2bjcAtR+7nbPUh9CPjhziQuqwEPOodbspa4+M=; b=FKkH2MdiE7pABkXgMWVdOgZH7DmR5+0e4eXZbkdktxCrUp4eN+LdAqARzlZDm8LlGs PKffJkDccjV6Cji3M0ou34BDT4lgUOFPQegwk6+jlqV/RfNw2fPH04Oi1lt6n4VH0qky Btt3UdiM6m05LwqTxrTUDrYAYXOP9X/NW63LsN51SAQ63Ol2ovzOJdvsPVj4SgNgeRYb DRuYWXMADVET+2piXjY5sLzv4wrzV9UPyF35u0nnOmhqfNHpcEm3xnzgW99qsCuWNCw/ JM/VEzRjhv1vOgNZcLNVtSs1Euso9PnwrFHLgFOM9spoLtNa8g/svQtqIEWYMesNKtfl TCCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="OYq/D/eP"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i14si17988816ejo.653.2021.09.20.18.41.52; Mon, 20 Sep 2021 18:42:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@linuxfoundation.org header.s=korg header.b="OYq/D/eP"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237602AbhITQtd (ORCPT + 99 others); Mon, 20 Sep 2021 12:49:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:36916 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243799AbhITQsR (ORCPT ); Mon, 20 Sep 2021 12:48:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6243F6124C; Mon, 20 Sep 2021 16:46:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632156410; bh=uuZMw6J5hMtC9lRbJ1wg88tUyZpGYzYRmpNXWwfNY5U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OYq/D/ePgJXbH07P20TrbjH14aWIsQmrTL+Ay1EEElGIrFXbhmP7IJ8TjKTzfXz5m q7baDivQ4DcsHm/sHbPSNeREX4q6GYJi96ZglYsU6C6CKY5ni4pbI8MohAyDyrKm/C 1ueFSBP6cwjhXuT92fZhxKHPduoY1hzaaceCbSKo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , Marcel Holtmann , Sasha Levin Subject: [PATCH 4.4 046/133] Bluetooth: increase BTNAMSIZ to 21 chars to fix potential buffer overflow Date: Mon, 20 Sep 2021 18:42:04 +0200 Message-Id: <20210920163914.157258532@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163912.603434365@linuxfoundation.org> References: <20210920163912.603434365@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King [ Upstream commit 713baf3dae8f45dc8ada4ed2f5fdcbf94a5c274d ] 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 Signed-off-by: Marcel Holtmann Signed-off-by: Sasha Levin --- net/bluetooth/cmtp/cmtp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/bluetooth/cmtp/cmtp.h b/net/bluetooth/cmtp/cmtp.h index c32638dddbf9..f6b9dc4e408f 100644 --- a/net/bluetooth/cmtp/cmtp.h +++ b/net/bluetooth/cmtp/cmtp.h @@ -26,7 +26,7 @@ #include #include -#define BTNAMSIZ 18 +#define BTNAMSIZ 21 /* CMTP ioctl defines */ #define CMTPCONNADD _IOW('C', 200, int) -- 2.30.2