Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 EF28F471265; Tue, 21 Jul 2026 18:36:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784659010; cv=none; b=kK+au/g7n9GOiA5HSPXaQczXksTpVfJ5XK6+rgRs/9GBGz1SIz7G9XL7LMys0v1+Lwytcpu5baJRCgkihkB/omMAUYKLS3438rYwCJDY/JxwZ1JzeI75Zshw6RBJgznh9KtmpZFPLIvqcizL87yI9IJchGrcAJRRebZjLVRr8vY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784659010; c=relaxed/simple; bh=s/BymlMjPPPLJLh/bsYvoEszl/epVps8P6tmsa/lmC0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=D1fLD4WFVZe1m9oAM59MQ3YRsGTgpduxB4Vw4+tN44G2DwK2nCR9N81IG6CA03avEd01Fx8JwOgr1PaCwCSrl1FUsZvQ1bROiGkQY6H+28dZH3sVACUmjcOXsjeFZPfMutguYn+R047hcXwCCiRo+7DJz2dYt3huRtV6LpV23aA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=EEkDVthX; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="EEkDVthX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5ED451F000E9; Tue, 21 Jul 2026 18:36:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784659008; bh=jNUc+O59I13Mv+k/zR5XuSBsWkZhxnCVJ6AXe3YBxdw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=EEkDVthXjmo7K4Tmi0hMEsWW7/6RG3E4nner2N5jue0Kh8rDS39GyOhcEy7Cfx4tD 8Ej47RDA0aPWPemU/DzKF7+VpsINGnZvsOADAuZvZx8vjkvGL/QJfOnjmiN/EWGs+b Ezdk6kVvf1IeMTa8ZUeS9W3d2CKrhjdnr4F/MlVU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mikulas Patocka Subject: [PATCH 6.18 1360/1611] dm-verity: increase sprintf buffer size Date: Tue, 21 Jul 2026 17:24:36 +0200 Message-ID: <20260721152546.044187846@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152514.750365251@linuxfoundation.org> References: <20260721152514.750365251@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mikulas Patocka commit 88dd117c92a142253fb7a17e791773902b3babc6 upstream. The prefix "DM_VERITY_ERR_BLOCK_NR" is 22 chars. Add '=', one digit for type, ',', up to 20 digits for a u64 block number, and a NUL terminator: that's 46 bytes. The buffer is 42 bytes. For block numbers >= 16 decimal digits (devices larger than ~16 EB with 4K blocks), snprintf silently truncates the uevent environment variable. Signed-off-by: Mikulas Patocka Assisted-by: Claude:claude-opus-4.6 Fixes: 65ff5b7ddf05 ("dm verity: add error handling modes for corrupted blocks") Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/md/dm-verity-target.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/md/dm-verity-target.c +++ b/drivers/md/dm-verity-target.c @@ -25,7 +25,7 @@ #define DM_MSG_PREFIX "verity" -#define DM_VERITY_ENV_LENGTH 42 +#define DM_VERITY_ENV_LENGTH 46 #define DM_VERITY_ENV_VAR_NAME "DM_VERITY_ERR_BLOCK_NR" #define DM_VERITY_DEFAULT_PREFETCH_SIZE 262144