<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/printk.c, branch v3.5</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v3.5</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.5'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2012-07-21T17:34:00Z</updated>
<entry>
<title>printk: Implement some unlocked kmsg_dump functions</title>
<updated>2012-07-21T17:34:00Z</updated>
<author>
<name>Anton Vorontsov</name>
<email>anton.vorontsov@linaro.org</email>
</author>
<published>2012-07-21T00:28:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=533827c921c34310f63e859e1d6d0feec439657d'/>
<id>urn:sha1:533827c921c34310f63e859e1d6d0feec439657d</id>
<content type='text'>
If used from KDB, the locked variants are prone to deadlocks (suppose we
got to the debugger w/ the logbuf lock held).

So, we have to implement a few routines that grab no logbuf lock.

Yet we don't need these functions in modules, so we don't export them.

Signed-off-by: Anton Vorontsov &lt;anton.vorontsov@linaro.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>printk: Remove kdb_syslog_data</title>
<updated>2012-07-21T17:34:00Z</updated>
<author>
<name>Anton Vorontsov</name>
<email>anton.vorontsov@linaro.org</email>
</author>
<published>2012-07-21T00:27:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1b499d05eecbe04969516717a8e15afb6ad80689'/>
<id>urn:sha1:1b499d05eecbe04969516717a8e15afb6ad80689</id>
<content type='text'>
The function is no longer needed, so remove it.

Signed-off-by: Anton Vorontsov &lt;anton.vorontsov@linaro.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>kmsg: merge continuation records while printing</title>
<updated>2012-07-09T19:15:42Z</updated>
<author>
<name>Kay Sievers</name>
<email>kay@vrfy.org</email>
</author>
<published>2012-07-09T19:15:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5becfb1df5ac8e491338e64b1029685ccad4b39c'/>
<id>urn:sha1:5becfb1df5ac8e491338e64b1029685ccad4b39c</id>
<content type='text'>
In (the unlikely) case our continuation merge buffer is busy, we unfortunately
can not merge further continuation printk()s into a single record and have to
store them separately, which leads to split-up output of these lines when they
are printed.

Add some flags about newlines and prefix existence to these records and try to
reconstruct the full line again, when the separated records are printed.

Reported-By: Michael Neuling &lt;mikey@neuling.org&gt;
Cc: Dave Jones &lt;davej@redhat.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Tested-By: Michael Neuling &lt;mikey@neuling.org&gt;
Signed-off-by: Kay Sievers &lt;kay@vrfy.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>kmsg: /proc/kmsg - support reading of partial log records</title>
<updated>2012-07-09T17:05:10Z</updated>
<author>
<name>Kay Sievers</name>
<email>kay@vrfy.org</email>
</author>
<published>2012-07-09T17:05:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=eb02dac93708f581c99858a19162af8ca2b6bfcb'/>
<id>urn:sha1:eb02dac93708f581c99858a19162af8ca2b6bfcb</id>
<content type='text'>
Restore support for partial reads of any size on /proc/kmsg, in case the
supplied read buffer is smaller than the record size.

Some people seem to think is is ia good idea to run:
  $ dd if=/proc/kmsg bs=1 of=...
as a klog bridge.

Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=44211
Reported-by: Jukka Ollila &lt;jiiksteri@gmail.com&gt;
Signed-off-by: Kay Sievers &lt;kay@vrfy.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>kmsg: make sure all messages reach a newly registered boot console</title>
<updated>2012-07-06T16:50:09Z</updated>
<author>
<name>Kay Sievers</name>
<email>kay@vrfy.org</email>
</author>
<published>2012-07-06T16:50:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=68b6507dc554ba015b5ed5e13b1ed4993cdf4024'/>
<id>urn:sha1:68b6507dc554ba015b5ed5e13b1ed4993cdf4024</id>
<content type='text'>
We suppress printing kmsg records to the console, which are already printed
immediately while we have received their fragments.

Newly registered boot consoles print the entire kmsg buffer during
registration. Clear the console-suppress flag after we skipped the record
during its first storage, so any later print will see these records as usual.

Signed-off-by: Kay Sievers &lt;kay@vrfy.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>kmsg: properly handle concurrent non-blocking read() from /proc/kmsg</title>
<updated>2012-07-06T16:50:09Z</updated>
<author>
<name>Kay Sievers</name>
<email>kay@vrfy.org</email>
</author>
<published>2012-07-06T16:50:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cb424ffe9f45ad80267f2a98fbd9bf21caa0ce22'/>
<id>urn:sha1:cb424ffe9f45ad80267f2a98fbd9bf21caa0ce22</id>
<content type='text'>
The /proc/kmsg read() interface is internally simply wired up to a sequence
of syslog() syscalls, which might are racy between their checks and actions,
regarding concurrency.

In the (very uncommon) case of concurrent readers of /dev/kmsg, relying on
usual O_NONBLOCK behavior, the recently introduced mutex might block an
O_NONBLOCK reader in read(), when poll() returns for it, but another process
has already read the data in the meantime. We've seen that while running
artificial test setups and tools that "fight" about /proc/kmsg data.

This restores the original /proc/kmsg behavior, where in case of concurrent
read()s, poll() might wake up but the read() syscall will just return 0 to
the caller, while another process has "stolen" the data.

This is in the general case not the expected behavior, but it is the exact
same one, that can easily be triggered with a 3.4 kernel, and some tools
might just rely on it.

The mutex is not needed, the original integrity issue which introduced it,
is in the meantime covered by:
  "fill buffer with more than a single message for SYSLOG_ACTION_READ"
  116e90b23f74d303e8d607c7a7d54f60f14ab9f2

Cc: Yuanhan Liu &lt;yuanhan.liu@linux.intel.com&gt;
Acked-by: Jan Beulich &lt;jbeulich@suse.com&gt;
Signed-off-by: Kay Sievers &lt;kay@vrfy.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>kmsg: add the facility number to the syslog prefix</title>
<updated>2012-07-06T16:50:09Z</updated>
<author>
<name>Kay Sievers</name>
<email>kay@vrfy.org</email>
</author>
<published>2012-07-06T16:50:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=43a73a50b352cd3df25b3ced72033942a6a0f919'/>
<id>urn:sha1:43a73a50b352cd3df25b3ced72033942a6a0f919</id>
<content type='text'>
After the recent split of facility and level into separate variables,
we miss the facility value (always 0 for kernel-originated messages)
in the syslog prefix.

On Tue, Jul 3, 2012 at 12:45 PM, Dan Carpenter &lt;dan.carpenter@oracle.com&gt; wrote:
&gt; Static checkers complain about the impossible condition here.
&gt;
&gt; In 084681d14e ('printk: flush continuation lines immediately to
&gt; console'), we changed msg-&gt;level from being a u16 to being an unsigned
&gt; 3 bit bitfield.

Cc: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Kay Sievers &lt;kay@vrfy.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>kmsg: escape the backslash character while exporting data</title>
<updated>2012-07-06T16:50:09Z</updated>
<author>
<name>Kay Sievers</name>
<email>kay@vrfy.org</email>
</author>
<published>2012-07-06T16:50:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e3f5a5f27153228569f3396049838e9727dae86e'/>
<id>urn:sha1:e3f5a5f27153228569f3396049838e9727dae86e</id>
<content type='text'>
Non-printable characters in the log data are hex-escaped to ensure safe
post processing. We need to escape a backslash we find in the data, to be
able to distinguish it from a backslash we add for the escaping.

Also escape the non-printable character 127.

Thanks to Miloslav Trmac for the heads up.

Reported-by: Michael Neuling &lt;mikey@neuling.org&gt;
Signed-off-by: Kay Sievers &lt;kay@vrfy.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>printk: replacing the raw_spin_lock/unlock with raw_spin_lock/unlock_irq</title>
<updated>2012-07-06T16:50:08Z</updated>
<author>
<name>liu chuansheng</name>
<email>chuansheng.liu@intel.com</email>
</author>
<published>2012-07-06T16:50:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5c53d819c71c63fdc91f30a59164583f68e2d63a'/>
<id>urn:sha1:5c53d819c71c63fdc91f30a59164583f68e2d63a</id>
<content type='text'>
In function devkmsg_read/writev/llseek/poll/open()..., the function
raw_spin_lock/unlock is used, there is potential deadlock case happening.
CPU1: thread1 doing the cat /dev/kmsg:
        raw_spin_lock(&amp;logbuf_lock);
        while (user-&gt;seq == log_next_seq) {
when thread1 run here, at this time one interrupt is coming on CPU1 and running
based on this thread,if the interrupt handle called the printk which need the
logbuf_lock spin also, it will cause deadlock.

So we should use raw_spin_lock/unlock_irq here.

Acked-by: Kay Sievers &lt;kay@vrfy.org&gt;
Signed-off-by: liu chuansheng &lt;chuansheng.liu@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>printk.c: fix kernel-doc warnings</title>
<updated>2012-06-30T22:56:40Z</updated>
<author>
<name>Randy Dunlap</name>
<email>rdunlap@xenotime.net</email>
</author>
<published>2012-06-30T22:37:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4f0f4af59cb07bcf44d3c07a9e8c26df54d9fff8'/>
<id>urn:sha1:4f0f4af59cb07bcf44d3c07a9e8c26df54d9fff8</id>
<content type='text'>
Fix kernel-doc warnings in printk.c: use correct parameter name.

  Warning(kernel/printk.c:2429): No description found for parameter 'buf'
  Warning(kernel/printk.c:2429): Excess function parameter 'line' description in 'kmsg_dump_get_buffer'

Signed-off-by: Randy Dunlap &lt;rdunlap@xenotime.net&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
