Compare commits

...

12 Commits

Author SHA1 Message Date
openeuler-ci-bot
8c1aa3e32b
!47 libteamdctl: validate the bus name before using it.
From: @fly_fzc 
Reviewed-by: @hubin95 
Signed-off-by: @hubin95
2025-04-23 09:35:52 +00:00
fly_fzc
c813718ed8 libteamdctl: validate the bus name before using it. 2025-04-23 17:07:08 +08:00
openeuler-ci-bot
19b27f8e76
!26 [sync] PR-24: fix an issue about teamd is using 100% cpu usage (of 1 core)
From: @openeuler-sync-bot 
Reviewed-by: @ziyangc 
Signed-off-by: @ziyangc
2023-10-11 08:43:39 +00:00
fly_fzc
7884361172 fix an issue about teamd is using 100% cpu usage (of 1 core)
(cherry picked from commit d6e81333025ffdf9d224d52bae5b67b7ef0835b7)
2023-10-11 16:20:04 +08:00
openeuler-ci-bot
5206ccebc8
!13 【openEuler-20.03-LTS-SP3】Fix error options in doc
From: @yixiangzhike 
Reviewed-by: @lvying6 
Signed-off-by: @lvying6
2022-09-09 02:20:10 +00:00
yixiangzhike
d61b1150f8 fix error options in doc
Signed-off-by: yixiangzhike <yixiangzhike007@163.com>
2022-09-09 08:54:47 +08:00
openeuler-ci-bot
8da2dae04f !6 upgrade libteam to 1.30 on branch 20.03-LTS
Merge pull request !6 from Sdrkun/openEuler-20.03-LTS
2020-08-10 09:51:47 +08:00
Sdrkun
b7a2430070 upgrade libteam to 1.30. 2020-08-07 15:32:59 +08:00
openeuler-ci-bot
7a8846a70a !3 libteam
Merge pull request !3 from syyhao/init
2020-01-15 01:21:35 +08:00
openeuler-basic
2796419f41 delete unneeded obsoletes with isa 2020-01-14 23:30:53 +08:00
openeuler-ci-bot
28bf82f7d1 !2 libteam
Merge pull request !2 from openeuler-basic/init
2019-12-27 17:07:10 +08:00
openeuler-ci-bot
8b8ae222a0 !1 libteam
Merge pull request !1 from openeuler-basic/init
2019-12-26 11:12:06 +08:00
6 changed files with 172 additions and 4 deletions

View File

@ -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.43.0

View File

@ -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

Binary file not shown.

BIN
libteam-1.30.tar.gz Normal file

Binary file not shown.

View 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

View File

@ -1,16 +1,20 @@
Name: libteam
Version: 1.27
Release: 13
Version: 1.30
Release: 4
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 python2-devel dbus-devel systemd doxygen
Provides: teamd = %{version}-%{release} teamd%{?_isa} = %{version}-%{release}
Obsoletes: teamd < %{version}-%{release} teamd%{?_isa} < %{version}-%{release}
Obsoletes: teamd < %{version}-%{release}
%description
This package is the user-space counterpart for the team network
@ -20,7 +24,7 @@ driver, and provides an API to control them.
Summary : The devel for %{name}
Requires: %{name} = %{version}-%{release}
Provides: teamd-devel = %{version}-%{release} teamd-devel%{?_isa} = %{version}-%{release}
Obsoletes: teamd-devel < %{version}-%{release} teamd-devel%{?_isa} < %{version}-%{release}
Obsoletes: teamd-devel < %{version}-%{release}
%description devel
Libraries and header files for libteam development
@ -136,6 +140,22 @@ popd
%{_mandir}/man8/teamnl.8*
%changelog
* Wed Apr 23 2025 fuanan <fuanan3@h-partners.com> - 1.30-4
- sync community patch:
backport-libteamdctl-validate-the-bus-name-before-using-it.patch
* Wed Oct 11 2023 fuanan <fuanan3@h-partners.com> - 1.30-3
- fix an issue about teamd is using 100% cpu usage (of 1 core)
* Fri Sep 9 2022 yixiangzhike <yixiangzhike007@163.com> - 1.30-2
- fix error options in doc
* Tue Aug 04 2020 shanzhikun <shanzhikun@huawei.com> - 1.30-1
- upgrade libteam to 1.30.
* Tue Jan 14 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.27-14
- Delete unneeded obsoletes with isa
* Fri Dec 27 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.27-13
- Add oboselets