• Cyrill Gorcunov's avatar
    x86: cpu -- Save xsave frame sizes in image · 327e78f9
    Cyrill Gorcunov authored
    Keep xsave sizes in image to be sure that on restore the application
    won't override memory out of xsave frame size if been calling xsave
    instruction directly.
    
    Here are some details: while been testing vz7 containers migration
    we've noticed that sometime applications do crash after restore,
    what is worse such execution abort may happen not immediately
    after the restore but after passing some time. After spending
    a lot of time we discovered that it is due to the fact that
    the migration is directed from an old cpu to a modern one
    which has extensions such as mpx. In result libc has cached
    small xsave size and then after restore any direct call to
    xsave instruction overwrite memory which is allocated with
    size less than needed.
    
    Thus we save xsave frame size in image and require it to
    match to prevent such situation.
    Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@gmail.com>
    Reviewed-by: 's avatarDmitry Safonov <0x7f454c46@gmaill.com>
    Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
    327e78f9
cpuinfo.proto 1000 Bytes