<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/printk, branch v5.11</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=v5.11</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.11'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2021-01-25T13:29:35Z</updated>
<entry>
<title>Merge branch 'printk-rework' into for-linus</title>
<updated>2021-01-25T13:29:35Z</updated>
<author>
<name>Petr Mladek</name>
<email>pmladek@suse.com</email>
</author>
<published>2021-01-25T13:29:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=61bb17da44a0b6d079e68872e3569bb3eda17656'/>
<id>urn:sha1:61bb17da44a0b6d079e68872e3569bb3eda17656</id>
<content type='text'>
</content>
</entry>
<entry>
<title>printk: fix string termination for record_print_text()</title>
<updated>2021-01-25T09:37:08Z</updated>
<author>
<name>John Ogness</name>
<email>john.ogness@linutronix.de</email>
</author>
<published>2021-01-24T20:27:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=08d60e5999540110576e7c1346d486220751b7f9'/>
<id>urn:sha1:08d60e5999540110576e7c1346d486220751b7f9</id>
<content type='text'>
Commit f0e386ee0c0b ("printk: fix buffer overflow potential for
print_text()") added string termination in record_print_text().
However it used the wrong base pointer for adding the terminator.
This led to a 0-byte being written somewhere beyond the buffer.

Use the correct base pointer when adding the terminator.

Fixes: f0e386ee0c0b ("printk: fix buffer overflow potential for print_text()")
Reported-by: Sven Schnelle &lt;svens@linux.ibm.com&gt;
Signed-off-by: John Ogness &lt;john.ogness@linutronix.de&gt;
Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
Link: https://lore.kernel.org/r/20210124202728.4718-1-john.ogness@linutronix.de
</content>
</entry>
<entry>
<title>Merge branch 'printk-rework' into for-linus</title>
<updated>2021-01-21T15:06:21Z</updated>
<author>
<name>Petr Mladek</name>
<email>pmladek@suse.com</email>
</author>
<published>2021-01-21T15:06:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=535b6a122c6b43af5772ca39cbff7056749aae74'/>
<id>urn:sha1:535b6a122c6b43af5772ca39cbff7056749aae74</id>
<content type='text'>
</content>
</entry>
<entry>
<title>printk: fix buffer overflow potential for print_text()</title>
<updated>2021-01-19T10:42:14Z</updated>
<author>
<name>John Ogness</name>
<email>john.ogness@linutronix.de</email>
</author>
<published>2021-01-14T17:04:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f0e386ee0c0b71ea6f7238506a4d0965a2dbef11'/>
<id>urn:sha1:f0e386ee0c0b71ea6f7238506a4d0965a2dbef11</id>
<content type='text'>
Before the commit 896fbe20b4e2333fb55 ("printk: use the lockless
ringbuffer"), msg_print_text() would only write up to size-1 bytes
into the provided buffer. Some callers expect this behavior and
append a terminator to returned string. In particular:

arch/powerpc/xmon/xmon.c:dump_log_buf()
arch/um/kernel/kmsg_dump.c:kmsg_dumper_stdout()

msg_print_text() has been replaced by record_print_text(), which
currently fills the full size of the buffer. This causes a
buffer overflow for the above callers.

Change record_print_text() so that it will only use size-1 bytes
for text data. Also, for paranoia sakes, add a terminator after
the text data.

And finally, document this behavior so that it is clear that only
size-1 bytes are used and a terminator is added.

Fixes: 896fbe20b4e2333fb55 ("printk: use the lockless ringbuffer")
Cc: stable@vger.kernel.org # 5.10+
Signed-off-by: John Ogness &lt;john.ogness@linutronix.de&gt;
Reviewed-by: Petr Mladek &lt;pmladek@suse.com&gt;
Acked-by: Sergey Senozhatsky &lt;sergey.senozhatsky@gmail.com&gt;
Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
Link: https://lore.kernel.org/r/20210114170412.4819-1-john.ogness@linutronix.de
</content>
</entry>
<entry>
<title>printk: fix kmsg_dump_get_buffer length calulations</title>
<updated>2021-01-15T10:32:52Z</updated>
<author>
<name>John Ogness</name>
<email>john.ogness@linutronix.de</email>
</author>
<published>2021-01-13T16:44:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=89ccf18f032f26946e2ea6258120472eec6aa745'/>
<id>urn:sha1:89ccf18f032f26946e2ea6258120472eec6aa745</id>
<content type='text'>
kmsg_dump_get_buffer() uses @syslog to determine if the syslog
prefix should be written to the buffer. However, when calculating
the maximum number of records that can fit into the buffer, it
always counts the bytes from the syslog prefix.

Use @syslog when calculating the maximum number of records that can
fit into the buffer.

Fixes: e2ae715d66bf ("kmsg - kmsg_dump() use iterator to receive log buffer content")
Signed-off-by: John Ogness &lt;john.ogness@linutronix.de&gt;
Reviewed-by: Petr Mladek &lt;pmladek@suse.com&gt;
Acked-by: Sergey Senozhatsky &lt;sergey.senozhatsky@gmail.com&gt;
Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
Link: https://lore.kernel.org/r/20210113164413.1599-1-john.ogness@linutronix.de
</content>
</entry>
<entry>
<title>printk: ringbuffer: fix line counting</title>
<updated>2021-01-15T10:30:03Z</updated>
<author>
<name>John Ogness</name>
<email>john.ogness@linutronix.de</email>
</author>
<published>2021-01-13T14:42:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=668af87f995b6d6d09595c088ad1fb5dd9ff25d2'/>
<id>urn:sha1:668af87f995b6d6d09595c088ad1fb5dd9ff25d2</id>
<content type='text'>
Counting text lines in a record simply involves counting the number
of newline characters (+1). However, it is searching the full data
block for newline characters, even though the text data can be (and
often is) a subset of that area. Since the extra area in the data
block was never initialized, the result is that extra newlines may
be seen and counted.

Restrict newline searching to the text data length.

Fixes: b6cf8b3f3312 ("printk: add lockless ringbuffer")
Signed-off-by: John Ogness &lt;john.ogness@linutronix.de&gt;
Reviewed-by: Petr Mladek &lt;pmladek@suse.com&gt;
Acked-by: Sergey Senozhatsky &lt;sergey.senozhatsky@gmail.com&gt;
Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
Link: https://lore.kernel.org/r/20210113144234.6545-1-john.ogness@linutronix.de
</content>
</entry>
<entry>
<title>Merge tag 'printk-for-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux</title>
<updated>2020-12-16T18:45:11Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2020-12-16T18:45:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d3eb52113d162cc88975fbd03c9e6f9cf2f8a771'/>
<id>urn:sha1:d3eb52113d162cc88975fbd03c9e6f9cf2f8a771</id>
<content type='text'>
Pull printk updates from Petr Mladek:

 - Finally allow parallel writes and reads into/from the lockless
   ringbuffer. But it is not a complete solution. Readers are still
   serialized against each other. And nested writes are still prevented
   by printk_safe per-CPU buffers.

 - Use ttynull as the ultimate fallback for /dev/console.

 - Officially allow disabling console output by using console="" or
   console=null

 - A few code cleanups

* tag 'printk-for-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux:
  printk: remove logbuf_lock writer-protection of ringbuffer
  printk: inline log_output(),log_store() in vprintk_store()
  printk: remove obsolete dead assignment
  printk/console: Allow to disable console output by using console="" or console=null
  init/console: Use ttynull as a fallback when there is no console
  printk: ringbuffer: Reference text_data_ring directly in callees.
</content>
</entry>
<entry>
<title>Merge tag 'sched-core-2020-12-14' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2020-12-15T02:29:11Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2020-12-15T02:29:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=adb35e8dc98ba9bda99ff79ac6a05b8fcde2a762'/>
<id>urn:sha1:adb35e8dc98ba9bda99ff79ac6a05b8fcde2a762</id>
<content type='text'>
Pull scheduler updates from Thomas Gleixner:

 - migrate_disable/enable() support which originates from the RT tree
   and is now a prerequisite for the new preemptible kmap_local() API
   which aims to replace kmap_atomic().

 - A fair amount of topology and NUMA related improvements

 - Improvements for the frequency invariant calculations

 - Enhanced robustness for the global CPU priority tracking and decision
   making

 - The usual small fixes and enhancements all over the place

* tag 'sched-core-2020-12-14' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (61 commits)
  sched/fair: Trivial correction of the newidle_balance() comment
  sched/fair: Clear SMT siblings after determining the core is not idle
  sched: Fix kernel-doc markup
  x86: Print ratio freq_max/freq_base used in frequency invariance calculations
  x86, sched: Use midpoint of max_boost and max_P for frequency invariance on AMD EPYC
  x86, sched: Calculate frequency invariance for AMD systems
  irq_work: Optimize irq_work_single()
  smp: Cleanup smp_call_function*()
  irq_work: Cleanup
  sched: Limit the amount of NUMA imbalance that can exist at fork time
  sched/numa: Allow a floating imbalance between NUMA nodes
  sched: Avoid unnecessary calculation of load imbalance at clone time
  sched/numa: Rename nr_running and break out the magic number
  sched: Make migrate_disable/enable() independent of RT
  sched/topology: Condition EAS enablement on FIE support
  arm64: Rebuild sched domains on invariance status changes
  sched/topology,schedutil: Wrap sched domains rebuild
  sched/uclamp: Allow to reset a task uclamp constraint value
  sched/core: Fix typos in comments
  Documentation: scheduler: fix information on arch SD flags, sched_domain and sched_debug
  ...
</content>
</entry>
<entry>
<title>Merge branch 'for-5.11' into for-linus</title>
<updated>2020-12-14T14:15:07Z</updated>
<author>
<name>Petr Mladek</name>
<email>pmladek@suse.com</email>
</author>
<published>2020-12-14T14:15:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5ed37174e6c7e1ed4abfd0d8e932a3044441fb5f'/>
<id>urn:sha1:5ed37174e6c7e1ed4abfd0d8e932a3044441fb5f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Merge branch 'for-5.11-null-console' into for-linus</title>
<updated>2020-12-14T14:14:57Z</updated>
<author>
<name>Petr Mladek</name>
<email>pmladek@suse.com</email>
</author>
<published>2020-12-14T14:14:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5f3b8d398601055f29f32986a94d55955cd48f09'/>
<id>urn:sha1:5f3b8d398601055f29f32986a94d55955cd48f09</id>
<content type='text'>
</content>
</entry>
</feed>
