Skip to content

Commit

Permalink
Merge branch 'master' into bump-versions-and-fix-assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
drewnoakes authored Oct 23, 2023
2 parents f3825cf + 7c86f95 commit ff606d3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/NetMQ/Core/Utils/OpCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ internal static class Opcode

public static bool Open()
{
// Look for an environment variable: "NETQM_SUPPRESS_RDTSC" with any value.
// The application can set this environment variable when this code is running in a system where
// it is not desirable to read the processor's time stamp counter.
// While this is supported in modern CPUs, the technique used for allocating executable memory, copying OP Code
// for the read of the time stamp and invoking the OP Code can be detected as Malware by some anti-virus vendors.
// https://github.com/zeromq/netmq/issues/1071
string val = Environment.GetEnvironmentVariable("NETQM_SUPPRESS_RDTSC");
if (!string.IsNullOrEmpty(val))
return false;
#if NETSTANDARD || NET471_OR_GREATER
if (RuntimeInformation.ProcessArchitecture != Architecture.X86 &&
RuntimeInformation.ProcessArchitecture != Architecture.X64)
Expand Down

0 comments on commit ff606d3

Please sign in to comment.