Control: tags 1061770 + pending

Dear maintainer,

I've prepared an NMU for ipmitool (versioned as 1.8.19-7.1) and will
upload it to DELAYED/5 after a few days. I also plan to submit these
patches to stable-pu after they are in unstable.

Please feel free to tell me if you would like to upload it yourself, or
I should delay it longer.

Regards,
Shengqi Chen

diff -Nru ipmitool-1.8.19/debian/changelog ipmitool-1.8.19/debian/changelog
--- ipmitool-1.8.19/debian/changelog    2023-12-17 19:29:04.000000000 +0800
+++ ipmitool-1.8.19/debian/changelog    2024-10-18 16:52:22.000000000 +0800
@@ -1,3 +1,14 @@
+ipmitool (1.8.19-7.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * d/patches: backport several important fixes from upstream
+    + fix a buffer overrun in `open` interface
+    + fix lan print fails on unsupported parameters (closes: #1061770)
+    + fix parameter passed to read temperature sensors
+  * d/conrol: bump std-ver to 4.7.0 (no changes required)
+
+ -- Shengqi Chen <[email protected]>  Fri, 18 Oct 2024 16:52:22 +0800
+
 ipmitool (1.8.19-7) unstable; urgency=medium
 
   * debian/watch, debian/copyright, debian.control:
diff -Nru ipmitool-1.8.19/debian/control ipmitool-1.8.19/debian/control
--- ipmitool-1.8.19/debian/control      2023-12-17 19:29:04.000000000 +0800
+++ ipmitool-1.8.19/debian/control      2024-10-18 16:52:22.000000000 +0800
@@ -9,7 +9,7 @@
  libfreeipmi-dev [!hurd-i386],
  libreadline-dev,
  libssl-dev
-Standards-Version: 4.6.2.0
+Standards-Version: 4.7.0
 Rules-Requires-Root: no
 Vcs-Git: git://git.jff.email/ipmitool.git
 Vcs-Browser: https://git.jff.email/cgit/ipmitool.git
diff -Nru ipmitool-1.8.19/debian/patches/0800-fix-buffer-overrun.patch 
ipmitool-1.8.19/debian/patches/0800-fix-buffer-overrun.patch
--- ipmitool-1.8.19/debian/patches/0800-fix-buffer-overrun.patch        
1970-01-01 08:00:00.000000000 +0800
+++ ipmitool-1.8.19/debian/patches/0800-fix-buffer-overrun.patch        
2024-10-18 16:50:55.000000000 +0800
@@ -0,0 +1,35 @@
+From b4bc5c335159b1c272e06dba98e2916e3ecc0462 Mon Sep 17 00:00:00 2001
+From: Howitzer105mm <[email protected]>
+Date: Tue, 26 Mar 2024 11:28:16 +0000
+Subject: [PATCH] open: Eliminate buffer overrun (#24)
+
+clangd reports a buffer overrun issue in `open` interface.
+
+The sprintf() used to fill ipmi_devfs2 requires 17 bytes to store the
+null terminated string. The character buffer is only 16 bytes in
+length.
+
+Signed-off-by: Johnathan Mantey <[email protected]>
+Reviewed-on: https://codeberg.org/IPMITool/ipmitool/pulls/24
+Reviewed-by: Alexander Amelkin <[email protected]>
+Co-authored-by: Howitzer105mm <[email protected]>
+Co-committed-by: Howitzer105mm <[email protected]>
+Forwarded: not-needed
+Applied-Upstream: 
https://codeberg.org/IPMITool/ipmitool/commit/b4bc5c335159b1c272e06dba98e2916e3ecc0462
+---
+ src/plugins/open/open.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/plugins/open/open.c b/src/plugins/open/open.c
+index 39c8ea2..88cb6c3 100644
+--- a/src/plugins/open/open.c
++++ b/src/plugins/open/open.c
+@@ -94,7 +94,7 @@ ipmi_openipmi_open(struct ipmi_intf *intf)
+ {
+       char ipmi_dev[16];
+       char ipmi_devfs[16];
+-      char ipmi_devfs2[16];
++      char ipmi_devfs2[17];
+       int devnum = 0;
+ 
+       devnum = intf->devnum;
diff -Nru 
ipmitool-1.8.19/debian/patches/0801-fix-lan-print-fails-on-unsupported-parameters.patch
 
ipmitool-1.8.19/debian/patches/0801-fix-lan-print-fails-on-unsupported-parameters.patch
--- 
ipmitool-1.8.19/debian/patches/0801-fix-lan-print-fails-on-unsupported-parameters.patch
     1970-01-01 08:00:00.000000000 +0800
+++ 
ipmitool-1.8.19/debian/patches/0801-fix-lan-print-fails-on-unsupported-parameters.patch
     2024-10-18 16:51:51.000000000 +0800
@@ -0,0 +1,39 @@
+From 137aeb64cbb493d61d6945cac156aba5f0510780 Mon Sep 17 00:00:00 2001
+From: Miao Wang <[email protected]>
+Date: Sat, 10 Feb 2024 12:51:15 +0800
+Subject: [PATCH] lan: fix lan print fails on unsupported parameters
+
+After upgrading to ipmitool 1.8.19, ipmitool lan print can only print out
+`Set in Progress` and other parameters are missing on our servers. After
+bisecting, commit:
+
+  351dad24a26f lan: Add processing of get/set specific CCs
+
+is identified to be the source of the problem, where the function
+get_lan_param_select is expected to consider severial error codes it
+receives as empty response. It then constructs an empty response in `p`
+and assigns `p` to `rc` and the control flow falls through to the
+default case, which prints the error code in verbose mode and should
+return `rc` instead of `NULL`.
+
+Signed-off-by: Miao Wang <[email protected]>
+Forwarded: not-needed
+Applied-Upstream: 
https://codeberg.org/IPMITool/ipmitool/commit/137aeb64cbb493d61d6945cac156aba5f0510780
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1061770
+---
+ lib/ipmi_lanp.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/ipmi_lanp.c b/lib/ipmi_lanp.c
+index fe0046f..26e7365 100644
+--- a/lib/ipmi_lanp.c
++++ b/lib/ipmi_lanp.c
+@@ -245,7 +245,7 @@ get_lan_param_select(struct ipmi_intf *intf, uint8_t chan, 
int param, int select
+                       specific_val2str(rsp->ccode,
+                                        get_lan_cc_vals,
+                                        completion_code_vals));
+-              return NULL;
++              return rc;
+       }
+ 
+       p->data = rsp->data + 1;
diff -Nru ipmitool-1.8.19/debian/patches/0802-fix-temp-read-parameters.patch 
ipmitool-1.8.19/debian/patches/0802-fix-temp-read-parameters.patch
--- ipmitool-1.8.19/debian/patches/0802-fix-temp-read-parameters.patch  
1970-01-01 08:00:00.000000000 +0800
+++ ipmitool-1.8.19/debian/patches/0802-fix-temp-read-parameters.patch  
2024-10-18 16:52:09.000000000 +0800
@@ -0,0 +1,59 @@
+From ab5ce5baff097ebb6e2a17a171858be213ee68d3 Mon Sep 17 00:00:00 2001
+From: Thang Tran <[email protected]>
+Date: Tue, 11 Jul 2023 17:27:12 +0700
+Subject: [PATCH] dcmi: update parameters to read temperature sensors
+
+Issue:
+When the system has number of CPU temperature sensors more than 8,
+"ipmitool dcmi get_temp_reading" can not show all of sensors.
+
+Root cause:
+To request to read multiple sensors for each message, ipmitool has to
+send "Get Temperature Readings" command with the "Entity Instance" always
+0 and the "Entity Instance Start" as the offset. But the current code is
+sending "Entity Instance" is offset and "Entity Instance Start" always is
+0. It makes ipmitool only read 1 sensor each time. Besides that, the
+"Entity Instance Start" value starts from 1 (not 0), therefore, the
+initialization has to be set to 1.
+
+Solution:
+This commit corrects the order of parameters and the initialization of
+"Entity Instance Start" byte.
+
+Resolves ipmitool/ipmitool#3
+
+Tested:
+1. Update BMC software to support 24 CPU temperature sensors
+2. Request to read the temperature sensors
+$ipmitool dcmi get_temp_reading
+3. Display full 24 CPU temperature sensors.
+
+Signed-off-by: Thang Tran <[email protected]>
+Forwarded: not-needed
+Applied-Upstream: 
https://codeberg.org/IPMITool/ipmitool/commit/ab5ce5baff097ebb6e2a17a171858be213ee68d3
+---
+ lib/ipmi_dcmi.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/ipmi_dcmi.c b/lib/ipmi_dcmi.c
+index 8ed87a9..8cf6d66 100644
+--- a/lib/ipmi_dcmi.c
++++ b/lib/ipmi_dcmi.c
+@@ -1595,7 +1595,7 @@ ipmi_dcmi_prnt_get_temp_readings(struct ipmi_intf * intf)
+                       continue;
+               }
+               /* Total number of available instances for the Entity ID */
+-              offset = 0;
++              offset = 1;
+               tota_inst = rsp->data[1];
+               while (tota_inst > 0) {
+                       get_inst = ((tota_inst / DCMI_MAX_BYTE_TEMP_READ_SIZE) ?
+@@ -1603,7 +1603,7 @@ ipmi_dcmi_prnt_get_temp_readings(struct ipmi_intf * intf)
+                                   (tota_inst % DCMI_MAX_BYTE_TEMP_READ_SIZE));
+                       rsp = ipmi_dcmi_get_temp_readings(intf,
+                                                         
dcmi_temp_read_vals[i].val,
+-                                                        offset, 0);
++                                                        0, offset);
+                       if (chk_rsp(rsp)) {
+                               continue;
+                       }
diff -Nru ipmitool-1.8.19/debian/patches/series 
ipmitool-1.8.19/debian/patches/series
--- ipmitool-1.8.19/debian/patches/series       2023-12-17 19:29:04.000000000 
+0800
+++ ipmitool-1.8.19/debian/patches/series       2024-10-18 16:49:37.000000000 
+0800
@@ -6,3 +6,6 @@
 0110-unpdate_IANA_URL.patch
 0115-hurd_PATH_MAX.patch
 0625-manpage_wrong_time_set.patch
+0800-fix-buffer-overrun.patch
+0801-fix-lan-print-fails-on-unsupported-parameters.patch
+0802-fix-temp-read-parameters.patch

Reply via email to