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

Issue 1665363002: Clang plugin to check that unstable types are not used in IPC. (Closed)

Created:
4 years, 10 months ago by Dmitry Skiba
Modified:
4 years, 9 months ago
Reviewers:
hans, Nico, jam, vmpstr, dcheng
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Clang plugin to check that unstable types are not used in IPC. We want IPC messages to be stable so that 32-bit and 64-bit processes can talk to each other. This plugin blacklists the following types that are known to be unstable: 1. Types: long / unsigned long (but not typedefs to) 2. Typedefs: intmax_t, uintmax_t, intptr_t, uintptr_t, wint_t, size_t, rsize_t, ssize_t, ptrdiff_t, dev_t, off_t, clock_t, time_t, suseconds_t (including typedefs to) Blacklisted types are not allowed in IPC::WriteParam() invocations or IPC::CheckedTuple<> specializations. BUG=581409 CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_optional_gpu_tests_rel Committed: https://crrev.com/a817c371a7a33cdf9282b711dafbdcee83b788e4 Cr-Commit-Position: refs/heads/master@{#380151}

Patch Set 1 #

Total comments: 3

Patch Set 2 : Plug IPC check into FindBadConstructs #

Patch Set 3 : Enable for GYP builds #

Patch Set 4 : Reworked plugin #

Patch Set 5 : rebased #

Patch Set 6 : Android fixes; comments #

Patch Set 7 : Blacklist types instead #

Total comments: 2

Patch Set 8 : Check specializations in WriteParam() too; revert ppapi change" #

Patch Set 9 : Require with-ast-visitor flag (preparation for rebase) #

Patch Set 10 : rebased #

Patch Set 11 : Fix GPU IPC #

Patch Set 12 : Remove extra RAV #

Patch Set 13 : Fix typos #

Total comments: 32

Patch Set 14 : Address comments (1/2) #

Patch Set 15 : Address comments (2/2, CheckType and friends -> CheckIPCVisitor) #

Patch Set 16 : Don't check WriteParam() on dependent types #

Patch Set 17 : rebased #

Patch Set 18 : Use SmallVector; revert build script changes #

Total comments: 24

Patch Set 19 : Address comments #

Patch Set 20 : Use IgnoreImplicit() #

Patch Set 21 : rebase #

Patch Set 22 : rebase to ToT #

Total comments: 1

Patch Set 23 : Support delayed-template-parsing; remove flaky test; don't visit instantiations #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1065 lines, -4 lines) Patch
M ipc/ipc_message_macros.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +1 line, -1 line 0 comments Download
M ipc/ipc_message_utils.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +14 lines, -0 lines 0 comments Download
M tools/clang/plugins/CMakeLists.txt View 1 1 chunk +2 lines, -1 line 0 comments Download
A tools/clang/plugins/CheckIPCVisitor.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +99 lines, -0 lines 0 comments Download
A tools/clang/plugins/CheckIPCVisitor.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +288 lines, -0 lines 0 comments Download
M tools/clang/plugins/FindBadConstructsAction.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +3 lines, -1 line 0 comments Download
M tools/clang/plugins/FindBadConstructsConsumer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 5 chunks +12 lines, -0 lines 0 comments Download
M tools/clang/plugins/FindBadConstructsConsumer.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 5 chunks +67 lines, -0 lines 0 comments Download
M tools/clang/plugins/Options.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -1 line 0 comments Download
A tools/clang/plugins/tests/ipc.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +353 lines, -0 lines 0 comments Download
A tools/clang/plugins/tests/ipc.flags View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download
A tools/clang/plugins/tests/ipc.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +224 lines, -0 lines 0 comments Download

Messages

Total messages: 81 (16 generated)
Dmitry Skiba
Please note that I'm in the process of splitting the plugin into .h / .cpp ...
4 years, 10 months ago (2016-02-05 19:26:30 UTC) #3
Nico
+dcheng Can you please check that this doesn't regress compile time perf (build with and ...
4 years, 10 months ago (2016-02-05 19:29:57 UTC) #5
Dmitry Skiba
On 2016/02/05 19:29:57, Nico wrote: > +dcheng > > Can you please check that this ...
4 years, 10 months ago (2016-02-05 19:41:16 UTC) #6
dcheng
On 2016/02/05 at 19:26:30, dskiba wrote: > Please note that I'm in the process of ...
4 years, 10 months ago (2016-02-05 19:42:27 UTC) #7
Dmitry Skiba
Please check new version - IPC check is now behind a flag in find-bad-constructs plugin ...
4 years, 10 months ago (2016-02-05 23:27:21 UTC) #8
Dmitry Skiba
On 2016/02/05 23:27:21, Dmitry Skiba wrote: > Please check new version - IPC check is ...
4 years, 10 months ago (2016-02-05 23:28:16 UTC) #9
Dmitry Skiba
On 2016/02/05 23:28:16, Dmitry Skiba wrote: > On 2016/02/05 23:27:21, Dmitry Skiba wrote: > > ...
4 years, 10 months ago (2016-02-09 09:18:29 UTC) #10
dcheng
On 2016/02/09 at 09:18:29, dskiba wrote: > On 2016/02/05 23:28:16, Dmitry Skiba wrote: > > ...
4 years, 10 months ago (2016-02-09 18:12:22 UTC) #11
Dmitry Skiba
On 2016/02/09 18:12:22, dcheng wrote: > On 2016/02/09 at 09:18:29, dskiba wrote: > > On ...
4 years, 10 months ago (2016-02-09 21:48:39 UTC) #12
dcheng
+vmpstr, who was poking at some of the RecursiveASTVisitor stuff last week and thinking about ...
4 years, 10 months ago (2016-02-16 22:19:29 UTC) #15
jam
I left comments on the bug, summary is: 1) remove the int restriction; this isn't ...
4 years, 10 months ago (2016-02-17 15:30:49 UTC) #18
dcheng
We now use RecursiveASTVisitor by default: https://codereview.chromium.org/1703713002 So I think you can simplify this somewhat ...
4 years, 10 months ago (2016-02-18 07:12:37 UTC) #19
Dmitry Skiba
On 2016/02/18 07:12:37, dcheng wrote: > We now use RecursiveASTVisitor by default: > https://codereview.chromium.org/1703713002 > ...
4 years, 10 months ago (2016-02-18 10:09:36 UTC) #20
jam
https://codereview.chromium.org/1665363002/diff/120001/ppapi/proxy/ppapi_messages.h File ppapi/proxy/ppapi_messages.h (right): https://codereview.chromium.org/1665363002/diff/120001/ppapi/proxy/ppapi_messages.h#newcode493 ppapi/proxy/ppapi_messages.h:493: int32_t /* renderer_pid */, no need to change right?
4 years, 10 months ago (2016-02-18 21:04:49 UTC) #22
Dmitry Skiba
On 2016/02/18 21:04:49, jam wrote: > https://codereview.chromium.org/1665363002/diff/120001/ppapi/proxy/ppapi_messages.h > File ppapi/proxy/ppapi_messages.h (right): > > https://codereview.chromium.org/1665363002/diff/120001/ppapi/proxy/ppapi_messages.h#newcode493 > ...
4 years, 10 months ago (2016-02-18 23:14:30 UTC) #23
Dmitry Skiba
Performance numbers from building 32-bit chrome_apk target in Release: With plugin: real 47m20.095s user 505m55.766s ...
4 years, 10 months ago (2016-02-18 23:16:10 UTC) #24
jam
On 2016/02/18 23:14:30, Dmitry Skiba wrote: > On 2016/02/18 21:04:49, jam wrote: > > > ...
4 years, 10 months ago (2016-02-19 00:02:08 UTC) #25
jam
https://codereview.chromium.org/1665363002/diff/120001/ipc/ipc_message_utils.h File ipc/ipc_message_utils.h (right): https://codereview.chromium.org/1665363002/diff/120001/ipc/ipc_message_utils.h#newcode92 ipc/ipc_message_utils.h:92: // NOT checked by 'IPC checker' Clang plugin. perhaps ...
4 years, 10 months ago (2016-02-19 16:16:05 UTC) #26
Dmitry Skiba
On 2016/02/19 16:16:05, jam wrote: > https://codereview.chromium.org/1665363002/diff/120001/ipc/ipc_message_utils.h > File ipc/ipc_message_utils.h (right): > > https://codereview.chromium.org/1665363002/diff/120001/ipc/ipc_message_utils.h#newcode92 > ...
4 years, 10 months ago (2016-02-19 19:48:06 UTC) #27
jam
On 2016/02/19 19:48:06, Dmitry Skiba wrote: > On 2016/02/19 16:16:05, jam wrote: > > https://codereview.chromium.org/1665363002/diff/120001/ipc/ipc_message_utils.h ...
4 years, 10 months ago (2016-02-19 21:43:31 UTC) #28
Dmitry Skiba
Clang guys, please review.
4 years, 10 months ago (2016-02-22 17:57:20 UTC) #30
dcheng
On 2016/02/22 at 17:57:20, dskiba wrote: > Clang guys, please review. I don't think we ...
4 years, 10 months ago (2016-02-22 18:13:52 UTC) #31
Dmitry Skiba
On 2016/02/22 18:13:52, dcheng wrote: > On 2016/02/22 at 17:57:20, dskiba wrote: > > Clang ...
4 years, 10 months ago (2016-02-22 18:32:38 UTC) #32
dcheng
On 2016/02/22 at 18:32:38, dskiba wrote: > On 2016/02/22 18:13:52, dcheng wrote: > > On ...
4 years, 10 months ago (2016-02-22 18:41:52 UTC) #33
Dmitry Skiba
On 2016/02/22 18:41:52, dcheng wrote: > On 2016/02/22 at 18:32:38, dskiba wrote: > > On ...
4 years, 10 months ago (2016-02-22 18:57:25 UTC) #34
dcheng
On 2016/02/22 at 18:57:25, dskiba wrote: > On 2016/02/22 18:41:52, dcheng wrote: > > On ...
4 years, 10 months ago (2016-02-22 18:59:04 UTC) #35
Dmitry Skiba
On 2016/02/22 18:59:04, dcheng wrote: > On 2016/02/22 at 18:57:25, dskiba wrote: > > On ...
4 years, 10 months ago (2016-02-22 19:08:42 UTC) #36
dcheng
On 2016/02/22 at 19:08:42, dskiba wrote: > On 2016/02/22 18:59:04, dcheng wrote: > > On ...
4 years, 10 months ago (2016-02-22 19:19:55 UTC) #37
Dmitry Skiba
On 2016/02/22 19:19:55, dcheng wrote: > On 2016/02/22 at 19:08:42, dskiba wrote: > > On ...
4 years, 10 months ago (2016-02-23 18:38:03 UTC) #38
dcheng
On 2016/02/23 at 18:38:03, dskiba wrote: > On 2016/02/22 19:19:55, dcheng wrote: > > On ...
4 years, 10 months ago (2016-02-23 18:42:06 UTC) #39
dcheng
On 2016/02/23 at 18:42:06, dcheng wrote: > On 2016/02/23 at 18:38:03, dskiba wrote: > > ...
4 years, 10 months ago (2016-02-23 18:43:06 UTC) #40
Dmitry Skiba
> The bots won't use your custom plugin. AFAIK, there's no officially sanctioned > way ...
4 years, 10 months ago (2016-02-23 18:48:51 UTC) #41
Dmitry Skiba
> To be more precise, what's happening is the bots are using the prebuilt clang ...
4 years, 10 months ago (2016-02-23 18:52:18 UTC) #42
dcheng
On 2016/02/23 at 18:48:51, dskiba wrote: > > The bots won't use your custom plugin. ...
4 years, 10 months ago (2016-02-23 18:53:01 UTC) #43
Dmitry Skiba
On 2016/02/23 18:53:01, dcheng wrote: > On 2016/02/23 at 18:48:51, dskiba wrote: > > > ...
4 years, 10 months ago (2016-02-23 18:58:22 UTC) #44
dcheng
https://codereview.chromium.org/1665363002/diff/240001/tools/clang/plugins/CheckIPCVisitor.cpp File tools/clang/plugins/CheckIPCVisitor.cpp (right): https://codereview.chromium.org/1665363002/diff/240001/tools/clang/plugins/CheckIPCVisitor.cpp#newcode33 tools/clang/plugins/CheckIPCVisitor.cpp:33: ""; Add some content to this string? https://codereview.chromium.org/1665363002/diff/240001/tools/clang/plugins/CheckIPCVisitor.cpp#newcode47 tools/clang/plugins/CheckIPCVisitor.cpp:47: ...
4 years, 10 months ago (2016-02-23 19:46:47 UTC) #45
Dmitry Skiba
TBD is getting rid of static in IsBlacklistedTypedef(). https://codereview.chromium.org/1665363002/diff/240001/tools/clang/plugins/CheckIPCVisitor.cpp File tools/clang/plugins/CheckIPCVisitor.cpp (right): https://codereview.chromium.org/1665363002/diff/240001/tools/clang/plugins/CheckIPCVisitor.cpp#newcode33 tools/clang/plugins/CheckIPCVisitor.cpp:33: ""; ...
4 years, 10 months ago (2016-02-24 14:39:05 UTC) #46
dcheng
https://codereview.chromium.org/1665363002/diff/240001/tools/clang/plugins/CheckIPCVisitor.cpp File tools/clang/plugins/CheckIPCVisitor.cpp (right): https://codereview.chromium.org/1665363002/diff/240001/tools/clang/plugins/CheckIPCVisitor.cpp#newcode304 tools/clang/plugins/CheckIPCVisitor.cpp:304: CheckType(*context_, arg_type, &details); On 2016/02/24 at 14:39:04, Dmitry Skiba ...
4 years, 10 months ago (2016-02-24 22:57:42 UTC) #47
Dmitry Skiba
On 2016/02/24 22:57:42, dcheng wrote: ... > > It's just an optimization. I expect CheckType() ...
4 years, 10 months ago (2016-02-25 17:37:07 UTC) #48
dcheng
On 2016/02/25 at 17:37:07, dskiba wrote: > On 2016/02/24 22:57:42, dcheng wrote: > ... > ...
4 years, 10 months ago (2016-02-26 18:40:50 UTC) #49
Dmitry Skiba
On 2016/02/26 18:40:50, dcheng wrote: ... > Yes, let's do this. I was really busy ...
4 years, 9 months ago (2016-02-29 16:42:05 UTC) #50
dcheng
On 2016/02/29 at 16:42:05, dskiba wrote: > On 2016/02/26 18:40:50, dcheng wrote: > ... > ...
4 years, 9 months ago (2016-02-29 17:50:01 UTC) #51
jam
On 2016/02/29 17:50:01, dcheng wrote: > On 2016/02/29 at 16:42:05, dskiba wrote: > > On ...
4 years, 9 months ago (2016-02-29 23:57:11 UTC) #52
Dmitry Skiba
Daniel, please review. I think I addressed everything.
4 years, 9 months ago (2016-03-07 20:49:11 UTC) #53
dcheng
https://codereview.chromium.org/1665363002/diff/340001/tools/clang/plugins/CheckIPCVisitor.cpp File tools/clang/plugins/CheckIPCVisitor.cpp (right): https://codereview.chromium.org/1665363002/diff/340001/tools/clang/plugins/CheckIPCVisitor.cpp#newcode119 tools/clang/plugins/CheckIPCVisitor.cpp:119: if (auto* cast_expr = dyn_cast<ImplicitCastExpr>(arg_type_expr)) { Nit: } else ...
4 years, 9 months ago (2016-03-07 23:44:39 UTC) #54
Dmitry Skiba
https://codereview.chromium.org/1665363002/diff/340001/tools/clang/plugins/CheckIPCVisitor.cpp File tools/clang/plugins/CheckIPCVisitor.cpp (right): https://codereview.chromium.org/1665363002/diff/340001/tools/clang/plugins/CheckIPCVisitor.cpp#newcode119 tools/clang/plugins/CheckIPCVisitor.cpp:119: if (auto* cast_expr = dyn_cast<ImplicitCastExpr>(arg_type_expr)) { On 2016/03/07 23:44:39, ...
4 years, 9 months ago (2016-03-08 01:16:11 UTC) #55
dcheng
https://codereview.chromium.org/1665363002/diff/340001/tools/clang/plugins/CheckIPCVisitor.cpp File tools/clang/plugins/CheckIPCVisitor.cpp (right): https://codereview.chromium.org/1665363002/diff/340001/tools/clang/plugins/CheckIPCVisitor.cpp#newcode119 tools/clang/plugins/CheckIPCVisitor.cpp:119: if (auto* cast_expr = dyn_cast<ImplicitCastExpr>(arg_type_expr)) { On 2016/03/08 at ...
4 years, 9 months ago (2016-03-08 01:30:32 UTC) #56
Dmitry Skiba
On 2016/03/08 01:30:32, dcheng wrote: > https://codereview.chromium.org/1665363002/diff/340001/tools/clang/plugins/CheckIPCVisitor.cpp > File tools/clang/plugins/CheckIPCVisitor.cpp (right): > > https://codereview.chromium.org/1665363002/diff/340001/tools/clang/plugins/CheckIPCVisitor.cpp#newcode119 > ...
4 years, 9 months ago (2016-03-08 17:33:35 UTC) #57
dcheng
lgtm Btw, I poked at the template arg thing... we might have a bit of ...
4 years, 9 months ago (2016-03-08 18:00:47 UTC) #58
Dmitry Skiba
On 2016/03/08 18:00:47, dcheng wrote: > lgtm > > Btw, I poked at the template ...
4 years, 9 months ago (2016-03-08 18:36:27 UTC) #59
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1665363002/400001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1665363002/400001
4 years, 9 months ago (2016-03-08 22:09:22 UTC) #62
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_compile_dbg_32_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_compile_dbg_32_ng/builds/169858) ios_rel_device_ninja on tryserver.chromium.mac (JOB_FAILED, ...
4 years, 9 months ago (2016-03-08 22:12:59 UTC) #64
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1665363002/420001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1665363002/420001
4 years, 9 months ago (2016-03-09 16:32:16 UTC) #67
commit-bot: I haz the power
Committed patchset #22 (id:420001)
4 years, 9 months ago (2016-03-09 17:46:06 UTC) #68
commit-bot: I haz the power
Patchset 22 (id:??) landed as https://crrev.com/a817c371a7a33cdf9282b711dafbdcee83b788e4 Cr-Commit-Position: refs/heads/master@{#380151}
4 years, 9 months ago (2016-03-09 17:47:27 UTC) #70
hans
https://codereview.chromium.org/1665363002/diff/420001/tools/clang/plugins/tests/ipc.txt File tools/clang/plugins/tests/ipc.txt (right): https://codereview.chromium.org/1665363002/diff/420001/tools/clang/plugins/tests/ipc.txt#newcode5 tools/clang/plugins/tests/ipc.txt:5: WriteParam(pickle, static_cast<long>(container.value)); // ERROR For some reason, this one ...
4 years, 9 months ago (2016-03-09 22:00:07 UTC) #72
Dmitry Skiba
On 2016/03/09 22:00:07, hans wrote: > https://codereview.chromium.org/1665363002/diff/420001/tools/clang/plugins/tests/ipc.txt > File tools/clang/plugins/tests/ipc.txt (right): > > https://codereview.chromium.org/1665363002/diff/420001/tools/clang/plugins/tests/ipc.txt#newcode5 > ...
4 years, 9 months ago (2016-03-09 22:06:22 UTC) #73
dcheng
On 2016/03/09 at 22:06:22, dskiba wrote: > On 2016/03/09 22:00:07, hans wrote: > > https://codereview.chromium.org/1665363002/diff/420001/tools/clang/plugins/tests/ipc.txt ...
4 years, 9 months ago (2016-03-09 22:08:32 UTC) #74
hans
On 2016/03/09 22:08:32, dcheng wrote: > On 2016/03/09 at 22:06:22, dskiba wrote: > > On ...
4 years, 9 months ago (2016-03-09 22:09:28 UTC) #75
Nico
Can we revert until then to unlock the roll? On Mar 9, 2016 5:09 PM, ...
4 years, 9 months ago (2016-03-09 22:49:55 UTC) #76
Dmitry Skiba
On 2016/03/09 22:49:55, Nico wrote: > Can we revert until then to unlock the roll? ...
4 years, 9 months ago (2016-03-09 22:54:06 UTC) #77
Dmitry Skiba
On 2016/03/09 22:54:06, Dmitry Skiba wrote: > On 2016/03/09 22:49:55, Nico wrote: > > Can ...
4 years, 9 months ago (2016-03-09 22:55:43 UTC) #78
Dmitry Skiba
On 2016/03/09 22:55:43, Dmitry Skiba wrote: > On 2016/03/09 22:54:06, Dmitry Skiba wrote: > > ...
4 years, 9 months ago (2016-03-09 23:04:31 UTC) #79
Nico
A revert of this CL (patchset #22 id:420001) has been created in https://codereview.chromium.org/1783803002/ by thakis@chromium.org. ...
4 years, 9 months ago (2016-03-10 15:13:30 UTC) #80
Dmitry Skiba
4 years, 9 months ago (2016-03-18 00:10:26 UTC) #81
Message was sent while issue was closed.
Oops, this is the old CL. I'll created a new one and reupload latest change
there.

Powered by Google App Engine
This is Rietveld 408576698