Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
f59dabe549
!32 [sync] PR-30: 更新spec中url地址
From: @openeuler-sync-bot 
Reviewed-by: @robertxw 
Signed-off-by: @robertxw
2023-06-26 06:17:05 +00:00
mengkanglai
604c8652e6 update URL address
Signed-off-by: mengkanglai <mengkanglai2@huawei.com>
(cherry picked from commit e6c987b7e6cbcdbc44452d5594afec83a8b83e9c)
2023-06-26 11:34:24 +08:00
openeuler-ci-bot
4832475676
!24 [sync] PR-23: ipmitool回合上游补丁
From: @openeuler-sync-bot 
Reviewed-by: @seuzw 
Signed-off-by: @seuzw
2023-03-21 13:25:54 +00:00
mengkanglai
4d40234be1 lan channel fix set alert on off and lanplus realloc the msg if the payload_length gets update
(cherry picked from commit cdeefedcdb63a844175c000466cdb18418e908a6)
2023-03-21 16:45:21 +08:00
openeuler-ci-bot
43154f9f20
!22 [sync] PR-21: 修复结构体ipmi_recv recv未初始化
From: @openeuler-sync-bot 
Reviewed-by: @seuzw 
Signed-off-by: @seuzw
2022-10-31 06:38:11 +00:00
mengkanglai
5bbfa7c3f4 zero initialize the recv structure on the stack
(cherry picked from commit 72a441cc1cc93c71df731319b9ae416d7d6a2e2f)
2022-10-31 14:31:50 +08:00
openeuler-ci-bot
5e07f078c4 !13 separate exchange-bmc-os-info,bmc-snmp-proxy from ipmitool
Merge pull request !13 from eaglegai/openEuler-22.03-LTS-Next
2021-12-28 01:51:34 +00:00
eaglegai
48c7696958 separate exchange-bmc-os-info,bmc-snmp-proxy from ipmitool 2021-12-27 20:03:54 +08:00
openeuler-ci-bot
2345ad5de2 !11 ipmitool delete -S git from %autosetup, and delete BuildRequires git
From: @chenyanpanHW
Reviewed-by: @zengwefeng
Signed-off-by: @zengwefeng
2021-08-02 02:06:15 +00:00
chenyanpanHW
e39434861d
delete -S git from %autosetup, and delete BuildRequires git 2021-07-30 22:53:51 +08:00
4 changed files with 248 additions and 13 deletions

View File

@ -0,0 +1,26 @@
From 5ac7f6a54e0a416fc37e962c2be87b16821cc771 Mon Sep 17 00:00:00 2001
From: Patrick Venture <pstrinkle@users.noreply.github.com>
Date: Wed, 3 Nov 2021 14:10:53 -0700
Subject: [PATCH] zero initialize the recv structure on the stack
Zero initialize the recv structure used by openipmi_read().
---
src/ipmievd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/ipmievd.c b/src/ipmievd.c
index 2c19887..6a94b1f 100644
--- a/src/ipmievd.c
+++ b/src/ipmievd.c
@@ -422,7 +422,7 @@ static int
openipmi_read(struct ipmi_event_intf * eintf)
{
struct ipmi_addr addr;
- struct ipmi_recv recv;
+ struct ipmi_recv recv = {};
uint8_t data[80];
int rv;
--
2.25.1

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: 16
Release: 21
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
@ -13,6 +13,7 @@ Patch1: 0001-CVE-2011-4339-OpenIPMI.patch
Patch2: 0002-openssl.patch
Patch3: 0003-ipmitool-1.8.11-set-kg-key.patch
Patch4: 0004-slowswid.patch
Patch5: 0005-zero-initialize-the-recv-structure-on-the-stack.patch
Patch6000: ID-477-fru-Fix-decoding-of-non-text-data-in-get_fru_.patch
Patch6001: ID-480-ipmitool-coredumps-in-EVP_CIPHER_CTX_init.patch
@ -42,25 +43,50 @@ 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: fix-variable-definition-error-with-gcc-10.patch
Patch6027: backport-lanplus-Realloc-the-msg-if-the-payload_length-gets-u.patch
Patch6028: backport-lan-channel-Fix-set-alert-on-off.patch
BuildRequires: openssl-devel readline-devel ncurses-devel git
BuildRequires: openssl-devel readline-devel ncurses-devel
%{?systemd_requires}
BuildRequires: systemd
BuildRequires: automake autoconf libtool
Requires: net-snmp hostname
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
%autosetup -n %{name}-%{version} -p1 -S git
%autosetup -n %{name}-%{version} -p1
for f in AUTHORS ChangeLog; do
iconv -f iso-8859-1 -t utf8 < ${f} > ${f}.utf8
@ -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
* Wed May 31 2023 mengkanglai <mengkanglai2@huawei.com> - 1.8.18-21
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:update URL address
* Tue Mar 21 2023 mengkanglai <mengkanglai2@huawei.com> - 1.8.18-20
- 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 Oct 31 2022 mengkanglai <mengkanglai2@huawei.com> - 1.8.18-19
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:zero initialize the recv structure on the stack
* Mon Dec 27 2021 gaihuiying <gaihuiying1@huawei.com> - 1.8.18-18
- Type:requirement
- ID:NA
- SUG:NA
- DESC:separate exchange-bmc-os-info,bmc-snmp-proxy from ipmitool
* Fri Jul 30 2021 chenyanpanHW <chenyanpan@huawei.com> - 1.8.18-17
- DESC: delete -S git from %autosetup, and delete BuildRequires git
* Fri Jul 30 2021 gaihuiying <gaihuiying1@huawei.com> - 1.8.18-16
- Type:bugfix
- Id:NA