Compare commits
10 Commits
e3ae1f8234
...
62d79babcc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
62d79babcc | ||
|
|
286c71bcdd | ||
|
|
14b9b04d40 | ||
|
|
6b4bedbcda | ||
|
|
b3062b5401 | ||
|
|
9facb23c6f | ||
|
|
c8fc5e5387 | ||
|
|
5dc15d9cbe | ||
|
|
529c040a6d | ||
|
|
01616b403e |
@ -0,0 +1,60 @@
|
||||
From 3bbce8a171deab6cd3d7d57d128bc2dbaea451f0 Mon Sep 17 00:00:00 2001
|
||||
From: Xin Long <lucien.xin@gmail.com>
|
||||
Date: Fri, 15 Apr 2022 11:41:39 -0400
|
||||
Subject: [PATCH] libteamdctl: validate the bus name before using it
|
||||
|
||||
Using bus name without validating it will cause core dump generated,
|
||||
and it can be reproduced by:
|
||||
|
||||
# ip link add dummy0.1 type dummy
|
||||
# teamdctl dummy0.1 state dump
|
||||
|
||||
This is normally a bug in some application using the D-Bus library.
|
||||
|
||||
D-Bus not built with -rdynamic so unable to print a backtrace
|
||||
Aborted (core dumped)
|
||||
|
||||
Doing this many times can even create too many core files, customers
|
||||
may complain about it.
|
||||
|
||||
This is triggered when calling cli_method_call("ConfigDump") in
|
||||
cli_init(), so fix it by returning err in cli->init/cli_dbus_init()
|
||||
if the bus name fails to validate.
|
||||
|
||||
Note this is safe, as with dbus, we can't use invalid dbus name to
|
||||
create the team dev either.
|
||||
|
||||
Fixes: d8163e34c25c ("libteamdctl: do test method call instead or Introspect call")
|
||||
Reported-by: Uday Patel <upatel@redhat.com>
|
||||
Signed-off-by: Xin Long <lucien.xin@gmail.com>
|
||||
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
|
||||
---
|
||||
libteamdctl/cli_dbus.c | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libteamdctl/cli_dbus.c b/libteamdctl/cli_dbus.c
|
||||
index dfef5c4..242ef86 100644
|
||||
--- a/libteamdctl/cli_dbus.c
|
||||
+++ b/libteamdctl/cli_dbus.c
|
||||
@@ -183,12 +183,17 @@ static int cli_dbus_init(struct teamdctl *tdc, const char *team_name, void *priv
|
||||
if (ret == -1)
|
||||
return -errno;
|
||||
|
||||
+ err = -EINVAL;
|
||||
dbus_error_init(&error);
|
||||
+ if (!dbus_validate_bus_name(cli_dbus->service_name, &error)) {
|
||||
+ err(tdc, "dbus: Could not validate bus name: %s - %s",
|
||||
+ error.name, error.message);
|
||||
+ goto free_service_name;
|
||||
+ }
|
||||
cli_dbus->conn = dbus_bus_get(DBUS_BUS_SYSTEM, &error);
|
||||
if (!cli_dbus->conn) {
|
||||
err(tdc, "dbus: Could not acquire the system bus: %s - %s",
|
||||
error.name, error.message);
|
||||
- err = -EINVAL;
|
||||
goto free_service_name;
|
||||
}
|
||||
err = 0;
|
||||
--
|
||||
2.20.1
|
||||
|
||||
@ -0,0 +1,54 @@
|
||||
From 61efd6de2fbb8ee077863ee5a355ac3dfd9365b9 Mon Sep 17 00:00:00 2001
|
||||
From: Xin Long <lucien.xin@gmail.com>
|
||||
Date: Tue, 1 Sep 2020 13:59:27 +0800
|
||||
Subject: [PATCH] Revert "teamd: Disregard current state when considering port
|
||||
enablement"
|
||||
|
||||
This reverts commit deadb5b715227429a1879b187f5906b39151eca9.
|
||||
|
||||
As Patrick noticed, with that commit, teamd_port_check_enable()
|
||||
would set the team port to the new state unconditionally, which
|
||||
triggers another change message from kernel to userspace, then
|
||||
teamd_port_check_enable() is called again to set the team port
|
||||
to the new state.
|
||||
|
||||
This would go around and around to update the team port state,
|
||||
and even cause teamd to consume 100% cpu.
|
||||
|
||||
As the issue caused by that commit is serious, it has to be
|
||||
reverted. As for the issued fixed by that commit, I would
|
||||
propose a new fix later.
|
||||
|
||||
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
|
||||
---
|
||||
teamd/teamd_per_port.c | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/teamd/teamd_per_port.c b/teamd/teamd_per_port.c
|
||||
index 166da57..d429753 100644
|
||||
--- a/teamd/teamd_per_port.c
|
||||
+++ b/teamd/teamd_per_port.c
|
||||
@@ -442,14 +442,18 @@ int teamd_port_check_enable(struct teamd_context *ctx,
|
||||
bool should_enable, bool should_disable)
|
||||
{
|
||||
bool new_enabled_state;
|
||||
+ bool curr_enabled_state;
|
||||
int err;
|
||||
|
||||
if (!teamd_port_present(ctx, tdport))
|
||||
return 0;
|
||||
+ err = teamd_port_enabled(ctx, tdport, &curr_enabled_state);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
|
||||
- if (should_enable)
|
||||
+ if (!curr_enabled_state && should_enable)
|
||||
new_enabled_state = true;
|
||||
- else if (should_disable)
|
||||
+ else if (curr_enabled_state && should_disable)
|
||||
new_enabled_state = false;
|
||||
else
|
||||
return 0;
|
||||
--
|
||||
2.33.0
|
||||
|
||||
34
libteam-fix-error-options-in-doc.patch
Normal file
34
libteam-fix-error-options-in-doc.patch
Normal file
@ -0,0 +1,34 @@
|
||||
From ce8bc85cbca8abe4928c25d2eb8e302e0577308f Mon Sep 17 00:00:00 2001
|
||||
From: yixiangzhike <yixiangzhike007@163.com>
|
||||
Date: Thu, 8 Sep 2022 19:30:36 +0800
|
||||
Subject: [PATCH] fix error options in doc
|
||||
|
||||
---
|
||||
man/teamd.8 | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/man/teamd.8 b/man/teamd.8
|
||||
index 3d27eae..59ddbfc 100644
|
||||
--- a/man/teamd.8
|
||||
+++ b/man/teamd.8
|
||||
@@ -31,7 +31,7 @@ teamd \(em team network device control daemon
|
||||
.IR address ]
|
||||
.br
|
||||
.B teamd
|
||||
-.BR \-h | \-V
|
||||
+.BR \-h | \-v
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
teamd is a daemon to control a given team network device, during runtime,
|
||||
@@ -44,7 +44,7 @@ libteam project.
|
||||
.B "\-h, \-\-help"
|
||||
Print help text to console and exit.
|
||||
.TP
|
||||
-.B "\-V, \-\-version"
|
||||
+.B "\-v, \-\-version"
|
||||
Print version information to console and exit.
|
||||
.TP
|
||||
.B "\-d, \-\-daemonize"
|
||||
--
|
||||
2.27.0
|
||||
|
||||
22
libteam.spec
22
libteam.spec
@ -1,11 +1,15 @@
|
||||
Name: libteam
|
||||
Version: 1.31
|
||||
Release: 1
|
||||
Release: 5
|
||||
Summary: User-space counterpart library for team network
|
||||
License: LGPLv2+
|
||||
URL: http://www.libteam.org
|
||||
Source: http://www.libteam.org/files/libteam-%{version}.tar.gz
|
||||
|
||||
Patch0: libteam-fix-error-options-in-doc.patch
|
||||
Patch1: backport-revert-teamd-Disregard-current-state-when-considerin.patch
|
||||
Patch2: backport-libteamdctl-validate-the-bus-name-before-using-it.patch
|
||||
|
||||
BuildRequires: gcc jansson-devel libdaemon-devel libnl3-devel
|
||||
BuildRequires: swig dbus-devel systemd doxygen
|
||||
|
||||
@ -105,7 +109,6 @@ install -p -m 755 utils/bond2team $RPM_BUILD_ROOT%{_bindir}/bond2team
|
||||
%doc _tmpdoc1/examples
|
||||
%doc doc/api
|
||||
%doc teamd/example_configs teamd/redhat/example_ifcfgs/
|
||||
%doc _tmpdoc2/examples
|
||||
%{_mandir}/man1/bond2team.1*
|
||||
%{_mandir}/man5/teamd.conf.5*
|
||||
%{_mandir}/man8/teamd.8*
|
||||
@ -113,13 +116,26 @@ install -p -m 755 utils/bond2team $RPM_BUILD_ROOT%{_bindir}/bond2team
|
||||
%{_mandir}/man8/teamnl.8*
|
||||
|
||||
%changelog
|
||||
* Wed Apr 23 2025 Yu Peng <yupeng@kylinos.cn> - 1.31-5
|
||||
- sync community patches:
|
||||
backport-libteamdctl-validate-the-bus-name-before-using-it.patch
|
||||
|
||||
* Fri Nov 01 2024 xuguangmin <xuguangmin@kylinos.cn> - 1.31-4
|
||||
- List non-existent files.
|
||||
|
||||
* Thu Sep 21 2023 zhangruifang <zhangruifang1@h-partners.com> - 1.31-3
|
||||
- fix an issue about teamd is using 100% cpu usage (of 1 core)
|
||||
|
||||
* Thu Sep 8 2022 yixiangzhike <yixiangzhike007@163.com> - 1.31-2
|
||||
- fix error options in doc
|
||||
|
||||
* Thu Jan 21 2021 wangchen <wangchen137@huawei.com> - 1.31-1
|
||||
- Update to 1.31
|
||||
|
||||
* Thu Oct 29 2020 wangchen <wangchen137@huawei.com> - 1.30-2
|
||||
- Remove python2
|
||||
|
||||
*Thu Jul 16 2020 Hugel <gengqihu1@huawei.com> - 1.30-1
|
||||
* Thu Jul 16 2020 Hugel <gengqihu1@huawei.com> - 1.30-1
|
||||
- Type:enhancement
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user