Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
0500f9cb55
!35 更新spec中url地址
From: @klmengkd 
Reviewed-by: @robertxw 
Signed-off-by: @robertxw
2023-06-26 06:17:54 +00:00
mengkanglai
654709c336 update URL address 2023-06-26 11:44:43 +08:00
openeuler-ci-bot
40d5b0bc5c
!27 ipmitool回合上游补丁
From: @klmengkd 
Reviewed-by: @seuzw 
Signed-off-by: @seuzw
2023-03-21 13:25:39 +00:00
mengkanglai
71df5364cb lan channel fix set alert on off and lanplus realloc the msg if the payload_length gets update 2023-03-21 17:48:03 +08:00
openeuler-ci-bot
ea505501be
!14 [sync] PR-12: move exchange-bmc-os-info,bmc-snmp-proxy to separate subpackages from ipmitool
From: @openeuler-sync-bot 
Reviewed-by: @seuzw 
Signed-off-by: @seuzw
2022-07-27 09:11:59 +00:00
haochenstar
a5bee47793 move exchange-bmc-os-info,bmc-snmp-proxy to separate subpackages from ipmitool
(cherry picked from commit 20515fa12b71573cde7cee176c53306d1356f0c6)
2022-07-27 16:39:56 +08:00
openeuler-ci-bot
92de639359 !9 [sync] PR-8: rebuild ipmitool for update
From: @openeuler-sync-bot
Reviewed-by: @zengwefeng
Signed-off-by: @zengwefeng
2021-03-08 09:48:46 +08:00
jzm369
c7e0ba3d8b rebuild ipmitool
(cherry picked from commit 44c4653d7dcbd606cdd251c37d0bd9cb401feccc)
2021-03-05 19:33:57 +08:00
openeuler-ci-bot
1e5ac92685 !6 在 ipmitool主包中添加help包的依赖
From: @quanhongfei
Reviewed-by: @zengwefeng
Signed-off-by: @zengwefeng
2020-11-09 20:11:30 +08:00
quanhongfei
1960989075 add ipmitool-help dependency for ipmitool 2020-11-09 15:16:28 +08:00
3 changed files with 220 additions and 11 deletions

View File

@ -0,0 +1,69 @@
From 4b791f8bf67ef9134699039b2758ed4023409621 Mon Sep 17 00:00:00 2001
From: Alexander Amelkin <alexander@amelkin.msk.ru>
Date: Tue, 20 Oct 2020 17:15:59 +0300
Subject: [PATCH] lan: channel: Fix set alert on/off
From IPMI Spec, Chapter 22.22 Set Channel Access Command
Table 22, Set Channel Access Command
Byte#2, Bit#5 is "PEF Alerting Enable/Disable"
And the bit value:
0b = enable PEF Alerting
1b = disable PEF Alerting on this channel
In current code, alert "on" set Bit#5 to 1 and alert "off" set Bit#5 to
0, it's straightforward but just opposite of IPMI spec bit definition.
Resolves ipmitool/ipmitool#247
Reported-by: Ryan Fang <Ryan.Fang@quantatw.com>
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
---
include/ipmitool/ipmi_channel.h | 10 ++++++++--
lib/ipmi_lanp.c | 6 +++---
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/include/ipmitool/ipmi_channel.h b/include/ipmitool/ipmi_channel.h
index d9be57e..41f1b88 100644
--- a/include/ipmitool/ipmi_channel.h
+++ b/include/ipmitool/ipmi_channel.h
@@ -89,10 +89,16 @@ struct channel_info_t {
uint8_t aux_info[2];
};
-/* (22.23) Get Channel Access */
+
+/* (22.22 / 22.23) Set/Get Channel Access */
+typedef enum {
+ ALERTING_ENABLED = 0,
+ ALERTING_DISABLED = (1 << 5) /* See Table 22 */
+} alerting_t;
+
struct channel_access_t {
uint8_t access_mode;
- uint8_t alerting;
+ alerting_t alerting;
uint8_t channel;
uint8_t per_message_auth;
uint8_t privilege_limit;
diff --git a/lib/ipmi_lanp.c b/lib/ipmi_lanp.c
index 16c0d9a..fe0046f 100644
--- a/lib/ipmi_lanp.c
+++ b/lib/ipmi_lanp.c
@@ -1026,10 +1026,10 @@ ipmi_set_alert_enable(struct ipmi_intf *intf, uint8_t channel, uint8_t enable)
channel);
return (-1);
}
- if (enable != 0) {
- channel_access.alerting = 1;
+ if (enable) {
+ channel_access.alerting = ALERTING_ENABLED;
} else {
- channel_access.alerting = 0;
+ channel_access.alerting = ALERTING_DISABLED;
}
/* non-volatile */
ccode = _ipmi_set_channel_access(intf, channel_access, 1, 0);
--
2.27.0

View File

@ -0,0 +1,72 @@
From 8f0946a81eb22c14823d726afc486139bb2094ca Mon Sep 17 00:00:00 2001
From: Tom Tung <shes050117@gmail.com>
Date: Fri, 12 Aug 2022 16:47:27 +0800
Subject: [PATCH] lanplus: Realloc the msg if the payload_length gets updated
It's possible the payload_length gets updated in
lanplus_encrypt_payload. If it's updated, the memory of msg should be
updated.
Tested: use ipmitool with lanplus with similar STR and there is no
memory stomping issue.
Resolved: ipmitool/ipmitool#351
Signed-off-by: Tom Tung <shes050117@gmail.com>
---
src/plugins/lanplus/lanplus.c | 19 +++++++++++++++++++
src/plugins/lanplus/lanplus.h | 2 ++
2 files changed, 21 insertions(+)
diff --git a/src/plugins/lanplus/lanplus.c b/src/plugins/lanplus/lanplus.c
index ed41380..7a9162c 100644
--- a/src/plugins/lanplus/lanplus.c
+++ b/src/plugins/lanplus/lanplus.c
@@ -1727,6 +1727,7 @@ ipmi_lanplus_build_v2x_msg(
*/
if (session->v2_data.session_state == LANPLUS_STATE_ACTIVE)
{
+ uint16_t old_payload_length = payload->payload_length;
/* Payload len is adjusted as necessary by lanplus_encrypt_payload */
lanplus_encrypt_payload(session->v2_data.crypt_alg, /* input */
session->v2_data.k2, /* input */
@@ -1735,6 +1736,24 @@ ipmi_lanplus_build_v2x_msg(
msg + IPMI_LANPLUS_OFFSET_PAYLOAD, /* output */
&(payload->payload_length)); /* output */
+ if (old_payload_length != payload->payload_length)
+ {
+ len =
+ IPMI_LANPLUS_OFFSET_PAYLOAD +
+ payload->payload_length +
+ IPMI_MAX_INTEGRITY_PAD_SIZE +
+ IPMI_LANPLUS_PAD_LENGTH_SIZE +
+ IPMI_LANPLUS_NEXT_HEADER_SIZE +
+ IPMI_MAX_AUTH_CODE_SIZE;
+
+ uint8_t * new_msg = realloc(msg, len);
+ if (!new_msg) {
+ free(msg);
+ lprintf(LOG_ERR, "ipmitool: realloc failure");
+ return;
+ }
+ msg = new_msg;
+ }
}
/* Now we know the payload length */
diff --git a/src/plugins/lanplus/lanplus.h b/src/plugins/lanplus/lanplus.h
index 3e287ae..94bd56a 100644
--- a/src/plugins/lanplus/lanplus.h
+++ b/src/plugins/lanplus/lanplus.h
@@ -86,6 +86,8 @@
#define IPMI_LANPLUS_OFFSET_PAYLOAD_SIZE 0x0E
#define IPMI_LANPLUS_OFFSET_PAYLOAD 0x10
+#define IPMI_LANPLUS_PAD_LENGTH_SIZE 1
+#define IPMI_LANPLUS_NEXT_HEADER_SIZE 1
#define IPMI_GET_CHANNEL_AUTH_CAP 0x38
--
2.27.0

View File

@ -1,9 +1,9 @@
Name: ipmitool
Version: 1.8.18
Release: 14
Release: 19
Summary: Utility for IPMI control
License: BSD
URL: http://ipmitool.sourceforge.net/
URL: https://codeberg.org/IPMITool/ipmitool
Source0: http://downloads.sourceforge.net/project/%{name}/%{name}/%{version}/%{name}-%{version}.tar.bz2
Source1: ipmievd.sysconf
Source2: ipmievd.service
@ -42,21 +42,47 @@ Patch6022: ipmitool-CVE-2020-5208-Fix-buffer-overflow-in-ipmi_get_session_
Patch6023: ipmitool-CVE-2020-5208-Fix-buffer-overflow.patch
Patch6024: ipmitool-CVE-2020-5208-Fix-buffer-overflows-in-get_lan_param_select.patch
Patch6025: ipmitool-CVE-2020-5208-Fix-id_string-buffer-overflows.patch
Patch6026: backport-lanplus-Realloc-the-msg-if-the-payload_length-gets-u.patch
Patch6027: backport-lan-channel-Fix-set-alert-on-off.patch
BuildRequires: openssl-devel readline-devel ncurses-devel git
%{?systemd_requires}
BuildRequires: systemd
BuildRequires: automake autoconf libtool
Requires: net-snmp hostname
Requires: %{name}-help
Obsoletes: OpenIPMI-tools < 2.0.14-3
Provides: OpenIPMI-tools = 2.0.14-3
Obsoletes: ipmievd bmc-snmp-proxy exchange-bmc-os-info
Provides: ipmievd bmc-snmp-proxy exchange-bmc-os-info
Obsoletes: ipmievd
Provides: ipmievd
%description
This package provides a simple command-line interface to IPMI-enabled devices
through an IPMIv1.5 or IPMIv2.0 LAN interface or Linux/Solaris kernel driver.
%package -n bmc-snmp-proxy
Requires: net-snmp
Requires: exchange-bmc-os-info
BuildArch: noarch
Summary: Reconfigure SNMP to include host SNMP agent within BMC
%description -n bmc-snmp-proxy
Given a host with BMC, this package would extend system configuration
of net-snmp to include redirections to BMC based SNMP.
%package -n exchange-bmc-os-info
Requires: hostname
Requires: ipmitool
BuildArch: noarch
%{?systemd_requires}
BuildRequires: systemd
Summary: Let OS and BMC exchange info
%description -n exchange-bmc-os-info
Given a host with BMC, this package would pass the hostname &
OS information to the BMC and also capture the BMC ip info
for the host OS to use.
%package_help
%prep
@ -99,14 +125,20 @@ install -Dm 755 contrib/bmc-snmp-proxy %{buildroot}%{_libexecdir}/bmc-sn
%post
%systemd_post ipmievd.service
%systemd_post exchange-bmc-os-info.service
%preun
%systemd_preun ipmievd.service
%systemd_preun exchange-bmc-os-info.service
%postun
%systemd_postun_with_restart ipmievd.service
%post -n exchange-bmc-os-info
%systemd_post exchange-bmc-os-info.service
%preun -n exchange-bmc-os-info
%systemd_preun exchange-bmc-os-info.service
%postun -n exchange-bmc-os-info
%systemd_postun_with_restart exchange-bmc-os-info.service
%triggerun -- %{name}
@ -117,14 +149,23 @@ install -Dm 755 contrib/bmc-snmp-proxy %{buildroot}%{_libexecdir}/bmc-sn
%files
%doc %{_datadir}/doc/ipmitool/AUTHORS
%doc %{_datadir}/doc/ipmitool/COPYING
%config(noreplace) %{_sysconfdir}/sysconfig/*
%{_sysconfdir}/profile.d/set-bmc-url.sh
%config(noreplace) %{_sysconfdir}/sysconfig/ipmievd
%{_bindir}/ipmitool
%{_sbindir}/ipmievd
%{_unitdir}/*.service
%{_libexecdir}/*
%{_unitdir}/ipmievd.service
%{_datadir}/ipmitool
%files -n exchange-bmc-os-info
%config(noreplace) %{_sysconfdir}/sysconfig/exchange-bmc-os-info
%{_sysconfdir}/profile.d/set-bmc-url.sh
%{_unitdir}/exchange-bmc-os-info.service
%{_libexecdir}/exchange-bmc-os-info
%files -n bmc-snmp-proxy
%config(noreplace) %{_sysconfdir}/sysconfig/bmc-snmp-proxy
%{_unitdir}/bmc-snmp-proxy.service
%{_libexecdir}/bmc-snmp-proxy
%files help
%doc %{_datadir}/doc/ipmitool/README
%doc %{_datadir}/doc/ipmitool/ChangeLog
@ -132,6 +173,33 @@ install -Dm 755 contrib/bmc-snmp-proxy %{buildroot}%{_libexecdir}/bmc-sn
%{_mandir}/man8/ipmievd.8*
%changelog
* Mon Jun 26 2023 mengkanglai <mengkanglai2@huawei.com> - 1.8.18-19
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:update URL address
* Tue Mar 21 2023 mengkanglai <mengkanglai2@huawei.com> - 1.8.18-18
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:lan channel fix set alert on off and lanplus realloc the msg if the payload_length gets update
* Mon Dec 13 2021 xihaochen <xihaochen@huawei.com> - 1.8.18-17
- Type:requirement
- ID:NA
- SUG:NA
- DESC:move exchange-bmc-os-info,bmc-snmp-proxy to separate subpackages from ipmitool
* Fri Feb 19 2021 jinzhimin <jinzhimin2@huawei.com> - 1.8.18-16
- rebuild ipmitool
* Mon Nov 09 2020 quanhongfei <quanhongfei@huawei.com> - 1.8.18-15
- Type:requirement
- ID:NA
- SUG:NA
- DESC:add ipmitool-help dependency for dependency
* Fri Mar 13 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.8.18-14
- enable make check