[PATCH 2/3] Paravirtualization: Abstract sensitive instructions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andi Kleen wrote:
>> That said, there is an open "bug" on i386 in module loading.  We really 
>> should insert a call to sync_core during module loading after the 
>> alternative instructions have been patched.  In theory, the processor 
>> could prefetch the module code into the icache before any calls are made 
>> into the module, and since the module initialization calls follow 
>> shortly after the alternate patching, there is theoretically a window 
>> where the old code (albeit more conservative) could be executed.
>>     
>
> The x86 architecture is supposed to handle self modifying code (modulo
> processor errata). We rely on it in other places too.
>
> Calling relying on such a documented property a bug is really harsh.
>   

It's only a theoretically "bug", not a real bug.  Hence the quotes - I'm 
not being harsh.  Relying this on current processors is fine, but I 
don't believe it is guaranteed to never break on future cores.  Still, 
in practice, it is not really a problem because you will always have a 
reload of EIP to get to the module code.  But it could be an issue for 
alternative instruction patching, if the code doing the patching 
actually had embedded alternative instructions.  Since it doesn't you 
are still safe.  But worth noting since we are discussing code patching 
techniques, and it really doesn't hurt to stay on the safe side.

Zach

[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux