[PATCH 0/5] printk: Check for too long messages

From: Petr Mladek
Date: Thu Apr 10 2014 - 05:44:08 EST


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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/