File tree 1 file changed +9
-0
lines changed
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,15 @@ internal static class Opcode
11
11
12
12
public static bool Open ( )
13
13
{
14
+ // Look for an environment variable: "NETQM_SUPPRESS_RDTSC" with any value.
15
+ // The application can set this environment variable when this code is running in a system where
16
+ // it is not desirable to read the processor's time stamp counter.
17
+ // While this is supported in modern CPUs, the technique used for allocating executable memory, copying OP Code
18
+ // for the read of the time stamp and invoking the OP Code can be detected as Malware by some anti-virus vendors.
19
+ // https://github.com/zeromq/netmq/issues/1071
20
+ string val = Environment . GetEnvironmentVariable ( "NETQM_SUPPRESS_RDTSC" ) ;
21
+ if ( ! string . IsNullOrEmpty ( val ) )
22
+ return false ;
14
23
#if NETSTANDARD1_1_OR_GREATER || NET471_OR_GREATER
15
24
if ( RuntimeInformation . ProcessArchitecture != Architecture . X86 &&
16
25
RuntimeInformation . ProcessArchitecture != Architecture . X64 )
You can’t perform that action at this time.
0 commit comments