lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1669962342-2806-1-git-send-email-tee.min.tan@linux.intel.com>
Date:   Fri,  2 Dec 2022 14:25:42 +0800
From:   Tan Tee Min <tee.min.tan@...ux.intel.com>
To:     netdev@...r.kernel.org
Cc:     David Ahern <dsahern@...nel.org>,
        Stephen Hemminger <stephen@...workplumber.org>,
        Vladimir Oltean <vladimir.oltean@....com>,
        Vinicius Costa Gomes <vinicius.gomes@...el.com>,
        Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@...el.com>
Subject: [PATCH iproute2-next 1/1] taprio: fix wrong for loop condition in add_tc_entries()

The for loop in add_tc_entries() mistakenly included the last entry
index+1. Fix it to correctly loop the max_sdu entry between tc=0 and
num_max_sdu_entries-1.

Fixes: b10a6509c195 ("taprio: support dumping and setting per-tc max SDU")
Signed-off-by: Tan Tee Min <tee.min.tan@...ux.intel.com>
---
 tc/q_taprio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tc/q_taprio.c b/tc/q_taprio.c
index ded385ca..a7c01ae0 100644
--- a/tc/q_taprio.c
+++ b/tc/q_taprio.c
@@ -157,7 +157,7 @@ static void add_tc_entries(struct nlmsghdr *n, __u32 max_sdu[TC_QOPT_MAX_QUEUE],
 	struct rtattr *l;
 	__u32 tc;
 
-	for (tc = 0; tc <= num_max_sdu_entries; tc++) {
+	for (tc = 0; tc < num_max_sdu_entries; tc++) {
 		l = addattr_nest(n, 1024, TCA_TAPRIO_ATTR_TC_ENTRY | NLA_F_NESTED);
 
 		addattr_l(n, 1024, TCA_TAPRIO_TC_ENTRY_INDEX, &tc, sizeof(tc));
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ