diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 8d5ad209786d86..127ab32bbeca5e 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "microsoft.dotnet.xharness.cli": { - "version": "11.0.0-prerelease.26301.2", + "version": "11.0.0-prerelease.26353.1", "commands": [ "xharness" ] diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 98a16d0ac4977a..52c3e92c7ad680 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,9 +1,9 @@ - + https://github.com/dotnet/icu - 1ef686babc127f17a7e5614829b9a9b5431dd732 + be3dd61370b56cf0e0fadfb486cc3eafb82f910c https://github.com/dotnet/msquic @@ -55,14 +55,14 @@ 803d8598f98fb4efd94604b32627ee9407f246db - + https://github.com/dotnet/cecil - 5eaa92e08ad36a380888b6e99b4f6c09a5e24815 + d98c55d1363411ee1a0ff0c76c6e5d798e8147ec - + https://github.com/dotnet/cecil - 5eaa92e08ad36a380888b6e99b4f6c09a5e24815 + d98c55d1363411ee1a0ff0c76c6e5d798e8147ec @@ -80,9 +80,9 @@ - + https://github.com/dotnet/source-build-assets - 8e19a1b4f607fcbecc4edbd322d77a60d4e25c3c + 8af4d7484999046095bf7670641b25f2dbb158f0 @@ -175,57 +175,57 @@ https://github.com/dotnet/arcade efce34e9f9f25af27e2b471fbbf8c21f1ac2e318 - + https://github.com/dotnet/runtime-assets - 8705fbc3c9b3640c22953481d8a48b17cc1135e0 + 0255c0815603742a138342c524929c078ecf5cf4 - + https://github.com/dotnet/runtime-assets - 8705fbc3c9b3640c22953481d8a48b17cc1135e0 + 0255c0815603742a138342c524929c078ecf5cf4 - + https://github.com/dotnet/runtime-assets - 8705fbc3c9b3640c22953481d8a48b17cc1135e0 + 0255c0815603742a138342c524929c078ecf5cf4 - + https://github.com/dotnet/runtime-assets - 8705fbc3c9b3640c22953481d8a48b17cc1135e0 + 0255c0815603742a138342c524929c078ecf5cf4 - + https://github.com/dotnet/runtime-assets - 8705fbc3c9b3640c22953481d8a48b17cc1135e0 + 0255c0815603742a138342c524929c078ecf5cf4 - + https://github.com/dotnet/runtime-assets - 8705fbc3c9b3640c22953481d8a48b17cc1135e0 + 0255c0815603742a138342c524929c078ecf5cf4 - + https://github.com/dotnet/runtime-assets - 8705fbc3c9b3640c22953481d8a48b17cc1135e0 + 0255c0815603742a138342c524929c078ecf5cf4 - + https://github.com/dotnet/runtime-assets - 8705fbc3c9b3640c22953481d8a48b17cc1135e0 + 0255c0815603742a138342c524929c078ecf5cf4 - + https://github.com/dotnet/runtime-assets - 8705fbc3c9b3640c22953481d8a48b17cc1135e0 + 0255c0815603742a138342c524929c078ecf5cf4 - + https://github.com/dotnet/runtime-assets - 8705fbc3c9b3640c22953481d8a48b17cc1135e0 + 0255c0815603742a138342c524929c078ecf5cf4 - + https://github.com/dotnet/runtime-assets - 8705fbc3c9b3640c22953481d8a48b17cc1135e0 + 0255c0815603742a138342c524929c078ecf5cf4 - + https://github.com/dotnet/runtime-assets - 8705fbc3c9b3640c22953481d8a48b17cc1135e0 + 0255c0815603742a138342c524929c078ecf5cf4 - + https://github.com/dotnet/runtime-assets - 8705fbc3c9b3640c22953481d8a48b17cc1135e0 + 0255c0815603742a138342c524929c078ecf5cf4 https://github.com/dotnet/llvm-project @@ -321,17 +321,17 @@ https://github.com/dotnet/runtime b030c4dfdfa1bf287f10f96006619a06bc2000ae - + https://github.com/dotnet/xharness - fa7fbebf9168e8858971f9d0c71b2b08f2f7b106 + 4da0015e9dd1ed7d3992db7d1eb6878a5ee11ab2 - + https://github.com/dotnet/xharness - fa7fbebf9168e8858971f9d0c71b2b08f2f7b106 + 4da0015e9dd1ed7d3992db7d1eb6878a5ee11ab2 - + https://github.com/dotnet/xharness - fa7fbebf9168e8858971f9d0c71b2b08f2f7b106 + 4da0015e9dd1ed7d3992db7d1eb6878a5ee11ab2 https://github.com/dotnet/arcade @@ -357,9 +357,9 @@ https://github.com/dotnet/hotreload-utils 89bc3f1e2272db405757426e0870e8243b2efdd1 - + https://github.com/dotnet/runtime-assets - 8705fbc3c9b3640c22953481d8a48b17cc1135e0 + 0255c0815603742a138342c524929c078ecf5cf4 https://github.com/dotnet/roslyn diff --git a/eng/Versions.props b/eng/Versions.props index 08afe01a5f2448..ccd61361e72c21 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -146,20 +146,20 @@ 8.0.0 4.5.4 - 9.0.0-beta.26302.4 - 9.0.0-beta.26302.4 - 9.0.0-beta.26302.4 - 9.0.0-beta.26302.4 - 9.0.0-beta.26302.4 - 9.0.0-beta.26302.4 - 9.0.0-beta.26302.4 - 9.0.0-beta.26302.4 - 9.0.0-beta.26302.4 - 9.0.0-beta.26302.4 - 9.0.0-beta.26302.4 - 9.0.0-beta.26302.4 - 9.0.0-beta.26302.4 - 9.0.0-beta.26302.4 + 9.0.0-beta.26330.2 + 9.0.0-beta.26330.2 + 9.0.0-beta.26330.2 + 9.0.0-beta.26330.2 + 9.0.0-beta.26330.2 + 9.0.0-beta.26330.2 + 9.0.0-beta.26330.2 + 9.0.0-beta.26330.2 + 9.0.0-beta.26330.2 + 9.0.0-beta.26330.2 + 9.0.0-beta.26330.2 + 9.0.0-beta.26330.2 + 9.0.0-beta.26330.2 + 9.0.0-beta.26330.2 1.0.0-prerelease.24462.2 1.0.0-prerelease.24462.2 @@ -190,9 +190,9 @@ 1.4.0 17.4.0-preview-20220707-01 - 11.0.0-prerelease.26301.2 - 11.0.0-prerelease.26301.2 - 11.0.0-prerelease.26301.2 + 11.0.0-prerelease.26353.1 + 11.0.0-prerelease.26353.1 + 11.0.0-prerelease.26353.1 9.0.0-alpha.0.26202.3 3.12.0 @@ -222,13 +222,13 @@ 9.0.0-preview-20241010.1 - 0.11.5-alpha.26307.3 + 0.11.5-alpha.26353.2 9.0.0-rtm.24511.16 - 9.0.0-rtm.26278.1 + 9.0.0-rtm.26358.1 - 2.4.18 + 2.5.9 19.1.0-alpha.1.26329.2 19.1.0-alpha.1.26329.2 diff --git a/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarEntry.cs b/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarEntry.cs index 4883f9775e2d67..6441b4c3b98368 100644 --- a/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarEntry.cs +++ b/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarEntry.cs @@ -351,7 +351,6 @@ internal Task ExtractRelativeToDirectoryAsync(string destinationDirectoryPath, b string? fileDestinationPath = GetFullDestinationPath( destinationDirectoryPath, Path.IsPathFullyQualified(name) ? name : Path.Join(destinationDirectoryPath, name)); - if (fileDestinationPath is null || FilePathEscapesDirectory(destinationDirectoryPath, fileDestinationPath)) { throw new IOException(SR.Format(SR.TarExtractingResultsFileOutside, name, destinationDirectoryPath)); @@ -399,7 +398,9 @@ internal Task ExtractRelativeToDirectoryAsync(string destinationDirectoryPath, b return (fileDestinationPath, linkTargetPath); } - // Check if the file destination path or the link target path escapes the destination directory, by walking through the relative path components and resolving symlinks at each step. + // Prevent an archive from escaping the extraction root through symlinks that were created by earlier entries in the same archive. + // This protection applies only to links introduced by the archive itself. It is not intended to defend against preexisting symlinks + // already present on disk before extraction. private static bool FilePathEscapesDirectory(string destinationDirectoryPath, string fileDestinationPath) { // Windows is case insensitive while Linux is case sensitive @@ -409,6 +410,13 @@ private static bool FilePathEscapesDirectory(string destinationDirectoryPath, st : StringComparison.Ordinal; string resolvedDest = ResolvePhysicalPath(destinationDirectoryPath); + + // Use the logical destination path for computing the relative path + string logicalDest = Path.GetFullPath(destinationDirectoryPath); + string logicalPrefix = logicalDest.EndsWith(Path.DirectorySeparatorChar) + ? logicalDest + : logicalDest + Path.DirectorySeparatorChar; + string destPrefix = resolvedDest.EndsWith(Path.DirectorySeparatorChar) ? resolvedDest : resolvedDest + Path.DirectorySeparatorChar; @@ -416,9 +424,20 @@ private static bool FilePathEscapesDirectory(string destinationDirectoryPath, st // Normalize file path (resolves .. and . but not symlinks) string normalizedFile = Path.GetFullPath(fileDestinationPath); - // Walk relative components, resolving symlinks at each step - string relative = normalizedFile.Substring(resolvedDest.Length) - .TrimStart(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); + // Guard with StartsWith before computing relative path + if (!normalizedFile.StartsWith(logicalPrefix, pathComparison) && + !normalizedFile.Equals(logicalDest, pathComparison)) + { + return true; + } + + // Walk relative components, resolving symlinks at each step. + // When the file resolves to the destination directory itself, there are no components to walk, + // so the relative path is empty. Guarding here avoids an out-of-range Substring on the prefix length. + string relative = normalizedFile.Equals(logicalDest, pathComparison) + ? string.Empty + : normalizedFile.Substring(logicalPrefix.Length) + .TrimStart(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); string[] components = relative.Split(new char[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries); @@ -428,16 +447,7 @@ private static bool FilePathEscapesDirectory(string destinationDirectoryPath, st foreach (string component in components) { current = Path.Combine(current, component); - - if (Path.Exists(current)) - { - string? resolved = ResolveSymlink(current); - if (resolved is null) - { - return true; - } - current = resolved; - } + current = ResolveSymlink(current); string normalizedCurrent = Path.GetFullPath(current); if (!normalizedCurrent.StartsWith(destPrefix, pathComparison) && @@ -450,15 +460,18 @@ private static bool FilePathEscapesDirectory(string destinationDirectoryPath, st return false; } - private static string? ResolveSymlink(string path) + private static string ResolveSymlink(string path) { - FileSystemInfo? target = new FileInfo(path).ResolveLinkTarget(returnFinalTarget: true); + var info = new FileInfo(path); - if (target is null) + // Check LinkTarget first so dangling symlinks/junctions (whose final target doesn't exist yet) + // are still resolved to their raw target, rather than being treated as a non-link. + if (info.LinkTarget is null) { return Path.GetFullPath(path); } + FileSystemInfo target = info.ResolveLinkTarget(returnFinalTarget: true) ?? info; return target.FullName; } @@ -482,12 +495,7 @@ private static string ResolvePhysicalPath(string path) current = Path.Combine(current, component); if (Path.Exists(current)) { - string? resolved = ResolveSymlink(current); - if (resolved is null) - { - return current; - } - current = resolved; + current = ResolveSymlink(current); } } diff --git a/src/libraries/System.Formats.Tar/tests/TarFile/TarFile.ExtractToDirectory.File.Tests.cs b/src/libraries/System.Formats.Tar/tests/TarFile/TarFile.ExtractToDirectory.File.Tests.cs index 3a13231df0ad1f..d6483b8444b1c6 100644 --- a/src/libraries/System.Formats.Tar/tests/TarFile/TarFile.ExtractToDirectory.File.Tests.cs +++ b/src/libraries/System.Formats.Tar/tests/TarFile/TarFile.ExtractToDirectory.File.Tests.cs @@ -46,7 +46,6 @@ public void NonExistentDirectory_Throws() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/129227")] public void SetsLastModifiedTimeOnExtractedFiles() { using TempDirectory root = new TempDirectory(); @@ -74,7 +73,6 @@ public void SetsLastModifiedTimeOnExtractedFiles() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/129227")] public void SetsLastModifiedTimeOnExtractedDirectories() { using TempDirectory root = new TempDirectory(); @@ -211,7 +209,6 @@ public void Extract_AllSegmentsOfPath() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/129227")] public void ExtractArchiveWithEntriesThatStartWithSlashDotPrefix() { using TempDirectory root = new TempDirectory(); @@ -237,7 +234,6 @@ public void ExtractArchiveWithEntriesThatStartWithSlashDotPrefix() [Theory] [InlineData(true)] [InlineData(false)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/129227")] public void UnixFileModes(bool overwrite) { using TempDirectory source = new TempDirectory(); @@ -306,7 +302,6 @@ public void UnixFileModes(bool overwrite) [Theory] [InlineData(true)] [InlineData(false)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/129227")] public void UnixFileModes_RestrictiveParentDir(bool overwrite) { using TempDirectory source = new TempDirectory(); @@ -347,7 +342,6 @@ public void UnixFileModes_RestrictiveParentDir(bool overwrite) } [ConditionalFact(typeof(MountHelper), nameof(MountHelper.CanCreateSymbolicLinks))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/129227")] public void LinkBeforeTarget() { using TempDirectory source = new TempDirectory(); @@ -377,7 +371,6 @@ public void LinkBeforeTarget() } [ConditionalFact(typeof(MountHelper), nameof(MountHelper.CanCreateSymbolicLinks))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/129227")] public void ExtractToDirectory_RejectsSymlinkDirectoryTraversal_WithNestedFile() { using TempDirectory root = new TempDirectory(); @@ -419,7 +412,6 @@ public void ExtractToDirectory_RejectsSymlinkDirectoryTraversal_WithNestedFile() [ConditionalFact(typeof(MountHelper), nameof(MountHelper.CanCreateSymbolicLinks))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/129227")] public void ExtractToDirectory_RejectsChainedSymlinkDirectoryTraversal_WithNestedFile() { // dir a/ diff --git a/src/libraries/System.Formats.Tar/tests/TarFile/TarFile.ExtractToDirectory.Stream.Tests.cs b/src/libraries/System.Formats.Tar/tests/TarFile/TarFile.ExtractToDirectory.Stream.Tests.cs index bb4594c5640253..d8f6bfb1d2b2c4 100644 --- a/src/libraries/System.Formats.Tar/tests/TarFile/TarFile.ExtractToDirectory.Stream.Tests.cs +++ b/src/libraries/System.Formats.Tar/tests/TarFile/TarFile.ExtractToDirectory.Stream.Tests.cs @@ -76,7 +76,6 @@ public void ExtractEntry_ManySubfolderSegments_NoPrecedingDirectoryEntries() [Theory] [InlineData(TarEntryType.SymbolicLink)] [InlineData(TarEntryType.HardLink)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/129227")] public void Extract_LinkEntry_TargetOutsideDirectory(TarEntryType entryType) { using MemoryStream archive = new MemoryStream(); @@ -99,25 +98,21 @@ public void Extract_LinkEntry_TargetOutsideDirectory(TarEntryType entryType) [ConditionalTheory(typeof(MountHelper), nameof(MountHelper.CanCreateSymbolicLinks))] [InlineData(TarEntryFormat.Pax)] [InlineData(TarEntryFormat.Gnu)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/129227")] public void Extract_SymbolicLinkEntry_TargetInsideDirectory(TarEntryFormat format) => Extract_LinkEntry_TargetInsideDirectory_Internal(TarEntryType.SymbolicLink, format, null); [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.SupportsHardLinkCreation))] [InlineData(TarEntryFormat.Pax)] [InlineData(TarEntryFormat.Gnu)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/129227")] public void Extract_HardLinkEntry_TargetInsideDirectory(TarEntryFormat format) => Extract_LinkEntry_TargetInsideDirectory_Internal(TarEntryType.HardLink, format, null); [ConditionalTheory(typeof(MountHelper), nameof(MountHelper.CanCreateSymbolicLinks))] [InlineData(TarEntryFormat.Pax)] [InlineData(TarEntryFormat.Gnu)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/129227")] public void Extract_SymbolicLinkEntry_TargetInsideDirectory_LongBaseDir(TarEntryFormat format) => Extract_LinkEntry_TargetInsideDirectory_Internal(TarEntryType.SymbolicLink, format, new string('a', 99)); [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.SupportsHardLinkCreation))] [InlineData(TarEntryFormat.Pax)] [InlineData(TarEntryFormat.Gnu)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/129227")] public void Extract_HardLinkEntry_TargetInsideDirectory_LongBaseDir(TarEntryFormat format) => Extract_LinkEntry_TargetInsideDirectory_Internal(TarEntryType.HardLink, format, new string('a', 99)); // This test would not pass for the V7 and Ustar formats in some OSs like MacCatalyst, tvOSSimulator and OSX, because the TempDirectory gets created in @@ -157,7 +152,6 @@ private void Extract_LinkEntry_TargetInsideDirectory_Internal(TarEntryType entry [InlineData(512)] [InlineData(512 + 1)] [InlineData(512 + 512 - 1)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/129227")] public void Extract_UnseekableStream_BlockAlignmentPadding_DoesNotAffectNextEntries(int contentSize) { byte[] fileContents = new byte[contentSize]; @@ -214,7 +208,6 @@ public void PaxNameCollision_DedupInExtendedAttributes() [Theory] [MemberData(nameof(GetTestTarFormats))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/129227")] public void UnseekableStreams_RoundTrip(TestTarFormat testFormat) { using TempDirectory root = new(); diff --git a/src/libraries/System.Formats.Tar/tests/TarFile/TarFile.ExtractToDirectoryAsync.File.Tests.cs b/src/libraries/System.Formats.Tar/tests/TarFile/TarFile.ExtractToDirectoryAsync.File.Tests.cs index d692432f058bb7..42b0eef65eef87 100644 --- a/src/libraries/System.Formats.Tar/tests/TarFile/TarFile.ExtractToDirectoryAsync.File.Tests.cs +++ b/src/libraries/System.Formats.Tar/tests/TarFile/TarFile.ExtractToDirectoryAsync.File.Tests.cs @@ -57,7 +57,6 @@ public async Task NonExistentDirectory_Throws_Async() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/129227")] public async Task SetsLastModifiedTimeOnExtractedFiles() { using TempDirectory root = new TempDirectory(); @@ -85,7 +84,6 @@ public async Task SetsLastModifiedTimeOnExtractedFiles() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/129227")] public async Task SetsLastModifiedTimeOnExtractedDirectories() { using TempDirectory root = new TempDirectory(); @@ -238,7 +236,6 @@ public async Task Extract_AllSegmentsOfPath_Async() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/129227")] public async Task ExtractArchiveWithEntriesThatStartWithSlashDotPrefix_Async() { using (TempDirectory root = new TempDirectory()) @@ -267,7 +264,6 @@ public async Task ExtractArchiveWithEntriesThatStartWithSlashDotPrefix_Async() [Theory] [InlineData(true)] [InlineData(false)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/129227")] public async Task UnixFileModes_Async(bool overwrite) { using TempDirectory source = new TempDirectory(); @@ -334,7 +330,6 @@ public async Task UnixFileModes_Async(bool overwrite) } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/129227")] public async Task UnixFileModes_RestrictiveParentDir_Async() { using TempDirectory source = new TempDirectory(); @@ -368,7 +363,6 @@ public async Task UnixFileModes_RestrictiveParentDir_Async() } [ConditionalFact(typeof(MountHelper), nameof(MountHelper.CanCreateSymbolicLinks))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/129227")] public async Task LinkBeforeTargetAsync() { using TempDirectory source = new TempDirectory(); diff --git a/src/libraries/System.Formats.Tar/tests/TarFile/TarFile.ExtractToDirectoryAsync.Stream.Tests.cs b/src/libraries/System.Formats.Tar/tests/TarFile/TarFile.ExtractToDirectoryAsync.Stream.Tests.cs index d95deb6128d080..d56f85648914df 100644 --- a/src/libraries/System.Formats.Tar/tests/TarFile/TarFile.ExtractToDirectoryAsync.Stream.Tests.cs +++ b/src/libraries/System.Formats.Tar/tests/TarFile/TarFile.ExtractToDirectoryAsync.Stream.Tests.cs @@ -136,7 +136,6 @@ public async Task ExtractEntry_PodmanImageTarWithRelativeSymlinksPointingInExtra [Theory] [InlineData(TarEntryType.SymbolicLink)] [InlineData(TarEntryType.HardLink)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/129227")] public async Task Extract_LinkEntry_TargetOutsideDirectory_Async(TarEntryType entryType) { await using (MemoryStream archive = new MemoryStream()) @@ -161,25 +160,21 @@ public async Task Extract_LinkEntry_TargetOutsideDirectory_Async(TarEntryType en [ConditionalTheory(typeof(MountHelper), nameof(MountHelper.CanCreateSymbolicLinks))] [InlineData(TarEntryFormat.Pax)] [InlineData(TarEntryFormat.Gnu)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/129227")] public Task Extract_SymbolicLinkEntry_TargetInsideDirectory_Async(TarEntryFormat format) => Extract_LinkEntry_TargetInsideDirectory_Internal_Async(TarEntryType.SymbolicLink, format, null); [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.SupportsHardLinkCreation))] [InlineData(TarEntryFormat.Pax)] [InlineData(TarEntryFormat.Gnu)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/129227")] public Task Extract_HardLinkEntry_TargetInsideDirectory_Async(TarEntryFormat format) => Extract_LinkEntry_TargetInsideDirectory_Internal_Async(TarEntryType.HardLink, format, null); [ConditionalTheory(typeof(MountHelper), nameof(MountHelper.CanCreateSymbolicLinks))] [InlineData(TarEntryFormat.Pax)] [InlineData(TarEntryFormat.Gnu)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/129227")] public Task Extract_SymbolicLinkEntry_TargetInsideDirectory_LongBaseDir_Async(TarEntryFormat format) => Extract_LinkEntry_TargetInsideDirectory_Internal_Async(TarEntryType.SymbolicLink, format, new string('a', 99)); [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.SupportsHardLinkCreation))] [InlineData(TarEntryFormat.Pax)] [InlineData(TarEntryFormat.Gnu)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/129227")] public Task Extract_HardLinkEntry_TargetInsideDirectory_LongBaseDir_Async(TarEntryFormat format) => Extract_LinkEntry_TargetInsideDirectory_Internal_Async(TarEntryType.HardLink, format, new string('a', 99)); // This test would not pass for the V7 and Ustar formats in some OSs like MacCatalyst, tvOSSimulator and OSX, because the TempDirectory gets created in @@ -222,7 +217,6 @@ private async Task Extract_LinkEntry_TargetInsideDirectory_Internal_Async(TarEnt [InlineData(512)] [InlineData(512 + 1)] [InlineData(512 + 512 - 1)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/129227")] public async Task Extract_UnseekableStream_BlockAlignmentPadding_DoesNotAffectNextEntries_Async(int contentSize) { byte[] fileContents = new byte[contentSize]; @@ -279,7 +273,6 @@ public async Task PaxNameCollision_DedupInExtendedAttributesAsync() [Theory] [MemberData(nameof(GetTestTarFormats))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/129227")] public async Task UnseekableStreams_RoundTrip_Async(TestTarFormat testFormat) { using TempDirectory root = new(); diff --git a/src/tests/FunctionalTests/iOS/Device/AOT/iOS.Device.Aot.Test.csproj b/src/tests/FunctionalTests/iOS/Device/AOT/iOS.Device.Aot.Test.csproj index 802828ab2e14d3..9ac6281fe2aae9 100644 --- a/src/tests/FunctionalTests/iOS/Device/AOT/iOS.Device.Aot.Test.csproj +++ b/src/tests/FunctionalTests/iOS/Device/AOT/iOS.Device.Aot.Test.csproj @@ -10,6 +10,8 @@ true true true + + true diff --git a/src/tests/FunctionalTests/iOS/Device/ExportManagedSymbols/iOS.Device.ExportManagedSymbols.Test.csproj b/src/tests/FunctionalTests/iOS/Device/ExportManagedSymbols/iOS.Device.ExportManagedSymbols.Test.csproj index 51ebc622ecc023..338b9e44300ba8 100644 --- a/src/tests/FunctionalTests/iOS/Device/ExportManagedSymbols/iOS.Device.ExportManagedSymbols.Test.csproj +++ b/src/tests/FunctionalTests/iOS/Device/ExportManagedSymbols/iOS.Device.ExportManagedSymbols.Test.csproj @@ -10,6 +10,8 @@ true true $(MSBuildProjectDirectory)/main.m + + true diff --git a/src/tests/Interop/COM/ComWrappers/API/Program.cs b/src/tests/Interop/COM/ComWrappers/API/Program.cs index 8204ce75f6a903..a87ba2e79a6906 100644 --- a/src/tests/Interop/COM/ComWrappers/API/Program.cs +++ b/src/tests/Interop/COM/ComWrappers/API/Program.cs @@ -1084,6 +1084,7 @@ public unsafe void CrossApartmentQueryInterface_NoDeadlock() staThread.Start(); mtaThread.Start(); + testCompleted.WaitOne(); } finally { @@ -1092,8 +1093,6 @@ public unsafe void CrossApartmentQueryInterface_NoDeadlock() Marshal.Release(agileReference); } } - - testCompleted.WaitOne(); } [DllImport("ole32.dll")] diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveGatherVectorFirstFaultingVectorBases.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveGatherVectorFirstFaultingVectorBases.template index 686b736a1563c1..9448da55db061f 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveGatherVectorFirstFaultingVectorBases.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveGatherVectorFirstFaultingVectorBases.template @@ -10,6 +10,7 @@ using System; using System.Buffers; +using System.Diagnostics; using System.Numerics; using System.Reflection; using System.Runtime.CompilerServices; @@ -129,7 +130,16 @@ namespace JIT.HardwareIntrinsics.Arm inArray2.CopyTo(inArray2Ffr, 0); // Add the base pointer to the offsets within inArray2 to create complete pointers. - for (var i = 0; i < inArray2.Length; i++) { inArray2[i] += ({Op2BaseType})baseArrayPtr; } + for (var i = 0; i < inArray2.Length; i++) + { + {Op2BaseType} baseAddrToValidate = (({Op2BaseType})baseArrayPtr + (sizeof({RetBaseType}) * inArray2[i])); + + // Make sure we got the correct base pointers. + Debug.Assert(*(({RetBaseType}*)baseAddrToValidate) == baseArray[inArray2[i]]); + + inArray2[i] = baseAddrToValidate; + } + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As<{Op2BaseType}, byte>(ref inArray2[0]), (uint)sizeOfinArray2); // Add the base pointer to the offsets within inArray2Ffr to create complete pointers. @@ -144,7 +154,12 @@ namespace JIT.HardwareIntrinsics.Arm } else { - inArray2Ffr[i] += ({Op2BaseType})baseArrayPtr; + {Op2BaseType} baseAddrToValidate = (({Op2BaseType})baseArrayPtr + (sizeof({RetBaseType}) * inArray2Ffr[i])); + + // Make sure we got the correct base pointers. + Debug.Assert(*(({RetBaseType}*)baseAddrToValidate) == baseArray[inArray2Ffr[i]]); + + inArray2Ffr[i] = baseAddrToValidate; } } Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2FfrPtr), ref Unsafe.As<{Op2BaseType}, byte>(ref inArray2Ffr[0]), (uint)sizeOfinArray2); @@ -188,7 +203,15 @@ namespace JIT.HardwareIntrinsics.Arm for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp2} % ({Op2BaseType})BaseElementCount; } // Add the base pointer to the offsets within inArray2 to create complete pointers. - for (var i = 0; i < Op2ElementCount; i++) { _data2[i] += ({Op2BaseType})_dataTable.baseArrayPtr; } + for (var i = 0; i < Op2ElementCount; i++) + { + {Op2BaseType} baseAddrToValidate = (({Op2BaseType})_dataTable.baseArrayPtr + (sizeof({RetBaseType}) * _data2[i])); + + // Make sure we got the correct base pointers. + Debug.Assert(*(({RetBaseType}*)baseAddrToValidate) == (({RetBaseType}*)_dataTable.baseArrayPtr)[_data2[i]]); + + _data2[i] = baseAddrToValidate; + } Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld1), ref Unsafe.As<{Op1BaseType}, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op2VectorType}<{Op2BaseType}>, byte>(ref testStruct._fld2), ref Unsafe.As<{Op2BaseType}, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<{Op2VectorType}<{Op2BaseType}>>()); diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveGatherVectorVectorBases.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveGatherVectorVectorBases.template index 56139d12670e28..30bc9f8a703786 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveGatherVectorVectorBases.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveGatherVectorVectorBases.template @@ -9,6 +9,7 @@ ******************************************************************************/ using System; +using System.Diagnostics; using System.Numerics; using System.Reflection; using System.Runtime.CompilerServices; @@ -118,7 +119,16 @@ namespace JIT.HardwareIntrinsics.Arm Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(baseArrayPtr), ref Unsafe.As<{RetBaseType}, byte>(ref baseArray[0]), (uint)sizeOfBaseArray); // Add the base pointer to the offsets within inArray2 to create complete pointers. - for (var i = 0; i < inArray2.Length; i++) { inArray2[i] += ({Op2BaseType})baseArrayPtr; } + for (var i = 0; i < inArray2.Length; i++) + { + {Op2BaseType} baseAddrToValidate = (({Op2BaseType})baseArrayPtr + (sizeof({RetBaseType}) * inArray2[i])); + + // Make sure we got the correct base pointers. + Debug.Assert(*(({RetBaseType}*)baseAddrToValidate) == baseArray[inArray2[i]]); + + inArray2[i] = baseAddrToValidate; + } + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As<{Op2BaseType}, byte>(ref inArray2[0]), (uint)sizeOfinArray2); } @@ -158,7 +168,15 @@ namespace JIT.HardwareIntrinsics.Arm for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp2} % ({Op2BaseType})BaseElementCount; } // Add the base pointer to the offsets within inArray2 to create complete pointers. - for (var i = 0; i < Op2ElementCount; i++) { _data2[i] += ({Op2BaseType})_dataTable.baseArrayPtr; } + for (var i = 0; i < Op2ElementCount; i++) + { + {Op2BaseType} baseAddrToValidate = (({Op2BaseType})_dataTable.baseArrayPtr + (sizeof({RetBaseType}) * _data2[i])); + + // Make sure we got the correct base pointers. + Debug.Assert(*(({RetBaseType}*)baseAddrToValidate) == (({RetBaseType}*)_dataTable.baseArrayPtr)[_data2[i]]); + + _data2[i] = baseAddrToValidate; + } Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld1), ref Unsafe.As<{Op1BaseType}, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op2VectorType}<{Op2BaseType}>, byte>(ref testStruct._fld2), ref Unsafe.As<{Op2BaseType}, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<{Op2VectorType}<{Op2BaseType}>>()); diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveScatterVectorBases.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveScatterVectorBases.template index 6103c423254ff3..c22c7647afd602 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveScatterVectorBases.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveScatterVectorBases.template @@ -10,6 +10,7 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Numerics; using System.Reflection; using System.Runtime.CompilerServices; @@ -114,7 +115,16 @@ namespace JIT.HardwareIntrinsics.Arm._Sve Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(outArrayPtr), ref Unsafe.As<{Op1BaseType}, byte>(ref outArray[0]), (uint)sizeOfOutArray); // Add the base pointer to the offsets within outArray to create complete pointers. - for (var i = 0; i < inAddress.Length; i++) { inAddress[i] += ({Op2BaseType})outArrayPtr; } + for (var i = 0; i < inAddress.Length; i++) + { + {Op2BaseType} baseAddrToValidate = (({Op2BaseType})outArrayPtr + (sizeof({Op2BaseType}) * inAddress[i])); + + // Make sure we got the correct base pointers. + Debug.Assert(*(({Op1BaseType}*)baseAddrToValidate) == outArray[inAddress[i]]); + + inAddress[i] = baseAddrToValidate; + } + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inAddressArrayPtr), ref Unsafe.As<{Op2BaseType}, byte>(ref inAddress[0]), (uint)sizeOfInOffset); } @@ -175,11 +185,19 @@ namespace JIT.HardwareIntrinsics.Arm._Sve _dataTable.ResetOutArray(); // Fill full of offsets into the data buffer. - for (var i = 0; i < AddressElementCount; i++) { _addressArr[i] = ({NextValueOp2} % ({Op2BaseType})OutElementCount ) * sizeof({Op2BaseType}); } + for (var i = 0; i < AddressElementCount; i++) { _addressArr[i] = ({NextValueOp2} % ({Op2BaseType})OutElementCount ); } MakeDistinct(_addressArr); - // Add the base pointer to the offsets within outArray to create complete pointers. - for (var i = 0; i < AddressElementCount; i++) { _addressArr[i] += ({Op2BaseType})_dataTable.outArrayPtr; } + // Add the base pointer to the offsets within inArray2 to create complete pointers. + for (var i = 0; i < AddressElementCount; i++) + { + {Op2BaseType} baseAddrToValidate = (({Op2BaseType})_dataTable.outArrayPtr + (sizeof({Op2BaseType}) * _addressArr[i])); + + // Make sure we got the correct base pointers. + Debug.Assert(*(({Op1BaseType}*)baseAddrToValidate) == (({Op1BaseType}*)_dataTable.outArrayPtr)[_addressArr[i]]); + + _addressArr[i] = baseAddrToValidate; + } Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._mask), ref Unsafe.As<{Op1BaseType}, byte>(ref _maskArr[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._data), ref Unsafe.As<{Op1BaseType}, byte>(ref _dataArr[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); @@ -224,7 +242,7 @@ namespace JIT.HardwareIntrinsics.Arm._Sve for (var i = 0; i < DataElementCount; i++) { _dataArr[i] = {NextValueOp3}; } // Fill full of offsets into the data buffer. They wil be expanded to full pointers inside the DataTable constructor. - for (var i = 0; i < AddressElementCount; i++) { _addressArr[i] = ({NextValueOp2} % ({Op2BaseType})OutElementCount) * sizeof({Op2BaseType}); } + for (var i = 0; i < AddressElementCount; i++) { _addressArr[i] = ({NextValueOp2} % ({Op2BaseType})OutElementCount); } MakeDistinct(_addressArr); for (var i = 0; i < DataElementCount; i++) { _falseData[i] = {NextValueOp3}; }