Skip to content

Openssl drbg#1517

Merged
sporksmith merged 1 commit intoshadow:mainfrom
sporksmith:openssl-drbg
Jul 19, 2021
Merged

Openssl drbg#1517
sporksmith merged 1 commit intoshadow:mainfrom
sporksmith:openssl-drbg

Conversation

@sporksmith
Copy link
Copy Markdown
Contributor

@sporksmith sporksmith commented Jul 16, 2021

Adapted from shadow-plugin-tor. I only took the RNG overrides, since those seemed generic enough to plausibly work with other programs besides tor.

Not sure whether we'll want the "nop crypto" overrides as well, but if so it should probably be able to be used independently of the RNG overrides; e.g. by putting them in a separate library.

Progress on #666

Before this PR, the heartbeat data diverges at around 8 sim minutes. (Only showing the first few lines of the diff for brevity)

$ (cd build/src/test/tor/minimal/ && for i in 1 2; do rm -rf data-$i && /home/jnewsome/projects/shadow/dev/build/src/main/shadow          --data-directory=data-$i          --interpose-method=preload          --log-level=info          --use-cpu-pinning true --parallelism 2 --template-directory shadow.data.template          /home/jnewsome/projects/shadow/dev/src/test/tor/minimal/tor-minimal.yaml  > $i.log && cat $i.log | cut -d' ' -f 2- | grep heartbeat | grep -v "process resource usage" | sort -s > $i.log.norm ; done ; diff [12].log.norm | head -n 30)
** Starting Shadow v2.0.0-pre.2-36-g7150c559 2021-07-16--13:45:11 with GLib v2.64.6 and IGraph v0.7.1
** Stopping Shadow, returning code 0 (success)
** Starting Shadow v2.0.0-pre.2-36-g7150c559 2021-07-16--13:45:11 with GLib v2.64.6 and IGraph v0.7.1
** Stopping Shadow, returning code 0 (success)
485,487c485,487
< [worker-0] 00:08:03.000000000 [INFO] [relay1:11.0.0.6] [tracker.c:456] [_tracker_logNode] [shadow-heartbeat] [node] 1,330,616,0.000000,0,0.000000;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0;4,330,3,198,0,0,1,66,66,0,0,0;5,616,4,264,0,0,1,66,286,0,0,0
< [worker-0] 00:08:04.000000000 [INFO] [relay1:11.0.0.6] [tracker.c:456] [_tracker_logNode] [shadow-heartbeat] [node] 1,330,616,0.000000,0,0.000000;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0;4,330,3,198,0,0,1,66,66,0,0,0;5,616,4,264,0,0,1,66,286,0,0,0
< [worker-0] 00:08:05.000000000 [INFO] [relay1:11.0.0.6] [tracker.c:456] [_tracker_logNode] [shadow-heartbeat] [node] 1,0,0,0.000000,0,0.000000;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0
---
> [worker-0] 00:08:03.000000000 [INFO] [relay1:11.0.0.6] [tracker.c:456] [_tracker_logNode] [shadow-heartbeat] [node] 1,0,0,0.000000,0,0.000000;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0
> [worker-0] 00:08:04.000000000 [INFO] [relay1:11.0.0.6] [tracker.c:456] [_tracker_logNode] [shadow-heartbeat] [node] 1,0,0,0.000000,0,0.000000;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0
> [worker-0] 00:08:05.000000000 [INFO] [relay1:11.0.0.6] [tracker.c:456] [_tracker_logNode] [shadow-heartbeat] [node] 1,330,616,0.000000,0,0.000000;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0;4,330,3,198,0,0,1,66,66,0,0,0;5,616,4,264,0,0,1,66,286,0,0,0
491c491
< [worker-0] 00:08:09.000000000 [INFO] [relay1:11.0.0.6] [tracker.c:456] [_tracker_logNode] [shadow-heartbeat] [node] 1,330,616,0.000000,0,0.000000;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0;4,330,3,198,0,0,1,66,66,0,0,0;5,616,4,264,0,0,1,66,286,0,0,0
---
> [worker-0] 00:08:09.000000000 [INFO] [relay1:11.0.0.6] [tracker.c:456] [_tracker_logNode] [shadow-heartbeat] [node] 1,0,0,0.000000,0,0.000000;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0
493c493
< [worker-0] 00:08:11.000000000 [INFO] [relay1:11.0.0.6] [tracker.c:456] [_tracker_logNode] [shadow-heartbeat] [node] 1,3142,3274,0.000000,0,0.000000;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0;7,3142,2,132,0,0,5,330,2680,0,0,0;9,3274,4,264,0,0,5,330,2680,0,0,0
---
> [worker-0] 00:08:11.000000000 [INFO] [relay1:11.0.0.6] [tracker.c:456] [_tracker_logNode] [shadow-heartbeat] [node] 1,3472,3890,0.000000,0,0.000000;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0;11,3472,5,330,0,0,6,396,2746,0,0,0;14,3890,8,528,0,0,6,396,2966,0,0,0
496c496
< [worker-0] 00:08:14.000000000 [INFO] [relay1:11.0.0.6] [tracker.c:456] [_tracker_logNode] [shadow-heartbeat] [node] 1,0,0,0.000000,0,0.000000;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0
---
> [worker-0] 00:08:14.000000000 [INFO] [relay1:11.0.0.6] [tracker.c:456] [_tracker_logNode] [shadow-heartbeat] [node] 1,330,616,0.000000,0,0.000000;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0;4,330,3,198,0,0,1,66,66,0,0,0;5,616,4,264,0,0,1,66,286,0,0,0
498c498
< [worker-0] 00:08:16.000000000 [INFO] [relay1:11.0.0.6] [tracker.c:456] [_tracker_logNode] [shadow-heartbeat] [node] 1,668,668,0.000000,0,0.000000;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0;2,668,1,66,0,0,1,66,536,0,0,0;2,668,1,66,0,0,1,66,536,0,0,0
---
> [worker-0] 00:08:16.000000000 [INFO] [relay1:11.0.0.6] [tracker.c:456] [_tracker_logNode] [shadow-heartbeat] [node] 1,998,1284,0.000000,0,0.000000;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0;6,998,4,264,0,0,2,132,602,0,0,0;7,1284,5,330,0,0,2,132,822,0,0,0
503c503
< [worker-0] 00:08:21.000000000 [INFO] [relay1:11.0.0.6] [tracker.c:456] [_tracker_logNode] [shadow-heartbeat] [node] 1,0,0,0.000000,0,0.000000;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0
---
> [worker-0] 00:08:21.000000000 [INFO] [relay1:11.0.0.6] [tracker.c:456] [_tracker_logNode] [shadow-heartbeat] [node] 1,330,616,0.000000,0,0.000000;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0;4,330,3,198,0,0,1,66,66,0,0,0;5,616,4,264,0,0,1,66,286,0,0,0
505c505
< [worker-0] 00:08:23.000000000 [INFO] [relay1:11.0.0.6] [tracker.c:456] [_tracker_logNode] [shadow-heartbeat] [node] 1,0,0,0.000000,0,0.000000;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0;0,0,0,0,0,0,0,0,0,0,0,0

With this PR the heartbeats match up completely:

$ (cd build/src/test/tor/minimal/ && for i in 1 2; do rm -rf data-$i && /home/jnewsome/projects/shadow/dev/build/src/main/shadow          --data-directory=data-$i          --interpose-method=preload          --log-level=info          --use-cpu-pinning true --parallelism 2 --template-directory shadow.data.template          /home/jnewsome/projects/shadow/dev/src/test/tor/minimal/tor-minimal.yaml  > $i.log && cat $i.log | cut -d' ' -f 2- | grep heartbeat | grep -v "process resource usage" | sort -s > $i.log.norm ; done ; diff [12].log.norm | head -n 30)
** Starting Shadow v2.0.0-pre.2-40-gaacf276f 2021-07-16--14:07:08 with GLib v2.64.6 and IGraph v0.7.1
** Stopping Shadow, returning code 0 (success)
** Starting Shadow v2.0.0-pre.2-40-gaacf276f 2021-07-16--14:07:08 with GLib v2.64.6 and IGraph v0.7.1
** Stopping Shadow, returning code 0 (success)

@github-actions github-actions bot added Component: Build Build/install tools and dependencies Component: Documentation In-repository documentation, under docs/ Component: Libraries Support functions like LD_PRELOAD and logging Component: Main Composing the core Shadow executable Component: Testing Unit and integration tests and frameworks labels Jul 16, 2021
@codecov
Copy link
Copy Markdown

codecov bot commented Jul 16, 2021

Codecov Report

Merging #1517 (aacf276) into main (fa95047) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

❗ Current head aacf276 differs from pull request most recent head 40ea8b5. Consider uploading reports for the commit 40ea8b5 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1517      +/-   ##
==========================================
- Coverage   52.69%   52.68%   -0.01%     
==========================================
  Files         140      141       +1     
  Lines       21134    21150      +16     
  Branches     5345     5343       -2     
==========================================
+ Hits        11136    11143       +7     
- Misses       7055     7066      +11     
+ Partials     2943     2941       -2     
Flag Coverage Δ
tests 52.68% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/lib/openssl_preload/shadow_openssl_rng.c 0.00% <0.00%> (ø)
src/lib/shim/preload_libraries.c 70.03% <ø> (ø)
src/main/core/work/event.c 66.66% <0.00%> (-1.39%) ⬇️
src/test/futex/test_futex.c 65.05% <0.00%> (-0.54%) ⬇️
src/main/host/descriptor/epoll.c 77.73% <0.00%> (-0.36%) ⬇️
src/main/routing/packet.c 71.02% <0.00%> (-0.29%) ⬇️
src/main/host/thread_ptrace.c 50.16% <0.00%> (-0.17%) ⬇️
src/lib/tsc/tsc.c 13.48% <0.00%> (ø)
src/test/tcp/test_tcp.c 33.95% <0.00%> (ø)
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fa95047...40ea8b5. Read the comment docs.

@github-actions github-actions bot removed Component: Documentation In-repository documentation, under docs/ Component: Main Composing the core Shadow executable labels Jul 16, 2021
@sporksmith sporksmith marked this pull request as ready for review July 16, 2021 19:35
@sporksmith sporksmith requested a review from stevenengler July 16, 2021 19:35
@github-actions github-actions bot added the Component: Documentation In-repository documentation, under docs/ label Jul 19, 2021
@sporksmith sporksmith enabled auto-merge (squash) July 19, 2021 15:30
@sporksmith sporksmith disabled auto-merge July 19, 2021 15:30
@sporksmith sporksmith enabled auto-merge July 19, 2021 15:30
@sporksmith sporksmith merged commit fc7518b into shadow:main Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Build Build/install tools and dependencies Component: Documentation In-repository documentation, under docs/ Component: Libraries Support functions like LD_PRELOAD and logging Component: Testing Unit and integration tests and frameworks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants