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:	Wed, 4 Feb 2009 07:05:49 -0500
From:	Neil Horman <nhorman@...driver.com>
To:	"Eric W. Biederman" <ebiederm@...ssion.com>
Cc:	Simon Horman <horms@...ge.net.au>, hbabu@...ibm.com,
	kexec@...ts.infradead.org, linux-kernel@...r.kernel.org,
	Eric Biederman <ebiederm@...sion.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Vivek Goyal <vgoyal@...hat.com>
Subject: Re: [PATCH]: add dmesg log symbols to /proc/vmcoreinfo lists

> 
> That aside we aren't currently exporting log_buf_len, so I don't
> think this code works actually works.
> 
> Neil can you add a comment in kernel/printk.c of the algorithm
> necessary for external tools to decode the ring buffer?
> 
> We need the comment because people working on kernel/printk.c
> need to know what is happening and without having to review lots
> of user space code, and we need the comment to verify that we
> are exporting the right things.
> 

Ok, as per Erics comment, I've written this.  It applies on top of whats already
in your tree Andrew.  It adds some comments on the function in question so that
anyone working on printk.c will know why we're exporting their symbols.  It also
modifies slightly the symbols we are exporting so that we can handle dmesg
buffers that are longer than the standard PAGE_SIZE configuration, and lets us
detect and handle buffer wraps.

Thanks!

printk.c |   12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

Signed-off-by: Neil Horman <nhorman@...driver.com>

diff --git a/kernel/printk.c b/kernel/printk.c
index dd5cc7b..6a1163b 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -138,10 +138,20 @@ static int log_buf_len = __LOG_BUF_LEN;
 static unsigned logged_chars; /* Number of chars produced since last read+clear operation */
 
 #ifdef CONFIG_KEXEC
+/*
+ * This appends the listed symbols to /proc/vmcoreinfo
+ * /proc/vmcoreinfo is used by various utiilties, like
+ * crash and makedumpfile to obtain access to symbols that
+ * are otherwise very difficult to locate.  These symbols 
+ * are specifically used so that utilities 
+ * can access and extract the dmesg log from a vmcore file
+ * after a crash
+ */
 void log_buf_kexec_setup(void)
 {
 	VMCOREINFO_SYMBOL(log_buf);
-	VMCOREINFO_SYMBOL(log_end);
+	VMCOREINFO_SYMBOL(log_buf_len);
+	VMCOREINFO_SYMBOL(logged_chars)
 }
 #endif
 
--
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