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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230421013850.349646-2-saeed@kernel.org>
Date:   Thu, 20 Apr 2023 18:38:36 -0700
From:   Saeed Mahameed <saeed@...nel.org>
To:     "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Eric Dumazet <edumazet@...gle.com>
Cc:     Saeed Mahameed <saeedm@...dia.com>, netdev@...r.kernel.org,
        Tariq Toukan <tariqt@...dia.com>,
        Yevgeny Kliteynik <kliteyn@...dia.com>
Subject: [net-next 01/15] net/mlx5: DR, Fix dumping of legacy modify_hdr in debug dump

From: Yevgeny Kliteynik <kliteyn@...dia.com>

The steering dump parser expects to see 0 as rewrite num of actions
in case pattern/args aren't supported - parsing of legacy modify header
is based on this assumption.
Fix this to align to parser's expectation.

Signed-off-by: Yevgeny Kliteynik <kliteyn@...dia.com>
Signed-off-by: Saeed Mahameed <saeedm@...dia.com>
---
 .../net/ethernet/mellanox/mlx5/core/steering/dr_dbg.c  | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_dbg.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_dbg.c
index 1ff8bde90e1e..ea9f27db4c74 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_dbg.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_dbg.c
@@ -153,13 +153,15 @@ dr_dump_rule_action_mem(struct seq_file *file, const u64 rule_id,
 			   DR_DUMP_REC_TYPE_ACTION_MODIFY_HDR, action_id,
 			   rule_id, action->rewrite->index,
 			   action->rewrite->single_action_opt,
-			   action->rewrite->num_of_actions,
+			   ptrn_arg ? action->rewrite->num_of_actions : 0,
 			   ptrn_arg ? ptrn->index : 0,
 			   ptrn_arg ? mlx5dr_arg_get_obj_id(arg) : 0);
 
-		for (i = 0; i < action->rewrite->num_of_actions; i++) {
-			seq_printf(file, ",0x%016llx",
-				   be64_to_cpu(((__be64 *)rewrite_data)[i]));
+		if (ptrn_arg) {
+			for (i = 0; i < action->rewrite->num_of_actions; i++) {
+				seq_printf(file, ",0x%016llx",
+					   be64_to_cpu(((__be64 *)rewrite_data)[i]));
+			}
 		}
 
 		seq_puts(file, "\n");
-- 
2.39.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ