Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
62d79babcc
!48 [sync] PR-46: libteamdctl: validate the bus name before using it.
From: @openeuler-sync-bot 
Reviewed-by: @hubin95 
Signed-off-by: @hubin95
2025-04-23 10:00:49 +00:00
roy
286c71bcdd libteamdctl: validate the bus name before using it.
(cherry picked from commit 9da8cd62c7af6b2428e3fdc1a28455cda4d8c0b6)
2025-04-23 17:35:38 +08:00
openeuler-ci-bot
14b9b04d40
!43 [sync] PR-41: Fix list non-existent files.
From: @openeuler-sync-bot 
Reviewed-by: @dillon_chen 
Signed-off-by: @dillon_chen
2024-11-13 07:49:21 +00:00
xuguangmin
6b4bedbcda List non-existent files.
(cherry picked from commit 721efba956b8fc7a0072905596ca8cf6b43e7c13)
2024-11-04 17:50:58 +08:00
openeuler-ci-bot
b3062b5401
!21 [sync] PR-18: 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-09-21 03:34:30 +00:00
zhangruifang2020
9facb23c6f fix an issue about teamd is using 100% cpu usage(of 1 core)
(cherry picked from commit 7a60e458e631caa63a01012e0b3a04390dd4066e)
2023-09-21 10:01:29 +08:00
openeuler-ci-bot
c8fc5e5387
!16 libteam: add missing space in changelog
From: @chenmaodong 
Reviewed-by: @xiezhipeng1 
Signed-off-by: @xiezhipeng1
2022-12-28 02:52:16 +00:00
chenmaodong
5dc15d9cbe libteam: add missing space in changelog
Signed-off-by: chenmaodong <chenmaodong@xfusion.com>
2022-12-27 17:45:28 +08:00
openeuler-ci-bot
529c040a6d
!10 【openEuler-22.03-LTS-Next】Fix error options in doc
From: @yixiangzhike 
Reviewed-by: @lvying6 
Signed-off-by: @lvying6
2022-09-09 02:18:57 +00:00
yixiangzhike
01616b403e fix error options in doc
Signed-off-by: yixiangzhike <yixiangzhike007@163.com>
2022-09-08 19:50:10 +08:00
4 changed files with 167 additions and 3 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.20.1

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

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