Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp151459pxb; Mon, 13 Sep 2021 15:36:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyAxrtQ2sAtnZRy3i0DOlD3my7dET7awuOB++R0Em0nOQUySSUGX5N+IQv4jkdbSAuu0Up X-Received: by 2002:a92:194c:: with SMTP id e12mr10052236ilm.3.1631572606856; Mon, 13 Sep 2021 15:36:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631572606; cv=none; d=google.com; s=arc-20160816; b=haDkwfaRv7At2KaqAH9E0Yhn1ZQtPu/gnA3FbMRB01au2bCCwMVK890gF0SM2/KiGJ 7uj1fBr3/M/B2IYd5rQbPs2kMdLmGs3EjWSXN99U4p0jiFpFewh+g3AfqyMD3PIAWyB2 j+PSJG38+fZNigsuqJkwufcBrjJLMAgtwc6KtlgwpEjW+xj8qs8NZq+LPEHzPfHZXI84 fUDgHKfDWzqIXEX0KYBaZXDddxhrRcBonjH5CohaVThBWSk7Ibx2HVjXWiixQ7int4NR an2TSJxcEusWTTD+eLerWnCB85UIUqTqHOPzuwDXcvWokMEojCZ55rsSKkNQEU+Hg3Lw qqlw== 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=E1D2Sn+Uqj7HvO+AQp7WkTUX9kLLSx2q7NwNv1WeicID4qVOiaN/zcn61g6HOvlWp+ MJ+cV0Gb4MoY/DnSg/nSI4WVXghMq+WWwxqUgqDHtCQ55SSsx4s0RmJB2JnyDtUuOtiC SuI5jtZqN01PFr3C++miRfW7GY+w9IRkJGRisZ4nV7HtQ/ltPK9eG4SQ7+TcVehvPHuP o/arbZjVtAr64jOwkNftBqGu/IHJmUPm4W6U69pdB2YIkD8ehdGrSAaypBnJdRgpzrhh xwcKSXBMIMuYJuBSV87tXdlts/0EjsNvy6RrN6tszsoBhr5/oa/tYwas7Pdp5yxBi51g vW1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QZXyvybM; 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 s4si7596204jaa.5.2021.09.13.15.36.34; Mon, 13 Sep 2021 15:36:46 -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=QZXyvybM; 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 S243638AbhIMOHt (ORCPT + 99 others); Mon, 13 Sep 2021 10:07:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:54578 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344245AbhIMOEl (ORCPT ); Mon, 13 Sep 2021 10:04:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CB17861A54; Mon, 13 Sep 2021 13:39:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631540351; bh=uuZMw6J5hMtC9lRbJ1wg88tUyZpGYzYRmpNXWwfNY5U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QZXyvybMZt6gZhldSU/o00KkYFUHrD50HLcVrzSSx+8UarykmOJd/OD2yVsh9WNLL CbvBDxy6VWUjKjMbgcJUi3Fzl6GwOIQ9/vG3OXkRdAtbMScx1hNytg+zmCra88/YVp RXBu++TVnkefuBth+/wFJ5oizxGgsBKnCP/OG/vM= 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 5.13 156/300] Bluetooth: increase BTNAMSIZ to 21 chars to fix potential buffer overflow Date: Mon, 13 Sep 2021 15:13:37 +0200 Message-Id: <20210913131114.683823141@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131109.253835823@linuxfoundation.org> References: <20210913131109.253835823@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