mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.cz>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Jan Kara <jack@suse.cz>, Jiri Kosina <jkosina@suse.cz>,
	Kay Sievers <kay@vrfy.org>,
	linux-kernel@vger.kernel.org, Petr Mladek <pmladek@suse.cz>
Subject: [PATCH 0/5] printk: Check for too long messages
Date: Thu, 10 Apr 2014 11:43:11 +0200	[thread overview]
Message-ID: <1397122996-15136-1-git-send-email-pmladek@suse.cz> (raw)

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


             reply	other threads:[~2014-04-10  9:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-10  9:43 Petr Mladek [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1397122996-15136-1-git-send-email-pmladek@suse.cz \
    --to=pmladek@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=jack@suse.cz \
    --cc=jkosina@suse.cz \
    --cc=kay@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®