Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp66996pxb; Mon, 13 Sep 2021 13:07:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3AfIPo2d5zf4mRBZelpjUZn/2JKxogS3FF7QjyjwHwHHlQG9OXk/Lwt0YggUSPQC7zcJi X-Received: by 2002:a17:906:7147:: with SMTP id z7mr12393614ejj.94.1631563640914; Mon, 13 Sep 2021 13:07:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631563640; cv=none; d=google.com; s=arc-20160816; b=yeduN/9a/huFaBMgJM9HMwire5ud3lotuLTrTrDXhbKMIArMXRMIpUdHyU1a7PDuoe 98JdWPEeJwEIgoiHVliURhQGA6Uu7GWJ5tOjzLD2uADBZpQeDk+MkgsfUecDvaBGjZu1 h1cNTZ6Eqa1GsUeRFlZSvuDYYFxvO/TE+S5Yt5x+0Te+u212XoXMNu9dN32TWpw0odbU qeghJ62XC6La8PiIVeibtwP+H1J84buMvqHAUSwpIeCQeqQanp6bPyXxctlelz143fEC gOnIVbSuBgCSgb81yAJz7RDPFSDb5QF7MYo02/5QYN5dTscvSBGAKjuFeP5pi9W5TOvm Veag== 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=swlr54OIsfRSqZlyxKnuUJoW3UspKe4NUf+wiD5c+YBozoEgLTyZretYHi6MZN0h5o z7nlz7TI2tdzKnRxqfxtRq5Ywr3D8s5NJfQHpFj5kPSlnIuEmtqgzeyEjQFP3vlbxEDE P+W9b0stRu0ApdpNV+UM2/iB7ro9PMOZNZByzjZO8Om7Ye3th0id+doaA/kDZP8HQlvX R+uT8xfE84/+7p+xD9zCFGMAR63FKPn5hm+mkeMMjBi1Ye1SmUpnvbPKzVcm13kmsh6j iVS6qyCD+QSj2kpJoFQgt5L0VpHVhbV1arKHJDjNb5Xr35KD8MdqQe4Drp729xc5086Z LMUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YBlnqiFS; 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 x43si8006090edy.609.2021.09.13.13.06.49; Mon, 13 Sep 2021 13:07:20 -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=YBlnqiFS; 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 S243035AbhIMNoP (ORCPT + 99 others); Mon, 13 Sep 2021 09:44:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:35546 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242657AbhIMNiY (ORCPT ); Mon, 13 Sep 2021 09:38:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5AABD61262; Mon, 13 Sep 2021 13:28:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539713; bh=uuZMw6J5hMtC9lRbJ1wg88tUyZpGYzYRmpNXWwfNY5U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YBlnqiFSwnaf+LjmAr2SRTl99WGcRPgwlZcEnibQUipZLre9HozFUcPXgeLy1DECR CSxQ0YlIL1/Xewhon8nVITTu9HdvyAOL6Zy258kSaeWd3GSpZ1aDGxx46rUtMffd+S 7ymv1NBuRh0Tio8Ut2b8BjIgLkmlUVa3jPtG99Ew= 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.10 130/236] Bluetooth: increase BTNAMSIZ to 21 chars to fix potential buffer overflow Date: Mon, 13 Sep 2021 15:13:55 +0200 Message-Id: <20210913131104.789603151@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131100.316353015@linuxfoundation.org> References: <20210913131100.316353015@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