[packages/smartmontools] Rel 2. Fix smartd stack overflow on long SCSI VPD pages

arekm arekm at pld-linux.org
Thu Oct 29 09:07:02 CET 2026


commit 32f749a94a21a201744071124559bb437ec03bf0
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu Oct 29 00:00:29 2026 +0100

    Rel 2. Fix smartd stack overflow on long SCSI VPD pages

 smartd-vpd-buffer-overflow.patch | 30 ++++++++++++++++++++++++++++++
 smartmontools.spec               |  7 +++++--
 2 files changed, 35 insertions(+), 2 deletions(-)
---
diff --git a/smartmontools.spec b/smartmontools.spec
index 2ea7b15..b0297b9 100644
--- a/smartmontools.spec
+++ b/smartmontools.spec
@@ -18,7 +18,7 @@ Summary(pl.UTF-8):	Monitorowanie i kontrola dysków za pomocą S.M.A.R.T
 Summary(pt.UTF-8):	smartmontools - para monitorar discos e dispositivos S.M.A.R.T.
 Name:		smartmontools
 Version:	7.5
-Release:	1
+Release:	2
 License:	GPL v2+
 Group:		Applications/System
 Source0:	https://github.com/smartmontools/smartmontools/releases/download/RELEASE_7_5/%{name}-%{version}.tar.gz
@@ -28,9 +28,11 @@ Source3:	10mail
 Source4:	10powersave-notify
 Source5:	smartd-runner
 Patch0:		53_use-smartd-runner-by-default.diff
+# https://github.com/smartmontools/smartmontools/commit/896b967bd82f63b19cd21538c29033c72600b88f
+Patch1:		smartd-vpd-buffer-overflow.patch
 URL:		https://www.smartmontools.org
 BuildRequires:	autoconf >= 2.64
-BuildRequires:	automake >= 1:1.10
+BuildRequires:	automake >= 1:1.13
 %{?with_capng:BuildRequires:	libcap-ng-devel}
 %{?with_selinux:BuildRequires:	libselinux-devel}
 BuildRequires:	libstdc++-devel >= 6:4.8.1
@@ -166,6 +168,7 @@ sobre unidades de disco.
 %prep
 %setup -q
 %patch -P0 -p1
+%patch -P1 -p1
 
 %build
 %{__aclocal}
diff --git a/smartd-vpd-buffer-overflow.patch b/smartd-vpd-buffer-overflow.patch
new file mode 100644
index 0000000..2293153
--- /dev/null
+++ b/smartd-vpd-buffer-overflow.patch
@@ -0,0 +1,30 @@
+From 896b967bd82f63b19cd21538c29033c72600b88f Mon Sep 17 00:00:00 2001
+From: Douglas Gilbert <dgilbert at interlog.com>
+Date: Mon, 21 Sep 2026 11:53:56 -0400
+Subject: [PATCH] scsi: smartd: increase size of VPD buffer
+
+This patch is in response to:
+https://github.com/smartmontools/smartmontools/security/advisories/GHSA-94qp-hqvj-64h9
+
+VPD pages in SCSI have a single byte length field in their 4th byte (vpd[3])
+That byte is the length of the VPD page _beyond_ that point. So an attacker
+could set that byte to 0xff which implies a VPD page length of 259 bytes.
+This patch expands the receiving buffer to 264 bytes long, so it is relatively
+crude. If it is not sufficient, it will be revisited.
+---
+ smartd.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/smartd.cpp b/smartd.cpp
+index db5464b94..492aaebf6 100644
+--- a/smartd.cpp
++++ b/smartd.cpp
+@@ -2712,7 +2712,7 @@ static int SCSIDeviceScan(dev_config & cfg, dev_state & state, scsi_device * scs
+   struct scsi_iec_mode_page iec;
+   uint8_t  tBuf[64];
+   uint8_t  inqBuf[96];
+-  uint8_t  vpdBuf[252];
++  uint8_t  vpdBuf[264];
+   char lu_id[64], serial[256], vendor[40], model[40];
+ 
+   // Device must be open
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/smartmontools.git/commitdiff/32f749a94a21a201744071124559bb437ec03bf0



More information about the pld-cvs-commit mailing list