Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4A8AB2D042 for ; Mon, 18 Mar 2024 10:21:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710757284; cv=none; b=CM9z6+RUa8YlHUWwnnTIJm86oLw/EFpRBIPK0pdkDGh9C3QqNbz0f+w4c4LZEo5lc6j9/gPKaTWowVcJEzarLHd9f1UQ6kOLp6GXemqJAVZYgap+JtVBYnxki74dMX3k18NFZlNjNM07SRM4/7/CqFLW6bq/iTD43D5PCjPKKtk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710757284; c=relaxed/simple; bh=WpEV1D1EQNxw5Wl338cfu5ZMGR7OcMxwZ7fRROd+4cM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=DMJ8HdZDaXII+r7ZQJOlqyWdRvkHKWRnqy0ZoMWposc7tvSj6VNvG4mSeNYKlpWnPj0Bsn+FBXwhcGKramLcG6SbZuWZEEvBom92+ZV05Hh38kcWQ1Mdq7pXDR0eg6/CIg/0PncGvdUujTWaBTn/sanDoAytBGAdVclWWnyvxks= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jFSzFZxt; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jFSzFZxt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31268C43390; Mon, 18 Mar 2024 10:21:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710757283; bh=WpEV1D1EQNxw5Wl338cfu5ZMGR7OcMxwZ7fRROd+4cM=; h=From:To:Cc:Subject:Date:Reply-to:From; b=jFSzFZxtFMbcc8EJi8SjzmfOtB3F4a+3cgBuY5qm9aiIXfyn1TktcW7PMEUdVxDCO 8xeFOG9/5MEd5OigWIOk4zUj5a2OWzK8zB82eb8ATM96LJQOdy8IeRL92r7zPuUIW9 KF2ge7qg/72gOeImS43g/kDLRLmbbnhsjM0wARsSDbSPfKipjXYCBEN5tL5GZiLsSV LnBzAgqONLb1ztFWcho1nOXLYFDhqmZTLsZkK9CspGLX+/pBFWR5uJ98SrutqKD7xo pyapFLYOtVTU0mMKTIGTxXI/S9FFPPeBgnhQq4AQtBC0jONpVLFuPCGMq5rJJIJk5q s5foDxcfzsxAg== From: Lee Jones To: linux-cve-announce@vger.kernel.org Cc: Lee Jones Subject: CVE-2023-52618: block/rnbd-srv: Check for unlikely string overflow Date: Mon, 18 Mar 2024 10:21:19 +0000 Message-ID: <20240318102117.2839904-8-lee@kernel.org> X-Mailer: git-send-email 2.44.0.291.gc1ea87d7ee-goog Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=3230; i=lee@kernel.org; h=from:subject; bh=WpEV1D1EQNxw5Wl338cfu5ZMGR7OcMxwZ7fRROd+4cM=; b=owEBbQKS/ZANAwAKAVGvii+H/HdhAcsmYgBl+BWdN/kU8ihaIoQ1I9CvJPofO8Cor+SfD7GCD jqST7n2VSOJAjMEAAEKAB0WIQR2tsk1o74gmpTwh0hRr4ovh/x3YQUCZfgVnQAKCRBRr4ovh/x3 YY+SD/4xKUmRJS3sNhsOsHwDA4Tb6eUmFILeEBgwb8h91PnLceEHO5sJ8cLE6gYHZ3H9tyZVUSp lug1yr6DKjAP9IXxrXlaDZ+PBtvNL/7OV5znoIkNx6Cdzai7T2wzVFAOKCgXv0yntOmKstxVS8i 5wKOkh+2H7be22g/W4IqzfkwRKVb5cPx6chyt2B7KcEbSRBOWRVezOLjs0I/61QApiomPMpn2Km au5qCkZMRI8kYz0eFYS22Cx3Qsf76Lxy9SECIFiCEVjm0wB+kjuo+lpB8XlXRA+/2dBszxR2JW8 F84BOW+wDft0sEd19li9HqwDkD6JEgxWCvZQOlE31Yi/I505uRlpa1IbvYAc+pb4OMsuxM0SS36 L8ueSGE7sCrISuN2pVAnedqolTBATTUJAKEA9OVTlIo5sgCFvFY8lSTDWI6UC7GsX/JxINfbZNe ZkDBldaAyYzxiacymasRC4+o1NcKyW/tfSem1Ntpis3H1UuH0pdFYI4RczBBrVXtUSTbHuWErh/ rLUcmt24G9WoxRJ7tp7vFSVFGDYFnpREjVqHa2oVe5l9WqSbiQhTAi49TdEHyxPhIPbOvDU2fdS bg+Oax6eKXkao6XnV+vnU8qh+F/utKX+YQpV7aKDig/0dFuQpmQat96/OQiONXdqhOmb0I1T19Q rcTbGQ1QlhH03iQ== X-Developer-Key: i=lee@kernel.org; a=openpgp; fpr=76B6C935A3BE209A94F0874851AF8A2F87FC7761 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: block/rnbd-srv: Check for unlikely string overflow Since "dev_search_path" can technically be as large as PATH_MAX, there was a risk of truncation when copying it and a second string into "full_path" since it was also PATH_MAX sized. The W=1 builds were reporting this warning: drivers/block/rnbd/rnbd-srv.c: In function 'process_msg_open.isra': drivers/block/rnbd/rnbd-srv.c:616:51: warning: '%s' directive output may be truncated writing up to 254 bytes into a region of size between 0 and 4095 [-Wformat-truncation=] 616 | snprintf(full_path, PATH_MAX, "%s/%s", | ^~ In function 'rnbd_srv_get_full_path', inlined from 'process_msg_open.isra' at drivers/block/rnbd/rnbd-srv.c:721:14: drivers/block/rnbd/rnbd-srv.c:616:17: note: 'snprintf' output between 2 and 4351 bytes into a destination of size 4096 616 | snprintf(full_path, PATH_MAX, "%s/%s", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 617 | dev_search_path, dev_name); | ~~~~~~~~~~~~~~~~~~~~~~~~~~ To fix this, unconditionally check for truncation (as was already done for the case where "%SESSNAME%" was present). The Linux kernel CVE team has assigned CVE-2023-52618 to this issue. Affected and fixed versions =========================== Fixed in 5.10.210 with commit 95bc866c1197 Fixed in 5.15.149 with commit f6abd5e17da3 Fixed in 6.1.77 with commit af7bbdac8973 Fixed in 6.6.16 with commit 5b9ea86e6620 Fixed in 6.7.4 with commit a2c6206f1810 Fixed in 6.8 with commit 9e4bf6a08d1e Please see https://www.kernel.org or a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2023-52618 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: drivers/block/rnbd/rnbd-srv.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/95bc866c11974d3e4a9d922275ea8127ff809cf7 https://git.kernel.org/stable/c/f6abd5e17da33eba15df2bddc93413e76c2b55f7 https://git.kernel.org/stable/c/af7bbdac89739e2e7380387fda598848d3b7010f https://git.kernel.org/stable/c/5b9ea86e662035a886ccb5c76d56793cba618827 https://git.kernel.org/stable/c/a2c6206f18104fba7f887bf4dbbfe4c41adc4339 https://git.kernel.org/stable/c/9e4bf6a08d1e127bcc4bd72557f2dfafc6bc7f41