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]
Date:	16 Sep 2013 13:21:31 -0400
From:	"George Spelvin" <linux@...izon.com>
To:	joe@...ches.com, keescook@...omium.org
Cc:	akpm@...ux-foundation.org, dan.carpenter@...cle.com,
	JBeulich@...e.com, kosaki.motohiro@...il.com,
	linux-kernel@...r.kernel.org, linux@...izon.com,
	penguin-kernel@...ove.sakura.ne.jp, viro@...iv.linux.org.uk
Subject: Re: [PATCH 1/2] remove all uses of printf's %n

> My thought was to add a seq_last_len()

In addition to adding per-call overhead to support a rarely-used feature
(while ->pos comes for free), this has the downside that it matters how
many separate calls are used to generate the string.

The advantage of the "read ->pos before and after" technique is that
you can have an arbitrary number of output calls in between.
Including things like seq_path(), seq_bitmap(), etc.

If you have the printing done in a subroutine (as in the net/ipv4
directory), it would be annoyingly subtle if seq_puts("foobar")
were not equivalent to seq_puts("foo"); seq_puts("bar").


I agree that exposing the internals via ->pos is a bit ugly, but too
many levels of abstraction makes code hard to read, too, and it's very
straightforward to find and fix the dozen or so places where it's accessed
in the unlikely case that the internals of seq_file change significantly.

My take on it is "not worth fixing".
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ