]> git.baikalelectronics.ru Git - kernel.git/commit
x86: properly initialize temp insn buffer for paravirt patching
authorChris Wright <chrisw@sous-sol.org>
Sat, 18 Aug 2007 21:31:41 +0000 (14:31 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Sat, 18 Aug 2007 22:15:54 +0000 (15:15 -0700)
commit7ea0db0fc1c38bf879c01d0b03cea4fe7744059b
treec6da4cdd6c63be258a32635e87b239c570d5f664
parentbdeb15d331394df478b95dc314ba28edd6d4bd41
x86: properly initialize temp insn buffer for paravirt patching

With commit a2eb5570999b8d78b8649e3ce59c6b224a6f43a6 the patching code
now collects the complete new instruction stream into a temp buffer
before finally patching in the new insns.  In some cases the paravirt
patchers will choose to leave the patch site unpatched (length mismatch,
clobbers mismatch, etc).

This causes the new patching code to copy an uninitialized temp buffer,
i.e.  garbage, to the callsite.  Simply make sure to always initialize
the buffer with the original instruction stream.  A better fix is to
audit all the patchers and return proper length so that apply_paravirt()
can skip copies when we leave the patch site untouched.

Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/i386/kernel/alternative.c