Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1824446pxb; Mon, 13 Sep 2021 06:23:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYpVbE2fQIrpxS+F1qvXEy4oVE1+/qJac359BYp3UKQva4Uc1zBQxh3VyrWrlk4aBqfN06 X-Received: by 2002:a6b:6a14:: with SMTP id x20mr8820603iog.177.1631539410263; Mon, 13 Sep 2021 06:23:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631539410; cv=none; d=google.com; s=arc-20160816; b=UgYhkDZdf4ZMpwg0drzPkUWfg5JV3xoxY6c27Xw5IEVRhgssiFOWdp7uw0Pq+H8jl4 jbczE8xvBjfDNz3ZvoJtCbTAyd1aFi5sYNnv9vk500jtUSvGK9D7NiiZ0wjwoxZYbPRH H+q88s4uPfnecXC117KmS1ffpNIq0Frq+Ok1hPpteub5E/QWlBQ6PH2VDteHzgE3Ft4K 8SwmxWocwqqTrePxGhI9//fNkPueawcv0WwubX7PEWrBD4HtzDid1n2SB6enalu1gl4G ZDDfU4CRbukgENVR6UydWpAR7VNbb+l+j+T/k7gkmf7hmSp69louuyWdECZRmSuNNotA ZIdg== 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=Bl7IpwLz6AtEmpqHF9lU8z/tOaPVDJf5BHQ7h5zyv2F1vL3EZ3F0keDWPr4zcso1sv 9vh6c0zpoShL6zdmnLsVZbWwnYJWSIa6RTVKmj3n2dPd7XF+f+hywPNrpVPPti6wS5Oo DjbDwLR92+vg+cRlLoddHIOZAWr8dzR4KqSVgB4bjDL2VCAXAXajh7eTydrcP6ml21V5 0ti8jSeCaWLBN6mXCTasaQTaWS4sPOLFB9kA4Tw+1gPb9iOa2RjoYUH4t5wzKJv8B7Gb hc2a3oha2xqV5RJOOYsnEAdZX8Qvm+JMkHLq9gUy0c9Cw/U8Iw37lQXPT6eyVAMp/3G/ OwKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pkXYYwrC; 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 h17si1568642ilq.30.2021.09.13.06.23.17; Mon, 13 Sep 2021 06:23:30 -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=pkXYYwrC; 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 S240319AbhIMNXJ (ORCPT + 99 others); Mon, 13 Sep 2021 09:23:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:34844 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240275AbhIMNVW (ORCPT ); Mon, 13 Sep 2021 09:21:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A0E2B610CB; Mon, 13 Sep 2021 13:20:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539207; bh=uuZMw6J5hMtC9lRbJ1wg88tUyZpGYzYRmpNXWwfNY5U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pkXYYwrC7mlJbCAdHzHhhJ4jH6TUQOUnUodM9frIzXP+dJ2fb6ToeJzFQeSGTa3gH WAFAGFPRVuL1/kYc7uh63Jt/EtbQlP+w2KyV1byE8aIJTSLO3hBhIdJDjadgPoIdr3 dIxC4kHQ5FZ3clzMy0CxmH/t0Y4wpZ4YIJ8TWRJk= 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.4 081/144] Bluetooth: increase BTNAMSIZ to 21 chars to fix potential buffer overflow Date: Mon, 13 Sep 2021 15:14:22 +0200 Message-Id: <20210913131050.674642493@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131047.974309396@linuxfoundation.org> References: <20210913131047.974309396@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