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: Fri, 27 Oct 2023 06:54:51 +0200
From: Christoph Hellwig <>
To: Kees Cook <>
Cc: Steven Rostedt <>,
	"Matthew Wilcox (Oracle)" <>,
	Christoph Hellwig <>,
	Justin Stitt <>,
	Kent Overstreet <>,
	Petr Mladek <>,
	Andy Shevchenko <>,
	Rasmus Villemoes <>,
	Sergey Senozhatsky <>,
	Masami Hiramatsu <>,
	Greg Kroah-Hartman <>,
	Arnd Bergmann <>, Jonathan Corbet <>,
	Yun Zhou <>,
	Jacob Keller <>,
	Zhen Lei <>,,
	Yosry Ahmed <>,,
Subject: Re: [PATCH v2] seq_buf: Introduce DECLARE_SEQ_BUF and seq_buf_str()

On Thu, Oct 26, 2023 at 12:40:37PM -0700, Kees Cook wrote:
> Solve two ergonomic issues with struct seq_buf;
> 1) Too much boilerplate is required to initialize:
> 	struct seq_buf s;
> 	char buf[32];
> 	seq_buf_init(s, buf, sizeof(buf));
> Instead, we can build this directly on the stack. Provide
> DECLARE_SEQ_BUF() macro to do this:
> 	DECLARE_SEQ_BUF(s, 32);

DECLARE_SEQ_BUF_ONSTACK maybe?  But otherwise this looks like a good

> Instead, we can just return s->buffer direction after terminating it
> in refactored seq_buf_terminate(), now known as seq_buf_str():
> 	do_soemthing(seq_buf_str(s));

Looks good.  Btw, one typical do_something would be printing it,
so adding a format specifier that's using this helper would also
probably be very useful.

Powered by blists - more mailing lists