about summary refs log tree commit diff
path: root/compiler/rustc_lint/src/lib.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-11-01 03:51:06 +0000
committerbors <bors@rust-lang.org>2021-11-01 03:51:06 +0000
commit708d57e288d051a6238ed56039ffeac158e10e84 (patch)
treef834a735f6c6d81803e35c728f9a4faafbd0f3c6 /compiler/rustc_lint/src/lib.rs
parent7e4c9eebd82e9fa71f74626e5ba4e3494b8aba25 (diff)
parenta59d96ecf299c2c84eeda29ae89862fa7bc269c4 (diff)
downloadrust-708d57e288d051a6238ed56039ffeac158e10e84.tar.gz
rust-708d57e288d051a6238ed56039ffeac158e10e84.zip
Auto merge of #90461 - pietroalbini:bidi-beta, r=nikomatsakis
[beta] Fix CVE-2021-42574

This PR implements new lints to mitigate the impact of [CVE-2021-42574], caused by the presence of bidirectional-override Unicode codepoints in the compiled source code. [See the advisory][advisory] for more information about the vulnerability.

The changes in this PR will be released in tomorrow's beta release.

[CVE-2021-42574]: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-42574
[advisory]: https://blog.rust-lang.org/2021/11/01/cve-2021-42574.html
Diffstat (limited to 'compiler/rustc_lint/src/lib.rs')
-rw-r--r--compiler/rustc_lint/src/lib.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_lint/src/lib.rs b/compiler/rustc_lint/src/lib.rs
index 6f684a0fe51..d98d65385e5 100644
--- a/compiler/rustc_lint/src/lib.rs
+++ b/compiler/rustc_lint/src/lib.rs
@@ -48,6 +48,7 @@ pub mod builtin;
 mod context;
 mod early;
 mod enum_intrinsics_non_enums;
+pub mod hidden_unicode_codepoints;
 mod internal;
 mod late;
 mod levels;
@@ -78,6 +79,7 @@ use rustc_span::Span;
 use array_into_iter::ArrayIntoIter;
 use builtin::*;
 use enum_intrinsics_non_enums::EnumIntrinsicsNonEnums;
+use hidden_unicode_codepoints::*;
 use internal::*;
 use methods::*;
 use non_ascii_idents::*;
@@ -129,6 +131,7 @@ macro_rules! early_lint_passes {
                 DeprecatedAttr: DeprecatedAttr::new(),
                 WhileTrue: WhileTrue,
                 NonAsciiIdents: NonAsciiIdents,
+                HiddenUnicodeCodepoints: HiddenUnicodeCodepoints,
                 IncompleteFeatures: IncompleteFeatures,
                 RedundantSemicolons: RedundantSemicolons,
                 UnusedDocComment: UnusedDocComment,