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: <1493568716.1874.7.camel@perches.com>
Date:   Sun, 30 Apr 2017 09:11:56 -0700
From:   Joe Perches <joe@...ches.com>
To:     Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>,
        linux-kernel@...r.kernel.org
Cc:     Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Petr Mladek <pmladek@...e.com>,
        Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
        Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [PATCH] printk: Add best-effort printk() buffering.

On Sun, 2017-04-30 at 22:54 +0900, Tetsuo Handa wrote:
> Sometimes we want to printk() multiple lines in a group without being
> disturbed by concurrent printk() from interrupts and/or other threads.
> For example, mixed printk() output of multiple thread's dump makes it
> hard to interpret.
> 
> This patch introduces fixed-sized statically allocated buffers for
> buffering printk() output for each thread/context in best effort
> (i.e. up to PAGE_SIZE bytes, up to 16 concurrent printk() users).
[]
> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
[]
> +#define MAX_PRINTK_BUFFERS 16
> +static struct printk_buffer {
> +	unsigned long context; /* printk_context() */
> +	unsigned int nested;
> +	unsigned int used; /* Valid bytes in buf[]. */
> +	char buf[PAGE_SIZE];
> +} printk_buffers[MAX_PRINTK_BUFFERS];

Perhaps these buffers could be acquired by
alloc_page rather than be static structures and
the sizeof buf[PAGE_SIZE] should be reduced by
	sizeof(unsigned long) +
	sizeof(unsigned int) +
	sizeof(unsigned int)
so that struct printk_buffers is exactly
PAGE_SIZE.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ