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]
Date:   Thu, 24 May 2018 16:00:23 -0700 (PDT)
From:   Hugh Dickins <hughd@...gle.com>
To:     Andrew Morton <akpm@...ux-foundation.org>
cc:     Andrei Vagin <avagin@...nvz.org>, linux-kernel@...r.kernel.org,
        linux-mm@...ck.org
Subject: [PATCH] proc: fix smaps and meminfo alignment

The 4.17-rc /proc/meminfo and /proc/<pid>/smaps look ugly: single-digit
numbers (commonly 0) are misaligned. Remove seq_put_decimal_ull_width()'s
leftover optimization for single digits: it's wrong now that num_to_str()
takes care of the width.

Fixes: d1be35cb6f96 ("proc: add seq_put_decimal_ull_width to speed up /proc/pid/smaps")
Signed-off-by: Hugh Dickins <hughd@...gle.com>
---

 fs/seq_file.c |    5 -----
 1 file changed, 5 deletions(-)

--- 4.17-rc6/fs/seq_file.c	2018-04-15 21:45:06.740885410 -0700
+++ linux/fs/seq_file.c	2018-05-24 14:41:21.508491794 -0700
@@ -709,11 +709,6 @@ void seq_put_decimal_ull_width(struct se
 	if (m->count + width >= m->size)
 		goto overflow;
 
-	if (num < 10) {
-		m->buf[m->count++] = num + '0';
-		return;
-	}
-
 	len = num_to_str(m->buf + m->count, m->size - m->count, num, width);
 	if (!len)
 		goto overflow;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ