diff -Nru smartmontools-7.3/debian/changelog smartmontools-7.3/debian/changelog --- smartmontools-7.3/debian/changelog 2022-04-27 13:39:01.000000000 +0800 +++ smartmontools-7.3/debian/changelog 2023-12-24 14:31:32.000000000 +0800 @@ -1,3 +1,10 @@ +smartmontools (7.3-1ubuntu0.23.10.1) mantic; urgency=medium + + * Add d/p/lp2042885-fix-segfault-reading-nvme-error-log-on-be.patch + to fix a smartctl on NVME segmentation fault. (LP: #2042885) + + -- Zhaoxuan Zhai Sun, 24 Dec 2023 14:31:32 +0800 + smartmontools (7.3-1) unstable; urgency=medium * New upstream release. diff -Nru smartmontools-7.3/debian/control smartmontools-7.3/debian/control --- smartmontools-7.3/debian/control 2022-04-22 20:41:40.000000000 +0800 +++ smartmontools-7.3/debian/control 2023-12-24 14:31:32.000000000 +0800 @@ -2,7 +2,8 @@ Section: utils Priority: optional Standards-Version: 4.6.0 -Maintainer: Dmitry Smirnov +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Dmitry Smirnov Uploaders: Florian Maier , Jonathan Dowland , Build-Depends: autoconf, diff -Nru smartmontools-7.3/debian/patches/lp2042885-fix-segfault-reading-nvme-error-log-on-be.patch smartmontools-7.3/debian/patches/lp2042885-fix-segfault-reading-nvme-error-log-on-be.patch --- smartmontools-7.3/debian/patches/lp2042885-fix-segfault-reading-nvme-error-log-on-be.patch 1970-01-01 08:00:00.000000000 +0800 +++ smartmontools-7.3/debian/patches/lp2042885-fix-segfault-reading-nvme-error-log-on-be.patch 2023-12-24 14:31:23.000000000 +0800 @@ -0,0 +1,61 @@ +Description: nvmecmds.cpp: Fix segfault after read of NVMe error log on big endian + hosts (GH issues/172, regression from r5121). + Thanks to Niklas Schnelle for the bug report. + git-svn-id: http://svn.code.sf.net/p/smartmontools/code/trunk@5448 4ea69e1a-61f1-4043-bf83-b5c94c648137 +Author: chrfranke +Origin: backport, https://github.com/smartmontools/smartmontools/commit/8d8fb7b6933414be6d647ee944f3cd8e933947b5 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/2042885 +Bug-IBM: BZ#203947 +Forwarded: not-needed +Applied-Upstream: https://github.com/smartmontools/smartmontools/commit/8d8fb7b6933414be6d647ee944f3cd8e933947b5 +Reviewed-by: Frank Heimes +Last-Update: 2023-12-24 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/ChangeLog ++++ b/ChangeLog +@@ -705,6 +705,13 @@ + + Happy New Year! Update copyright year in version info. + ++2023-02-03 Christian Franke ++ ++ nvmecmds.cpp: Fix segfault after read of NVMe error log on ++ big endian hosts (GH issues/172, regression from r5121). ++ ++ Thanks to Niklas Schnelle for the bug report. ++ + 2020-12-30 Christian Franke + + smartmontools 7.2 +--- a/nvmecmds.cpp ++++ b/nvmecmds.cpp +@@ -3,7 +3,7 @@ + * + * Home page of code is: https://www.smartmontools.org + * +- * Copyright (C) 2016-21 Christian Franke ++ * Copyright (C) 2016-23 Christian Franke + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +@@ -228,8 +228,9 @@ + unsigned n = nvme_read_log_page(device, 0xffffffff, 0x01, error_log, + num_entries * sizeof(*error_log), lpo_sup); + ++ unsigned read_entries = n / sizeof(*error_log); + if (isbigendian()) { +- for (unsigned i = 0; i < n; i++) { ++ for (unsigned i = 0; i < read_entries; i++) { + swapx(&error_log[i].error_count); + swapx(&error_log[i].sqid); + swapx(&error_log[i].cmdid); +@@ -240,7 +241,7 @@ + } + } + +- return n / sizeof(*error_log); ++ return read_entries; + } + + // Read NVMe SMART/Health Information log. diff -Nru smartmontools-7.3/debian/patches/series smartmontools-7.3/debian/patches/series --- smartmontools-7.3/debian/patches/series 2022-04-27 13:39:01.000000000 +0800 +++ smartmontools-7.3/debian/patches/series 2023-12-24 14:29:28.000000000 +0800 @@ -5,3 +5,4 @@ 63_removable.patch manpage.diff service-alias.patch +lp2042885-fix-segfault-reading-nvme-error-log-on-be.patch