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] [day] [month] [year] [list]
Date:	Fri, 18 Feb 2011 08:40:15 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	Mike Travis <travis@....com>
Cc:	Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Len Brown <len.brown@...el.com>,
	Yinghai Lu <yhlu.kernel@...il.com>, linux-acpi@...r.kernel.org,
	x86@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 5/5] printk: Allocate kernel log buffer earlier


* Mike Travis <travis@....com> wrote:

> +++ linux/kernel/printk.c
> @@ -162,46 +162,65 @@ void log_buf_kexec_setup(void)
>  }
>  #endif
>  
> +static unsigned long __initdata new_log_buf_len;
>  static int __init log_buf_len_setup(char *str)
>  {

Can you see the readability problem this new line introduces?

> +	char first_line[64], *first_nl;

The value 64 looks arbitrary. Needs to be symbolized and explained. (That would also 
make the sizeof(first_line) usage more readable later on.)

> +	pr_info("log_buf_len: %d, first line: %s\n",
> +		log_buf_len, first_line);

It's not just arbitrarily sized, but i dont see where it's guaranteed that it's a 
nil delimited string.

> +	pr_debug("bu: %d/%d (%d%%)\n",
> +		dest_idx, __LOG_BUF_LEN - dest_idx,
> +		(dest_idx * 100) / __LOG_BUF_LEN);

What's that?

Patch looks pretty ad-hoc. No comments whatsoever what the intention is either, so 
the reader has to go figure out the code.

Thanks,

	Ingo
--
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