Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(490)

Side by Side Diff: syzygy/instrument/transforms/security_cookie_check_hook_transform.h

Issue 2871863002: adds the security cookie check hook transform. (Closed)
Patch Set: removed the DCHECK_EQ Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 Google Inc. All Rights Reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 //
15 // This transform redirects the '__report_gsfailure' function to
16 // the following assembly stub: 'mov [deadbeef], 0'.
17 // The function __report_gsfailure raises an exception that an EH
18 // cannot intercept (for security reasons); this transform allows
19 // an EH to catch the GS failures.
20
21 #ifndef SYZYGY_INSTRUMENT_TRANSFORMS_SECURITY_COOKIE_CHECK_HOOK_TRANSFORM_H_
22 #define SYZYGY_INSTRUMENT_TRANSFORMS_SECURITY_COOKIE_CHECK_HOOK_TRANSFORM_H_
23
24 #include "base/logging.h"
25 #include "syzygy/block_graph/basic_block_assembler.h"
26 #include "syzygy/block_graph/basic_block_subgraph.h"
27 #include "syzygy/block_graph/block_builder.h"
28 #include "syzygy/block_graph/transform_policy.h"
29 #include "syzygy/block_graph/transforms/named_transform.h"
30
31 namespace instrument {
32 namespace transforms {
33
34 typedef block_graph::BasicBlockAssembler BasicBlockAssembler;
35 typedef block_graph::BasicBlockSubGraph BasicBlockSubGraph;
36 typedef block_graph::BasicCodeBlock BasicCodeBlock;
37 typedef block_graph::BlockGraph BlockGraph;
38 typedef block_graph::BlockBuilder BlockBuilder;
39 typedef block_graph::TransformPolicyInterface TransformPolicyInterface;
40
41 class SecurityCookieCheckHookTransform
42 : public block_graph::transforms::NamedBlockGraphTransformImpl<
43 SecurityCookieCheckHookTransform> {
44 public:
45 SecurityCookieCheckHookTransform() {}
46
47 static const char kTransformName[];
48 static const char kReportGsFailure[];
49 static const char kSyzygyReportGsFailure[];
50 static const uint32_t kInvalidUserAddress;
51
52 // BlockGraphTransformInterface implementation.
53 bool TransformBlockGraph(const TransformPolicyInterface* policy,
54 BlockGraph* block_graph,
55 BlockGraph::Block* header_block) final;
56 };
57
58 } // namespace transforms
59 } // namespace instrument
60
61 #endif // SYZYGY_INSTRUMENT_TRANSFORMS_SECURITY_COOKIE_CHECK_HOOK_TRANSFORM_H_
OLDNEW
« no previous file with comments | « syzygy/instrument/instrument.gyp ('k') | syzygy/instrument/transforms/security_cookie_check_hook_transform.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698