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: <20201219125345.327202354@linuxfoundation.org>
Date:   Sat, 19 Dec 2020 13:58:17 +0100
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     linux-kernel@...r.kernel.org
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        stable@...r.kernel.org, Jianguo Wu <wujianguo@...natelecom.cn>,
        Florian Westphal <fw@...len.de>,
        Jakub Kicinski <kuba@...nel.org>
Subject: [PATCH 5.9 13/49] mptcp: print new line in mptcp_seq_show() if mptcp isnt in use

From: Jianguo Wu <wujianguo@...natelecom.cn>

[ Upstream commit f55628b3e7648198e9c072b52080c5dea8678adf ]

When do cat /proc/net/netstat, the output isn't append with a new line, it looks like this:
[root@...alhost ~]# cat /proc/net/netstat
...
MPTcpExt: 0 0 0 0 0 0 0 0 0 0 0 0 0[root@...alhost ~]#

This is because in mptcp_seq_show(), if mptcp isn't in use, net->mib.mptcp_statistics is NULL,
so it just puts all 0 after "MPTcpExt:", and return, forgot the '\n'.

After this patch:

[root@...alhost ~]# cat /proc/net/netstat
...
MPTcpExt: 0 0 0 0 0 0 0 0 0 0 0 0 0
[root@...alhost ~]#

Fixes: fc518953bc9c8d7d ("mptcp: add and use MIB counter infrastructure")
Signed-off-by: Jianguo Wu <wujianguo@...natelecom.cn>
Acked-by: Florian Westphal <fw@...len.de>
Link: https://lore.kernel.org/r/142e2fd9-58d9-bb13-fb75-951cccc2331e@163.com
Signed-off-by: Jakub Kicinski <kuba@...nel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
 net/mptcp/mib.c |    1 +
 1 file changed, 1 insertion(+)

--- a/net/mptcp/mib.c
+++ b/net/mptcp/mib.c
@@ -58,6 +58,7 @@ void mptcp_seq_show(struct seq_file *seq
 		for (i = 0; mptcp_snmp_list[i].name; i++)
 			seq_puts(seq, " 0");
 
+		seq_putc(seq, '\n');
 		return;
 	}
 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ