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>] [day] [month] [year] [list]
Message-ID: <207bb26a9fde5104920b85a9266481aac9fdd052.1656336125.git.petrm@nvidia.com>
Date:   Mon, 27 Jun 2022 15:24:31 +0200
From:   Petr Machata <petrm@...dia.com>
To:     <netdev@...r.kernel.org>
CC:     David Ahern <dsahern@...il.com>,
        Stephen Hemminger <stephen@...workplumber.org>,
        Petr Machata <petrm@...dia.com>,
        Tariq Toukan <tariqt@...dia.com>,
        Itay Aveksis <itayav@...dia.com>
Subject: [PATCH iproute2-next] ip: Fix rx_otherhost_dropped support

The commit cited below added a new column to print_stats64(). However it
then updated only one call site, neglecting to update the remaining three.
As a result, in those not-updated invocations, size_columns() now accesses
a vararg argument that is not being passed, which is undefined behavior.

Fixes: cebf67a35d8a ("show rx_otherehost_dropped stat in ip link show")
CC: Tariq Toukan <tariqt@...dia.com>
CC: Itay Aveksis <itayav@...dia.com>
Signed-off-by: Petr Machata <petrm@...dia.com>
---
 ip/ipaddress.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index 30f32746..1d2dc803 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -775,10 +775,12 @@ void print_stats64(FILE *fp, struct rtnl_link_stats64 *s,
 		if (what)
 			close_json_object();
 	} else {
+		uint64_t zero64 = 0;
+
 		size_columns(cols, ARRAY_SIZE(cols),
 			     s->rx_bytes, s->rx_packets, s->rx_errors,
 			     s->rx_dropped, s->rx_missed_errors,
-			     s->multicast, s->rx_compressed);
+			     s->multicast, s->rx_compressed, zero64);
 		if (show_stats > 1)
 			size_columns(cols, ARRAY_SIZE(cols), 0,
 				     s->rx_length_errors, s->rx_crc_errors,
@@ -788,7 +790,7 @@ void print_stats64(FILE *fp, struct rtnl_link_stats64 *s,
 		size_columns(cols, ARRAY_SIZE(cols),
 			     s->tx_bytes, s->tx_packets, s->tx_errors,
 			     s->tx_dropped, s->tx_carrier_errors,
-			     s->collisions, s->tx_compressed);
+			     s->collisions, s->tx_compressed, zero64);
 		if (show_stats > 1)
 			size_columns(cols, ARRAY_SIZE(cols), 0, 0,
 				     s->tx_aborted_errors, s->tx_fifo_errors,
@@ -796,7 +798,8 @@ void print_stats64(FILE *fp, struct rtnl_link_stats64 *s,
 				     s->tx_heartbeat_errors,
 				     (uint64_t)(carrier_changes ?
 						rta_getattr_u32(carrier_changes)
-						: 0));
+						: 0),
+				     zero64);
 
 		/* RX stats */
 		fprintf(fp, "    RX: %*s %*s %*s %*s %*s %*s %*s%s",
-- 
2.35.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ