From 1618f9a823cc5c62202fd25b3de941345fec24b3 Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Mon, 6 Feb 2017 07:28:18 -0800 Subject: [PATCH] Delete remaining security transparency annotations Commit migrated from https://github.com/dotnet/coreclr/commit/215fe870868f88f8566d53262c9924d58ea48f21 --- .../System.Globalization.Native/Interop.Casing.cs | 3 -- .../Interop.Collation.cs | 13 --------- .../Win32/SafeHandles/SafeFileHandle.Unix.cs | 3 -- .../System/Globalization/CalendarData.Unix.cs | 7 ----- .../System/Globalization/CultureData.Unix.cs | 7 ----- .../System/Globalization/DateTimeFormatInfo.cs | 2 -- .../corefx/System/Globalization/RegionInfo.cs | 2 -- .../corefx/System/Globalization/TextInfo.Unix.cs | 2 -- src/coreclr/src/mscorlib/src/System/AppDomain.cs | 2 -- src/coreclr/src/mscorlib/src/System/DateTime.cs | 1 - .../Diagnostics/Eventing/FrameworkEventSource.cs | 28 +++++++++--------- .../Diagnostics/Eventing/XplatEventLogger.cs | 2 -- .../src/mscorlib/src/System/Reflection/Assembly.cs | 1 - .../System/Runtime/InteropServices/NonPortable.cs | 33 ---------------------- .../src/System/Threading/Tasks/TPLETWProvider.cs | 4 +-- 15 files changed, 16 insertions(+), 94 deletions(-) diff --git a/src/coreclr/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.Casing.cs b/src/coreclr/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.Casing.cs index 115a839..769506b 100644 --- a/src/coreclr/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.Casing.cs +++ b/src/coreclr/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.Casing.cs @@ -11,15 +11,12 @@ internal static partial class Interop { internal static partial class GlobalizationInterop { - [SecurityCritical] [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_ChangeCase")] internal unsafe static extern void ChangeCase(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, bool bToUpper); - [SecurityCritical] [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_ChangeCaseInvariant")] internal unsafe static extern void ChangeCaseInvariant(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, bool bToUpper); - [SecurityCritical] [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_ChangeCaseTurkish")] internal unsafe static extern void ChangeCaseTurkish(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, bool bToUpper); } diff --git a/src/coreclr/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.Collation.cs b/src/coreclr/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.Collation.cs index eb9e074..25585c6 100644 --- a/src/coreclr/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.Collation.cs +++ b/src/coreclr/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.Collation.cs @@ -11,52 +11,41 @@ internal static partial class Interop { internal static partial class GlobalizationInterop { - [SecurityCritical] [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetSortHandle")] internal unsafe static extern ResultCode GetSortHandle(byte[] localeName, out SafeSortHandle sortHandle); - [SecurityCritical] [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_CloseSortHandle")] internal unsafe static extern void CloseSortHandle(IntPtr handle); - [SecurityCritical] [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_CompareString")] internal unsafe static extern int CompareString(SafeSortHandle sortHandle, char* lpStr1, int cwStr1Len, char* lpStr2, int cwStr2Len, CompareOptions options); - [SecurityCritical] [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_IndexOf")] internal unsafe static extern int IndexOf(SafeSortHandle sortHandle, string target, int cwTargetLength, char* pSource, int cwSourceLength, CompareOptions options); - [SecurityCritical] [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_LastIndexOf")] internal unsafe static extern int LastIndexOf(SafeSortHandle sortHandle, string target, int cwTargetLength, char* pSource, int cwSourceLength, CompareOptions options); - [SecurityCritical] [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_IndexOfOrdinalIgnoreCase")] internal unsafe static extern int IndexOfOrdinalIgnoreCase(string target, int cwTargetLength, char* pSource, int cwSourceLength, bool findLast); - [SecurityCritical] [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_StartsWith")] [return: MarshalAs(UnmanagedType.Bool)] internal unsafe static extern bool StartsWith(SafeSortHandle sortHandle, string target, int cwTargetLength, string source, int cwSourceLength, CompareOptions options); - [SecurityCritical] [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_EndsWith")] [return: MarshalAs(UnmanagedType.Bool)] internal unsafe static extern bool EndsWith(SafeSortHandle sortHandle, string target, int cwTargetLength, string source, int cwSourceLength, CompareOptions options); - [SecurityCritical] [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetSortKey")] internal unsafe static extern int GetSortKey(SafeSortHandle sortHandle, string str, int strLength, byte* sortKey, int sortKeyLength, CompareOptions options); - [SecurityCritical] [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_CompareStringOrdinalIgnoreCase")] internal unsafe static extern int CompareStringOrdinalIgnoreCase(char* lpStr1, int cwStr1Len, char* lpStr2, int cwStr2Len); [DllImport(Libraries.GlobalizationInterop, EntryPoint = "GlobalizationNative_GetSortVersion")] internal static extern int GetSortVersion(); - [SecurityCritical] internal class SafeSortHandle : SafeHandle { private SafeSortHandle() : @@ -66,11 +55,9 @@ internal static partial class Interop public override bool IsInvalid { - [SecurityCritical] get { return handle == IntPtr.Zero; } } - [SecurityCritical] protected override bool ReleaseHandle() { CloseSortHandle(handle); diff --git a/src/coreclr/src/mscorlib/corefx/Microsoft/Win32/SafeHandles/SafeFileHandle.Unix.cs b/src/coreclr/src/mscorlib/corefx/Microsoft/Win32/SafeHandles/SafeFileHandle.Unix.cs index 5ddb31a..d13b536 100644 --- a/src/coreclr/src/mscorlib/corefx/Microsoft/Win32/SafeHandles/SafeFileHandle.Unix.cs +++ b/src/coreclr/src/mscorlib/corefx/Microsoft/Win32/SafeHandles/SafeFileHandle.Unix.cs @@ -8,7 +8,6 @@ using System.Runtime.InteropServices; namespace Microsoft.Win32.SafeHandles { - [System.Security.SecurityCritical] public sealed class SafeFileHandle : SafeHandleZeroOrMinusOneIsInvalid { /// A handle value of -1. @@ -83,7 +82,6 @@ namespace Microsoft.Win32.SafeHandles return handle; } - [System.Security.SecurityCritical] protected override bool ReleaseHandle() { // When the SafeFileHandle was opened, we likely issued an flock on the created descriptor in order to add @@ -111,7 +109,6 @@ namespace Microsoft.Win32.SafeHandles public override bool IsInvalid { - [System.Security.SecurityCritical] get { long h = (long)handle; diff --git a/src/coreclr/src/mscorlib/corefx/System/Globalization/CalendarData.Unix.cs b/src/coreclr/src/mscorlib/corefx/System/Globalization/CalendarData.Unix.cs index 270d62f..19c81f1 100644 --- a/src/coreclr/src/mscorlib/corefx/System/Globalization/CalendarData.Unix.cs +++ b/src/coreclr/src/mscorlib/corefx/System/Globalization/CalendarData.Unix.cs @@ -64,7 +64,6 @@ namespace System.Globalization } // Call native side to figure out which calendars are allowed - [SecuritySafeCritical] internal static int GetCalendars(string localeName, bool useUserOverride, CalendarId[] calendars) { // NOTE: there are no 'user overrides' on Linux @@ -87,7 +86,6 @@ namespace System.Globalization // PAL Layer ends here - [SecuritySafeCritical] private static bool GetCalendarInfo(string localeName, CalendarId calendarId, CalendarDataType dataType, out string calendarString) { return Interop.CallStringMethod( @@ -239,7 +237,6 @@ namespace System.Globalization return index - startIndex; } - [SecuritySafeCritical] private static bool EnumMonthNames(string localeName, CalendarId calendarId, CalendarDataType dataType, out string[] monthNames) { monthNames = null; @@ -261,7 +258,6 @@ namespace System.Globalization return result; } - [SecuritySafeCritical] private static bool EnumEraNames(string localeName, CalendarId calendarId, CalendarDataType dataType, out string[] eraNames) { bool result = EnumCalendarInfo(localeName, calendarId, dataType, out eraNames); @@ -277,7 +273,6 @@ namespace System.Globalization return result; } - [SecuritySafeCritical] internal static bool EnumCalendarInfo(string localeName, CalendarId calendarId, CalendarDataType dataType, out string[] calendarData) { calendarData = null; @@ -292,7 +287,6 @@ namespace System.Globalization return result; } - [SecuritySafeCritical] private static bool EnumCalendarInfo(string localeName, CalendarId calendarId, CalendarDataType dataType, CallbackContext callbackContext) { GCHandle context = GCHandle.Alloc(callbackContext); @@ -306,7 +300,6 @@ namespace System.Globalization } } - [SecuritySafeCritical] private static void EnumCalendarInfoCallback(string calendarString, IntPtr context) { CallbackContext callbackContext = (CallbackContext)((GCHandle)context).Target; diff --git a/src/coreclr/src/mscorlib/corefx/System/Globalization/CultureData.Unix.cs b/src/coreclr/src/mscorlib/corefx/System/Globalization/CultureData.Unix.cs index 7f2f17d..ba96189 100644 --- a/src/coreclr/src/mscorlib/corefx/System/Globalization/CultureData.Unix.cs +++ b/src/coreclr/src/mscorlib/corefx/System/Globalization/CultureData.Unix.cs @@ -24,7 +24,6 @@ namespace System.Globalization /// This method uses the sRealName field (which is initialized by the constructor before this is called) to /// initialize the rest of the state of CultureData based on the underlying OS globalization library. /// - [SecuritySafeCritical] private unsafe bool InitCultureData() { Debug.Assert(_sRealName != null); @@ -87,7 +86,6 @@ namespace System.Globalization return true; } - [SecuritySafeCritical] internal static bool GetLocaleName(string localeName, out string windowsName) { // Get the locale name from ICU @@ -104,7 +102,6 @@ namespace System.Globalization return true; } - [SecuritySafeCritical] internal static bool GetDefaultLocaleName(out string windowsName) { // Get the default (system) locale name from ICU @@ -129,7 +126,6 @@ namespace System.Globalization // For LOCALE_SPARENT we need the option of using the "real" name (forcing neutral names) instead of the // "windows" name, which can be specific for downlevel (< windows 7) os's. - [SecuritySafeCritical] private string GetLocaleInfo(string localeName, LocaleStringData type) { Debug.Assert(localeName != null, "[CultureData.GetLocaleInfo] Expected localeName to be not be null"); @@ -155,7 +151,6 @@ namespace System.Globalization return StringBuilderCache.GetStringAndRelease(sb); } - [SecuritySafeCritical] private int GetLocaleInfo(LocaleNumberData type) { Debug.Assert(_sWindowsName != null, "[CultureData.GetLocaleInfo(LocaleNumberData)] Expected _sWindowsName to be populated already"); @@ -179,7 +174,6 @@ namespace System.Globalization return value; } - [SecuritySafeCritical] private int[] GetLocaleInfo(LocaleGroupingData type) { Debug.Assert(_sWindowsName != null, "[CultureData.GetLocaleInfo(LocaleGroupingData)] Expected _sWindowsName to be populated already"); @@ -205,7 +199,6 @@ namespace System.Globalization return GetTimeFormatString(false); } - [SecuritySafeCritical] private string GetTimeFormatString(bool shortFormat) { Debug.Assert(_sWindowsName != null, "[CultureData.GetTimeFormatString(bool shortFormat)] Expected _sWindowsName to be populated already"); diff --git a/src/coreclr/src/mscorlib/corefx/System/Globalization/DateTimeFormatInfo.cs b/src/coreclr/src/mscorlib/corefx/System/Globalization/DateTimeFormatInfo.cs index 3811974..b79ce90 100644 --- a/src/coreclr/src/mscorlib/corefx/System/Globalization/DateTimeFormatInfo.cs +++ b/src/coreclr/src/mscorlib/corefx/System/Globalization/DateTimeFormatInfo.cs @@ -514,7 +514,6 @@ namespace System.Globalization public String AMDesignator { - // auto-generated get { if (this.amDesignator == null) @@ -1031,7 +1030,6 @@ namespace System.Globalization public String PMDesignator { - // auto-generated get { if (this.pmDesignator == null) diff --git a/src/coreclr/src/mscorlib/corefx/System/Globalization/RegionInfo.cs b/src/coreclr/src/mscorlib/corefx/System/Globalization/RegionInfo.cs index 0645ded..15679d24 100644 --- a/src/coreclr/src/mscorlib/corefx/System/Globalization/RegionInfo.cs +++ b/src/coreclr/src/mscorlib/corefx/System/Globalization/RegionInfo.cs @@ -87,7 +87,6 @@ namespace System.Globalization SetName(name); } - [System.Security.SecuritySafeCritical] // auto-generated public RegionInfo(int culture) { if (culture == CultureInfo.LOCALE_INVARIANT) //The InvariantCulture has no matching region @@ -132,7 +131,6 @@ namespace System.Globalization [OnSerializing] private void OnSerializing(StreamingContext ctx) { } - [System.Security.SecurityCritical] // auto-generated [OnDeserialized] private void OnDeserialized(StreamingContext ctx) { diff --git a/src/coreclr/src/mscorlib/corefx/System/Globalization/TextInfo.Unix.cs b/src/coreclr/src/mscorlib/corefx/System/Globalization/TextInfo.Unix.cs index 3d9b777..67836d8 100644 --- a/src/coreclr/src/mscorlib/corefx/System/Globalization/TextInfo.Unix.cs +++ b/src/coreclr/src/mscorlib/corefx/System/Globalization/TextInfo.Unix.cs @@ -33,7 +33,6 @@ namespace System.Globalization { } - [SecuritySafeCritical] private unsafe string ChangeCase(string s, bool toUpper) { Debug.Assert(s != null); @@ -78,7 +77,6 @@ namespace System.Globalization return result; } - [SecuritySafeCritical] private unsafe char ChangeCase(char c, bool toUpper) { char dst = default(char); diff --git a/src/coreclr/src/mscorlib/src/System/AppDomain.cs b/src/coreclr/src/mscorlib/src/System/AppDomain.cs index 023ee61..51f4ae0 100644 --- a/src/coreclr/src/mscorlib/src/System/AppDomain.cs +++ b/src/coreclr/src/mscorlib/src/System/AppDomain.cs @@ -182,7 +182,6 @@ namespace System #pragma warning disable 169 private Object[] _Policies; // Called from the VM. #pragma warning restore 169 - [method: System.Security.SecurityCritical] public event AssemblyLoadEventHandler AssemblyLoad; private ResolveEventHandler _TypeResolve; @@ -249,7 +248,6 @@ namespace System } #if FEATURE_REFLECTION_ONLY_LOAD - [method: System.Security.SecurityCritical] public event ResolveEventHandler ReflectionOnlyAssemblyResolve; #endif // FEATURE_REFLECTION_ONLY diff --git a/src/coreclr/src/mscorlib/src/System/DateTime.cs b/src/coreclr/src/mscorlib/src/System/DateTime.cs index b18ac4a..1d46183 100644 --- a/src/coreclr/src/mscorlib/src/System/DateTime.cs +++ b/src/coreclr/src/mscorlib/src/System/DateTime.cs @@ -663,7 +663,6 @@ namespace System { return new DateTime(DoubleDateToTicks(d), DateTimeKind.Unspecified); } - [System.Security.SecurityCritical /*auto-generated_required*/] void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { if (info==null) { throw new ArgumentNullException(nameof(info)); diff --git a/src/coreclr/src/mscorlib/src/System/Diagnostics/Eventing/FrameworkEventSource.cs b/src/coreclr/src/mscorlib/src/System/Diagnostics/Eventing/FrameworkEventSource.cs index 6d3e28f..3ace9c3 100644 --- a/src/coreclr/src/mscorlib/src/System/Diagnostics/Eventing/FrameworkEventSource.cs +++ b/src/coreclr/src/mscorlib/src/System/Diagnostics/Eventing/FrameworkEventSource.cs @@ -86,7 +86,7 @@ namespace System.Diagnostics.Tracing { // WriteEvent overloads (to avoid the "params" EventSource.WriteEvent // optimized for common signatures (used by the ThreadTransferSend/Receive events) - [NonEvent, System.Security.SecuritySafeCritical] + [NonEvent] [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "This does not need to be correct when racing with other threads")] private unsafe void WriteEvent(int eventId, long arg1, int arg2, string arg3, bool arg4) { @@ -110,7 +110,7 @@ namespace System.Diagnostics.Tracing { } // optimized for common signatures (used by the ThreadTransferSend/Receive events) - [NonEvent, System.Security.SecuritySafeCritical] + [NonEvent] [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "This does not need to be correct when racing with other threads")] private unsafe void WriteEvent(int eventId, long arg1, int arg2, string arg3) { @@ -132,7 +132,7 @@ namespace System.Diagnostics.Tracing { } // optimized for common signatures (used by the BeginGetResponse/BeginGetRequestStream events) - [NonEvent, System.Security.SecuritySafeCritical] + [NonEvent] [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "This does not need to be correct when racing with other threads")] private unsafe void WriteEvent(int eventId, long arg1, string arg2, bool arg3, bool arg4) { @@ -156,7 +156,7 @@ namespace System.Diagnostics.Tracing { } // optimized for common signatures (used by the EndGetRequestStream event) - [NonEvent, System.Security.SecuritySafeCritical] + [NonEvent] [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "This does not need to be correct when racing with other threads")] private unsafe void WriteEvent(int eventId, long arg1, bool arg2, bool arg3) { @@ -174,7 +174,7 @@ namespace System.Diagnostics.Tracing { } // optimized for common signatures (used by the EndGetResponse event) - [NonEvent, System.Security.SecuritySafeCritical] + [NonEvent] [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "This does not need to be correct when racing with other threads")] private unsafe void WriteEvent(int eventId, long arg1, bool arg2, bool arg3, int arg4) { @@ -479,7 +479,7 @@ namespace System.Diagnostics.Tracing { public void ThreadPoolEnqueueWork(long workID) { WriteEvent(30, workID); } - [NonEvent, System.Security.SecuritySafeCritical] + [NonEvent] public unsafe void ThreadPoolEnqueueWorkObject(object workID) { // convert the Object Id to a long ThreadPoolEnqueueWork((long) *((void**) JitHelpers.UnsafeCastToStackPointer(ref workID))); @@ -490,7 +490,7 @@ namespace System.Diagnostics.Tracing { WriteEvent(31, workID); } - [NonEvent, System.Security.SecuritySafeCritical] + [NonEvent] public unsafe void ThreadPoolDequeueWorkObject(object workID) { // convert the Object Id to a long ThreadPoolDequeueWork((long) *((void**) JitHelpers.UnsafeCastToStackPointer(ref workID))); @@ -524,25 +524,25 @@ namespace System.Diagnostics.Tracing { WriteEvent(143, id, success, synchronous); } - [NonEvent, System.Security.SecuritySafeCritical] + [NonEvent] public unsafe void BeginGetResponse(object id, string uri, bool success, bool synchronous) { if (IsEnabled()) GetResponseStart(IdForObject(id), uri, success, synchronous); } - [NonEvent, System.Security.SecuritySafeCritical] + [NonEvent] public unsafe void EndGetResponse(object id, bool success, bool synchronous, int statusCode) { if (IsEnabled()) GetResponseStop(IdForObject(id), success, synchronous, statusCode); } - [NonEvent, System.Security.SecuritySafeCritical] + [NonEvent] public unsafe void BeginGetRequestStream(object id, string uri, bool success, bool synchronous) { if (IsEnabled()) GetRequestStreamStart(IdForObject(id), uri, success, synchronous); } - [NonEvent, System.Security.SecuritySafeCritical] + [NonEvent] public unsafe void EndGetRequestStream(object id, bool success, bool synchronous) { if (IsEnabled()) GetRequestStreamStop(IdForObject(id), success, synchronous); @@ -563,7 +563,7 @@ namespace System.Diagnostics.Tracing { // id - is a managed object. it gets translated to the object's address. ETW listeners must // keep track of GC movements in order to correlate the value passed to XyzSend with the // (possibly changed) value passed to XyzReceive - [NonEvent, System.Security.SecuritySafeCritical] + [NonEvent] public unsafe void ThreadTransferSendObj(object id, int kind, string info, bool multiDequeues) { ThreadTransferSend((long) *((void**) JitHelpers.UnsafeCastToStackPointer(ref id)), kind, info, multiDequeues); } @@ -583,7 +583,7 @@ namespace System.Diagnostics.Tracing { // id - is a managed object. it gets translated to the object's address. ETW listeners must // keep track of GC movements in order to correlate the value passed to XyzSend with the // (possibly changed) value passed to XyzReceive - [NonEvent, System.Security.SecuritySafeCritical] + [NonEvent] public unsafe void ThreadTransferReceiveObj(object id, int kind, string info) { ThreadTransferReceive((long) *((void**) JitHelpers.UnsafeCastToStackPointer(ref id)), kind, info); } @@ -603,7 +603,7 @@ namespace System.Diagnostics.Tracing { // id - is a managed object. it gets translated to the object's address. ETW listeners must // keep track of GC movements in order to correlate the value passed to XyzSend with the // (possibly changed) value passed to XyzReceive - [NonEvent, System.Security.SecuritySafeCritical] + [NonEvent] public unsafe void ThreadTransferReceiveHandledObj(object id, int kind, string info) { ThreadTransferReceive((long) *((void**) JitHelpers.UnsafeCastToStackPointer(ref id)), kind, info); } diff --git a/src/coreclr/src/mscorlib/src/System/Diagnostics/Eventing/XplatEventLogger.cs b/src/coreclr/src/mscorlib/src/System/Diagnostics/Eventing/XplatEventLogger.cs index c96d212..00155d7 100644 --- a/src/coreclr/src/mscorlib/src/System/Diagnostics/Eventing/XplatEventLogger.cs +++ b/src/coreclr/src/mscorlib/src/System/Diagnostics/Eventing/XplatEventLogger.cs @@ -23,7 +23,6 @@ namespace System.Diagnostics.Tracing private static bool initializedPersistentListener = false; - [System.Security.SecuritySafeCritical] public static EventListener InitializePersistentListener() { try{ @@ -150,7 +149,6 @@ namespace System.Diagnostics.Tracing } } - [System.Security.SecuritySafeCritical] private void LogOnEventWritten(EventWrittenEventArgs eventData) { string payload = ""; diff --git a/src/coreclr/src/mscorlib/src/System/Reflection/Assembly.cs b/src/coreclr/src/mscorlib/src/System/Reflection/Assembly.cs index 09c3011..0101efe 100644 --- a/src/coreclr/src/mscorlib/src/System/Reflection/Assembly.cs +++ b/src/coreclr/src/mscorlib/src/System/Reflection/Assembly.cs @@ -781,7 +781,6 @@ namespace System.Reflection internal RuntimeAssembly() { throw new NotSupportedException(); } #region private data members - [method: System.Security.SecurityCritical] private event ModuleResolveEventHandler _ModuleResolve; private string m_fullname; private object m_syncRoot; // Used to keep collectible types alive and as the syncroot for reflection.emit diff --git a/src/coreclr/src/mscorlib/src/System/Runtime/InteropServices/NonPortable.cs b/src/coreclr/src/mscorlib/src/System/Runtime/InteropServices/NonPortable.cs index 0c8ae76..ae97446 100644 --- a/src/coreclr/src/mscorlib/src/System/Runtime/InteropServices/NonPortable.cs +++ b/src/coreclr/src/mscorlib/src/System/Runtime/InteropServices/NonPortable.cs @@ -8,91 +8,76 @@ namespace System.Runtime.InteropServices { public static partial class Marshal { - [System.Security.SecurityCritical] public static int GetHRForException(Exception e) { return (e != null) ? e.HResult : 0; } - [System.Security.SecurityCriticalAttribute] public static int AddRef(System.IntPtr pUnk) { throw new PlatformNotSupportedException(); } - [System.Security.SecurityCriticalAttribute] public static bool AreComObjectsAvailableForCleanup() { return false; } - [System.Security.SecurityCriticalAttribute] public static System.IntPtr CreateAggregatedObject(System.IntPtr pOuter, object o) { throw new PlatformNotSupportedException(); } - [System.Security.SecurityCriticalAttribute] public static Object BindToMoniker(String monikerName) { throw new PlatformNotSupportedException(); } - [System.Security.SecurityCriticalAttribute] public static void CleanupUnusedObjectsInCurrentContext() { return; } - [System.Security.SecurityCriticalAttribute] public static System.IntPtr CreateAggregatedObject(System.IntPtr pOuter, T o) { throw new PlatformNotSupportedException(); } - [System.Security.SecurityCriticalAttribute] public static object CreateWrapperOfType(object o, System.Type t) { throw new PlatformNotSupportedException(); } - [System.Security.SecurityCriticalAttribute] public static TWrapper CreateWrapperOfType(T o) { throw new PlatformNotSupportedException(); } - [System.Security.SecurityCriticalAttribute] public static void ChangeWrapperHandleStrength(Object otp, bool fIsWeak) { throw new PlatformNotSupportedException(); } - [System.Security.SecurityCriticalAttribute] public static int FinalReleaseComObject(object o) { throw new PlatformNotSupportedException(); } - [System.Security.SecurityCriticalAttribute] public static System.IntPtr GetComInterfaceForObject(object o, System.Type T) { throw new PlatformNotSupportedException(); } - [System.Security.SecurityCriticalAttribute] public static System.IntPtr GetComInterfaceForObject(object o, System.Type T, System.Runtime.InteropServices.CustomQueryInterfaceMode mode) { throw new PlatformNotSupportedException(); } - [System.Security.SecurityCriticalAttribute] public static System.IntPtr GetComInterfaceForObject(T o) { throw new PlatformNotSupportedException(); } - [System.Security.SecurityCriticalAttribute] public static System.IntPtr GetHINSTANCE(System.Reflection.Module m) { if (m == null) @@ -102,61 +87,51 @@ namespace System.Runtime.InteropServices return (System.IntPtr) (-1); } - [System.Security.SecurityCriticalAttribute] public static System.IntPtr GetIUnknownForObject(object o) { throw new PlatformNotSupportedException(); } - [System.Security.SecurityCriticalAttribute] public static void GetNativeVariantForObject(object obj, System.IntPtr pDstNativeVariant) { throw new PlatformNotSupportedException(); } - [System.Security.SecurityCriticalAttribute] public static void GetNativeVariantForObject(T obj, System.IntPtr pDstNativeVariant) { throw new PlatformNotSupportedException(); } - [System.Security.SecurityCriticalAttribute] public static Object GetTypedObjectForIUnknown(System.IntPtr pUnk, System.Type t) { throw new PlatformNotSupportedException(); } - [System.Security.SecurityCriticalAttribute] public static object GetObjectForIUnknown(System.IntPtr pUnk) { throw new PlatformNotSupportedException(); } - [System.Security.SecurityCriticalAttribute] public static object GetObjectForNativeVariant(System.IntPtr pSrcNativeVariant) { throw new PlatformNotSupportedException(); } - [System.Security.SecurityCriticalAttribute] public static T GetObjectForNativeVariant(System.IntPtr pSrcNativeVariant) { throw new PlatformNotSupportedException(); } - [System.Security.SecurityCriticalAttribute] public static object[] GetObjectsForNativeVariants(System.IntPtr aSrcNativeVariant, int cVars) { throw new PlatformNotSupportedException(); } - [System.Security.SecurityCriticalAttribute] public static T[] GetObjectsForNativeVariants(System.IntPtr aSrcNativeVariant, int cVars) { throw new PlatformNotSupportedException(); } - [System.Security.SecurityCriticalAttribute] public static int GetStartComSlot(System.Type t) { throw new PlatformNotSupportedException(); @@ -167,13 +142,11 @@ namespace System.Runtime.InteropServices throw new PlatformNotSupportedException(); } - [System.Security.SecurityCriticalAttribute] public static string GetTypeInfoName(System.Runtime.InteropServices.ComTypes.ITypeInfo typeInfo) { throw new PlatformNotSupportedException(); } - [System.Security.SecurityCriticalAttribute] public static object GetUniqueObjectForIUnknown(System.IntPtr unknown) { throw new PlatformNotSupportedException(); @@ -184,25 +157,21 @@ namespace System.Runtime.InteropServices return false; } - [System.Security.SecurityCriticalAttribute] public static int QueryInterface(System.IntPtr pUnk, ref System.Guid iid, out System.IntPtr ppv) { throw new PlatformNotSupportedException(); } - [System.Security.SecurityCriticalAttribute] public static int Release(System.IntPtr pUnk) { throw new PlatformNotSupportedException(); } - [System.Security.SecurityCriticalAttribute] public static int ReleaseComObject(object o) { throw new PlatformNotSupportedException(); } - [System.Security.SecurityCriticalAttribute] public static void ZeroFreeBSTR(System.IntPtr s) { throw new PlatformNotSupportedException(); @@ -227,13 +196,11 @@ namespace System.Runtime.InteropServices public static class ComEventsHelper { - [System.Security.SecurityCriticalAttribute] public static void Combine(object rcw, System.Guid iid, int dispid, System.Delegate d) { throw new PlatformNotSupportedException(); } - [System.Security.SecurityCriticalAttribute] public static System.Delegate Remove(object rcw, System.Guid iid, int dispid, System.Delegate d) { throw new PlatformNotSupportedException(); diff --git a/src/coreclr/src/mscorlib/src/System/Threading/Tasks/TPLETWProvider.cs b/src/coreclr/src/mscorlib/src/System/Threading/Tasks/TPLETWProvider.cs index def3f68..c14fb29 100644 --- a/src/coreclr/src/mscorlib/src/System/Threading/Tasks/TPLETWProvider.cs +++ b/src/coreclr/src/mscorlib/src/System/Threading/Tasks/TPLETWProvider.cs @@ -490,7 +490,7 @@ namespace System.Threading.Tasks } } - [NonEvent, System.Security.SecuritySafeCritical] + [NonEvent] unsafe public void RunningContinuation(int TaskID, object Object) { RunningContinuation(TaskID, (long) *((void**) JitHelpers.UnsafeCastToStackPointer(ref Object))); } [Event(20, Keywords = Keywords.Debug)] private void RunningContinuation(int TaskID, long Object) @@ -499,7 +499,7 @@ namespace System.Threading.Tasks WriteEvent(20, TaskID, Object); } - [NonEvent, System.Security.SecuritySafeCritical] + [NonEvent] unsafe public void RunningContinuationList(int TaskID, int Index, object Object) { RunningContinuationList(TaskID, Index, (long) *((void**) JitHelpers.UnsafeCastToStackPointer(ref Object))); } [Event(21, Keywords = Keywords.Debug)] -- 2.7.4