mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/5] printk: Check for too long messages
@ 2014-04-10  9:43 Petr Mladek
  2014-04-10  9:43 ` [PATCH 1/5] printk: Split code for making free space in the log buffer Petr Mladek
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Petr Mladek @ 2014-04-10  9:43 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Jan Kara, Jiri Kosina, Kay Sievers, linux-kernel, Petr Mladek

The check for free space in the log buffer always passes when "first_seq"
and "next_seq" are equal. In theory, it might cause writing outside of
the log buffer.

Fortunately, the current usage looks safe because the used "text" and "dict"
buffers are quite limited. See the second patch for more details.

Anyway, it is better to be on the safe side and add a check. An easy
solution is done in the 2nd patch and it is improved in the 4th patch.

5th patch fixes the computation of the printed message length.

1st and 3rd patches just do some code refactoring to make the other patches
easier.

The patches can be applied against both linux.git and linux-next.git.

Just a heads up. These patches were created when working safe printk
in NMI context. I have resolved most problems, including my sickness,
and should be able to send the NMI stuff soon.

Petr Mladek (5):
  printk: Split code for making free space in the log buffer
  printk: Ignore too long messages
  printk: Split message size computation
  printk: Shrink too long messages
  printk: Return really stored message length

 kernel/printk/printk.c | 144 ++++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 113 insertions(+), 31 deletions(-)

-- 
1.8.4


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-04-10  9:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-10  9:43 [PATCH 0/5] printk: Check for too long messages Petr Mladek
2014-04-10  9:43 ` [PATCH 1/5] printk: Split code for making free space in the log buffer Petr Mladek
2014-04-10  9:43 ` [PATCH 2/5] printk: Ignore too long messages Petr Mladek
2014-04-10  9:43 ` [PATCH 3/5] printk: Split message size computation Petr Mladek
2014-04-10  9:43 ` [PATCH 4/5] printk: Shrink too long messages Petr Mladek
2014-04-10  9:43 ` [PATCH 5/5] printk: Return really stored message length Petr Mladek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®