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: <1676294058-136786-5-git-send-email-moshe@nvidia.com>
Date:   Mon, 13 Feb 2023 15:14:12 +0200
From:   Moshe Shemesh <moshe@...dia.com>
To:     "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>, Jiri Pirko <jiri@...dia.com>,
        <netdev@...r.kernel.org>
CC:     Moshe Shemesh <moshe@...dia.com>
Subject: [PATCH net-next 04/10] devlink: health: Don't try to add trace with NULL msg

In case devlink_health_report() msg argument is NULL a warning is
triggered, but then continue and try to print a trace with NULL pointer.

Fix it to skip trace call if msg pointer is NULL.

Signed-off-by: Moshe Shemesh <moshe@...dia.com>
---
 net/devlink/leftover.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/devlink/leftover.c b/net/devlink/leftover.c
index 0b1c5e0122f3..bc72d80141cf 100644
--- a/net/devlink/leftover.c
+++ b/net/devlink/leftover.c
@@ -6077,8 +6077,8 @@ int devlink_health_report(struct devlink_health_reporter *reporter,
 	int ret;
 
 	/* write a log message of the current error */
-	WARN_ON(!msg);
-	trace_devlink_health_report(devlink, reporter->ops->name, msg);
+	if (!WARN_ON(!msg))
+		trace_devlink_health_report(devlink, reporter->ops->name, msg);
 	reporter->error_count++;
 	prev_health_state = reporter->health_state;
 	reporter->health_state = DEVLINK_HEALTH_REPORTER_STATE_ERROR;
-- 
2.27.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ