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

Issue 11199007: Add sender verification of D-Bus signals. (Closed)

Created:
8 years, 2 months ago by Haruki Sato
Modified:
8 years, 1 month ago
Reviewers:
keybuk, satorux1
CC:
chromium-reviews
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Add sender verification of D-Bus signals. The CL does the following: - Add a match rule for NameOwnerChanged signal from org.freedesktop.DBus. - Update the owner of the well-known bus name when a NameOwnerChanged comes. - Call GetNameOwner method to update the latest if ObjectProxy instance does not know the owner. - Verify the sender of the signal and reject the unknown senders. - Add UMA_HISTOGRAM_COUNTS "DBus.RejectedSignalCount" for rejected signals. and a unittest. BUG=140938 TEST=manual, unittests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=164597

Patch Set 1 : #

Total comments: 41

Patch Set 2 : address comment, fix tests, rebase #

Patch Set 3 : remove unnecessary code. #

Total comments: 31

Patch Set 4 : address comments. #

Total comments: 10

Patch Set 5 : restore synchronous UpdateNameOwner and use it only in ConnectToSignalInternal #

Total comments: 14

Patch Set 6 : fixes #

Total comments: 2

Patch Set 7 : #

Total comments: 5

Patch Set 8 : use the default #

Unified diffs Side-by-side diffs Delta from patch set Stats (+365 lines, -17 lines) Patch
M dbus/dbus.gyp View 1 chunk +1 line, -0 lines 0 comments Download
M dbus/object_proxy.h View 1 2 3 4 5 2 chunks +21 lines, -0 lines 0 comments Download
M dbus/object_proxy.cc View 1 2 3 4 5 6 7 6 chunks +144 lines, -17 lines 0 comments Download
A dbus/signal_sender_verification_unittest.cc View 1 2 3 4 5 1 chunk +180 lines, -0 lines 0 comments Download
M dbus/test_service.h View 2 chunks +6 lines, -0 lines 0 comments Download
M dbus/test_service.cc View 2 1 chunk +13 lines, -0 lines 0 comments Download

Messages

Total messages: 21 (0 generated)
Haruki Sato
Scott, could you review this especially on the verification logic? Am I doing it right? ...
8 years, 2 months ago (2012-10-19 09:12:38 UTC) #1
satorux1
Initial comments. http://codereview.chromium.org/11199007/diff/2001/dbus/object_proxy.cc File dbus/object_proxy.cc (right): http://codereview.chromium.org/11199007/diff/2001/dbus/object_proxy.cc#newcode27 dbus/object_proxy.cc:27: const dbus::ObjectPath kDbusSystemObjectPath("/org/freedesktop/DBus"); ObjectPath may be POD ...
8 years, 2 months ago (2012-10-22 04:50:42 UTC) #2
satorux1
http://codereview.chromium.org/11199007/diff/2001/dbus/object_proxy.cc File dbus/object_proxy.cc (right): http://codereview.chromium.org/11199007/diff/2001/dbus/object_proxy.cc#newcode532 dbus/object_proxy.cc:532: bool ObjectProxy::AddMatchRuleWithoutCallback( The order does not match with .h ...
8 years, 2 months ago (2012-10-22 05:23:32 UTC) #3
Haruki Sato
Thank you for the thorough review! I'm rewriting it to add async GetNameOwner, I will ...
8 years, 2 months ago (2012-10-22 09:28:45 UTC) #4
Haruki Sato
Now the tests pass! I've added an async version of UpdateNameOwner and restructured the HandleMessage ...
8 years, 2 months ago (2012-10-24 08:28:05 UTC) #5
satorux1
http://codereview.chromium.org/11199007/diff/14003/dbus/object_proxy.cc File dbus/object_proxy.cc (right): http://codereview.chromium.org/11199007/diff/14003/dbus/object_proxy.cc#newcode28 dbus/object_proxy.cc:28: const char* kDbusSystemObjectPath = "/org/freedesktop/DBus"; nit: please do: const ...
8 years, 2 months ago (2012-10-25 01:55:16 UTC) #6
Haruki Sato
http://codereview.chromium.org/11199007/diff/14003/dbus/object_proxy.cc File dbus/object_proxy.cc (right): http://codereview.chromium.org/11199007/diff/14003/dbus/object_proxy.cc#newcode28 dbus/object_proxy.cc:28: const char* kDbusSystemObjectPath = "/org/freedesktop/DBus"; On 2012/10/25 01:55:16, satorux1 ...
8 years, 1 month ago (2012-10-25 07:29:52 UTC) #7
satorux1
http://codereview.chromium.org/11199007/diff/20009/dbus/bus.h File dbus/bus.h (right): http://codereview.chromium.org/11199007/diff/20009/dbus/bus.h#newcode447 dbus/bus.h:447: void ProcessAllIncomingDataIfAny(); No need to expose, right? http://codereview.chromium.org/11199007/diff/20009/dbus/end_to_end_async_unittest.cc File ...
8 years, 1 month ago (2012-10-25 08:56:23 UTC) #8
Haruki Sato
Thank you for the advice! As discussed offline, I restored sync version of UpdateNameOwner and ...
8 years, 1 month ago (2012-10-26 05:03:24 UTC) #9
satorux1
http://codereview.chromium.org/11199007/diff/23003/dbus/object_proxy.cc File dbus/object_proxy.cc (right): http://codereview.chromium.org/11199007/diff/23003/dbus/object_proxy.cc#newcode435 dbus/object_proxy.cc:435: // Handle NameOwnerChanged separately . is missing http://codereview.chromium.org/11199007/diff/23003/dbus/object_proxy.cc#newcode590 dbus/object_proxy.cc:590: ...
8 years, 1 month ago (2012-10-26 05:25:59 UTC) #10
Haruki Sato
http://codereview.chromium.org/11199007/diff/23003/dbus/object_proxy.cc File dbus/object_proxy.cc (right): http://codereview.chromium.org/11199007/diff/23003/dbus/object_proxy.cc#newcode435 dbus/object_proxy.cc:435: // Handle NameOwnerChanged separately On 2012/10/26 05:26:00, satorux1 wrote: ...
8 years, 1 month ago (2012-10-26 05:53:13 UTC) #11
satorux1
one last thing: http://codereview.chromium.org/11199007/diff/25009/dbus/object_proxy.cc File dbus/object_proxy.cc (right): http://codereview.chromium.org/11199007/diff/25009/dbus/object_proxy.cc#newcode617 dbus/object_proxy.cc:617: reader.PopString(&service_name_owner_); We should check the return ...
8 years, 1 month ago (2012-10-26 06:07:28 UTC) #12
Haruki Sato
http://codereview.chromium.org/11199007/diff/25009/dbus/object_proxy.cc File dbus/object_proxy.cc (right): http://codereview.chromium.org/11199007/diff/25009/dbus/object_proxy.cc#newcode617 dbus/object_proxy.cc:617: reader.PopString(&service_name_owner_); On 2012/10/26 06:07:28, satorux1 wrote: > We should ...
8 years, 1 month ago (2012-10-26 07:40:28 UTC) #13
satorux1
LGTM
8 years, 1 month ago (2012-10-26 08:01:08 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/haruki@chromium.org/11199007/27001
8 years, 1 month ago (2012-10-26 08:03:28 UTC) #15
commit-bot: I haz the power
Retried try job too often for step(s) browser_tests
8 years, 1 month ago (2012-10-26 17:54:35 UTC) #16
keybuk
The logic looks good. http://codereview.chromium.org/11199007/diff/27001/dbus/object_proxy.cc File dbus/object_proxy.cc (right): http://codereview.chromium.org/11199007/diff/27001/dbus/object_proxy.cc#newcode31 dbus/object_proxy.cc:31: const int kGetNameOwnerCallTimeoutMs = 1000; ...
8 years, 1 month ago (2012-10-26 20:26:00 UTC) #17
satorux1
http://codereview.chromium.org/11199007/diff/27001/dbus/object_proxy.cc File dbus/object_proxy.cc (right): http://codereview.chromium.org/11199007/diff/27001/dbus/object_proxy.cc#newcode608 dbus/object_proxy.cc:608: kGetNameOwnerCallTimeoutMs, On 2012/10/26 20:26:00, keybuk wrote: > Why not ...
8 years, 1 month ago (2012-10-26 23:41:28 UTC) #18
Haruki Sato
Thank you for the advice! Adding it to CQ again. http://codereview.chromium.org/11199007/diff/27001/dbus/object_proxy.cc File dbus/object_proxy.cc (right): http://codereview.chromium.org/11199007/diff/27001/dbus/object_proxy.cc#newcode31 ...
8 years, 1 month ago (2012-10-29 04:35:09 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/haruki@chromium.org/11199007/39001
8 years, 1 month ago (2012-10-29 04:35:34 UTC) #20
commit-bot: I haz the power
8 years, 1 month ago (2012-10-29 06:27:34 UTC) #21
Change committed as 164597

Powered by Google App Engine
This is Rietveld 408576698