lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 1 Jun 2023 13:45:35 +0500
From:   Muhammad Usama Anjum <usama.anjum@...labora.com>
To:     Thomas Gleixner <tglx@...utronix.de>,
        Jonathan Corbet <corbet@....net>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
        "H. Peter Anvin" <hpa@...or.com>,
        "open list:DOCUMENTATION" <linux-doc@...r.kernel.org>,
        open list <linux-kernel@...r.kernel.org>,
        "Guilherme G. Piccoli" <gpiccoli@...lia.com>
Cc:     Muhammad Usama Anjum <usama.anjum@...labora.com>,
        Steven Noonan <steven@...inklabs.net>, kernel@...labora.com
Subject: Direct rdtsc call side-effect

Hi,

I've been looking into a problem where Windows applications misbehave
across suspend/resume when run on Wine on x86. These applications see time
going backwards. The timestamp counter (TSC) is reset when system resumes.
In case of Windows on Intel and AMD, the timestamp is saved and restored
when the system resumes from suspend.

These applications read timestamp by rdtsc directly. These calls cannot be
intercepted by Wine. The application should be fixed such that it handles
these scenarios correctly. But there are hundreds of applications which
cannot be fixed. So some support is required in Wine or kernel. There isn't
anything which Wine can do as rdtsc call directly reads the timestamp. The
only option is that we support something in kernel.

As more and more things are being added to Wine, Windows application can be
run pretty easily on Linux. But this rdtsc is a big hurdle. What are your
thoughts on solving this problem?

We are thinking of saving and restoring the timestamp counter at suspend
and resume time respectively. In theory it can work on Intel because of
TSC_ADJUST register. But it'll never work on AMD until:
* AMD supports the same kind of adjust register. (AMD has said that the
adjust register cannot be implemented in their firmware. They'll have to
add it to their hardware.)
* by manual synchronization in kernel (I know you don't like this idea. But
there is something Windows is doing to save/restore and sync the TSC)

I really hope that you share some thoughts.

-- 
BR,
Muhammad Usama Anjum

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ