]> git.baikalelectronics.ru Git - kernel.git/commit
printk: fix possible printk overrun
authorTejun Heo <htejun@gmail.com>
Thu, 14 Feb 2008 01:32:07 +0000 (10:32 +0900)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 26 Feb 2008 15:42:37 +0000 (07:42 -0800)
commitb54a4d61772990752070bc3667df7ada974b185f
treef73af36b208fab34620808f0075cc54f51cfdfb0
parent43f675f1ef5519737391c36495b999a9b028786a
printk: fix possible printk overrun

printk recursion detection prepends message to printk_buf and offsets
printk_buf when actual message is printed but it forgets to trim buffer
length accordingly. This can result in overrun in extreme cases. Fix it.

[ mingo@elte.hu:

  bug was introduced by me via:

   commit 807e543923b16159636e789e72f72f608acfb669
   Author: Ingo Molnar <mingo@elte.hu>
   Date:   Fri Jan 25 21:07:58 2008 +0100

       printk: make printk more robust by not allowing recursion
]

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/printk.c