summaryrefslogtreecommitdiff
path: root/57/ac233bf93b417b75d58eec024c6135e4b9dd7e
blob: e4e1218dde376d19afb10930128dbec4a8f78474 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193]
	helo=mx.sourceforge.net)
	by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76)
	(envelope-from <mh.in.england@gmail.com>) id 1WGnXd-0004XV-Mg
	for bitcoin-development@lists.sourceforge.net;
	Fri, 21 Feb 2014 10:41:13 +0000
Received-SPF: pass (sog-mx-3.v43.ch3.sourceforge.com: domain of gmail.com
	designates 209.85.219.44 as permitted sender)
	client-ip=209.85.219.44; envelope-from=mh.in.england@gmail.com;
	helo=mail-oa0-f44.google.com; 
Received: from mail-oa0-f44.google.com ([209.85.219.44])
	by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128)
	(Exim 4.76) id 1WGnXb-00023k-TG
	for bitcoin-development@lists.sourceforge.net;
	Fri, 21 Feb 2014 10:41:13 +0000
Received: by mail-oa0-f44.google.com with SMTP id g12so3905643oah.3
	for <bitcoin-development@lists.sourceforge.net>;
	Fri, 21 Feb 2014 02:41:06 -0800 (PST)
MIME-Version: 1.0
X-Received: by 10.60.84.199 with SMTP id b7mr7721244oez.55.1392979266414; Fri,
	21 Feb 2014 02:41:06 -0800 (PST)
Sender: mh.in.england@gmail.com
Received: by 10.76.71.231 with HTTP; Fri, 21 Feb 2014 02:41:06 -0800 (PST)
In-Reply-To: <CAJHLa0Pfc5wfGT6Rk3ZoRS-rE8Cw6AaRXDyxUCOjAYUesoCxJg@mail.gmail.com>
References: <CAJHLa0OD7w0Rs5ygAE4C14EWm1=x57YHG2kOee1pzxvj3FQ38g@mail.gmail.com>
	<CANEZrP2siw9hGPVsPjQ6WyohacOrs8rqs5p9ZsFY5kF0URnPWg@mail.gmail.com>
	<CAJHLa0Pfc5wfGT6Rk3ZoRS-rE8Cw6AaRXDyxUCOjAYUesoCxJg@mail.gmail.com>
Date: Fri, 21 Feb 2014 16:11:06 +0530
X-Google-Sender-Auth: vwmnx7QqZx8PFYQ8sukVhIB4luM
Message-ID: <CANEZrP3x368f66LyZr_Kfp=4JULqxUn_6eDCEzc_ALe20xZYJQ@mail.gmail.com>
From: Mike Hearn <mike@plan99.net>
To: Jeff Garzik <jgarzik@bitpay.com>
Content-Type: multipart/alternative; boundary=089e0102dc825b740d04f2e8427e
X-Spam-Score: -0.5 (/)
X-Spam-Report: Spam Filtering performed by mx.sourceforge.net.
	See http://spamassassin.org/tag/ for more details.
	-1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for
	sender-domain
	0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider
	(mh.in.england[at]gmail.com)
	-0.0 SPF_PASS               SPF: sender matches SPF record
	1.0 HTML_MESSAGE           BODY: HTML included in message
	0.1 DKIM_SIGNED            Message has a DKIM or DK signature,
	not necessarily valid
	-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
X-Headers-End: 1WGnXb-00023k-TG
Cc: Bitcoin Dev <bitcoin-development@lists.sourceforge.net>
Subject: Re: [Bitcoin-development] Bitcoin Core trial balloon: splitting
 blockchain engine and wallet
X-BeenThere: bitcoin-development@lists.sourceforge.net
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <bitcoin-development.lists.sourceforge.net>
List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/bitcoin-development>,
	<mailto:bitcoin-development-request@lists.sourceforge.net?subject=unsubscribe>
List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=bitcoin-development>
List-Post: <mailto:bitcoin-development@lists.sourceforge.net>
List-Help: <mailto:bitcoin-development-request@lists.sourceforge.net?subject=help>
List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/bitcoin-development>,
	<mailto:bitcoin-development-request@lists.sourceforge.net?subject=subscribe>
X-List-Received-Date: Fri, 21 Feb 2014 10:41:13 -0000

--089e0102dc825b740d04f2e8427e
Content-Type: text/plain; charset=UTF-8

I'm not sure it does really - typical C/C++ exploits let you run arbitrary
code, at which point you can quite easily ptrace the other process and do
whatever you want with it, or read /proc/pid/mem etc. But process
separation is certainly a prerequisite for sandboxing so I'm not arguing
against such a change, just pointing out that it requires some work to
really get the benefits. Also an SPV Bitcoin Core would obviously be of
tremendous utility all by itself ...


On Fri, Feb 21, 2014 at 12:20 PM, Jeff Garzik <jgarzik@bitpay.com> wrote:

> RE "doesn't buy you anything"   Today, when unlocked, plaintext
> private keys reside in the same address space as the blockchain engine
> (BCE).  Process separation increases the difficulty of accessing key
> data from the BCE, even presuming a normal, no-chroot, same-uid,
> parent-child process relationship.  The attack surface is clearly
> changed from "one buffer overflow can touch this data."
>
> Regardless, the split makes sense given existing modularity and coding
> directions.  I wouldn't micro-focus on the "sandbox" word.
>
> On Fri, Feb 21, 2014 at 1:27 AM, Mike Hearn <mike@plan99.net> wrote:
> > Bear in mind a separate process doesn't buy you anything without a
> sandbox,
> > and those are expensive (in terms of complexity).
> >
> > On 21 Feb 2014 11:40, "Jeff Garzik" <jgarzik@bitpay.com> wrote:
> >>
> >> [Meta: "Bitcoin Core" is the newfangled branding of bitcoind /
> >> Bitcoin-Qt reference implementation, in case you wondering.]
> >>
> >> Several sites, including BitPay, use bitcoind outside the standard
> >> role of wallet software.  bitcoind can be used purely for payment
> >> network access and management.  I call this the "border router" role.
> >> Upcoming version 0.9 will feature the ability to disable the bitcoind
> >> wallet at compile time or runtime. This permits a more optimized
> >> border router profile, reducing process size by 40-200MB according to
> >> some reports.
> >>
> >> Recent IRC discussion have floated a rough proposal for a wallet
> >> next-step:  Running the Bitcoin Core wallet as a separate process, a
> >> separate binary, from the blockchain engine.  The wallet process would
> >> communicate with the blockchain engine using existing RPC and P2P
> >> channels, becoming a real SPV client.  This accomplishes a
> >> longstanding security goal of sandboxing away wallet keys and
> >> sensitive data from the network-exposed P2P engine, in a separate
> >> process, among other benefits.
> >>
> >> Simple forking was explored a bit.  I did some hacking in that
> >> direction, as it seemed potentially lightweight and somewhat easy to
> >> me: https://github.com/jgarzik/bitcoin/tree/fork  fork+pipe is fine
> >> for Linux and OSX/BSD.  However, Windows requires an exec-like
> >> solution to create a new process.  MSDN does give us a Unix-pipe-like
> >> solution:
> >> http://msdn.microsoft.com/en-us/library/edze9h7e%28v=vs.80%29.aspx
> >>  Others pointed to boost interprocess communication APIs, which come
> >> with their own set of caveats.  Such a solution would involve a brand
> >> new IPC protocol, and lots of brand new glue code.
> >>
> >> Separate programs seems better.  Windows forces us to achieve process
> >> separation via exec-like method.  We already have IPC: RPC + P2P.
> >> Modern OS's make localhost sockets just about as fast as other IPCs
> >> methods.  Linux, at least, employs zero-copy for localhost sockets in
> >> many situations, similar to the kernel's pipe tricks.
> >>
> >> Pieter has been working on headers-first sync:
> >> https://github.com/bitcoin/bitcoin/pull/2964  Moving along this
> >> wallet/blockchain engine split requires upping the review&test
> >> bandwidth on Pieter's PRs, such as
> >> https://github.com/bitcoin/bitcoin/pull/3514
> >>
> >> Unsure how much of the separate-binary discussion Gavin saw, so cc'd
> >> for emphasis.
> >>
> >> --
> >> Jeff Garzik
> >> Bitcoin core developer and open source evangelist
> >> BitPay, Inc.      https://bitpay.com/
> >>
> >>
> >>
> ------------------------------------------------------------------------------
> >> Managing the Performance of Cloud-Based Applications
> >> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> >> Read the Whitepaper.
> >>
> >>
> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
> >> _______________________________________________
> >> Bitcoin-development mailing list
> >> Bitcoin-development@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/bitcoin-development
>
>
>
> --
> Jeff Garzik
> Bitcoin core developer and open source evangelist
> BitPay, Inc.      https://bitpay.com/
>

--089e0102dc825b740d04f2e8427e
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I&#39;m not sure it does really - typical C/C++ exploits l=
et you run arbitrary code, at which point you can quite easily ptrace the o=
ther process and do whatever you want with it, or read /proc/pid/mem etc. B=
ut process separation is certainly a prerequisite for sandboxing so I&#39;m=
 not arguing against such a change, just pointing out that it requires some=
 work to really get the benefits. Also an SPV Bitcoin Core would obviously =
be of tremendous utility all by itself ...</div>
<div class=3D"gmail_extra"><br><br><div class=3D"gmail_quote">On Fri, Feb 2=
1, 2014 at 12:20 PM, Jeff Garzik <span dir=3D"ltr">&lt;<a href=3D"mailto:jg=
arzik@bitpay.com" target=3D"_blank">jgarzik@bitpay.com</a>&gt;</span> wrote=
:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-le=
ft:1px #ccc solid;padding-left:1ex">
RE &quot;doesn&#39;t buy you anything&quot; =C2=A0 Today, when unlocked, pl=
aintext<br>
private keys reside in the same address space as the blockchain engine<br>
(BCE). =C2=A0Process separation increases the difficulty of accessing key<b=
r>
data from the BCE, even presuming a normal, no-chroot, same-uid,<br>
parent-child process relationship. =C2=A0The attack surface is clearly<br>
changed from &quot;one buffer overflow can touch this data.&quot;<br>
<br>
Regardless, the split makes sense given existing modularity and coding<br>
directions. =C2=A0I wouldn&#39;t micro-focus on the &quot;sandbox&quot; wor=
d.<br>
<div class=3D"im HOEnZb"><br>
On Fri, Feb 21, 2014 at 1:27 AM, Mike Hearn &lt;<a href=3D"mailto:mike@plan=
99.net">mike@plan99.net</a>&gt; wrote:<br>
</div><div class=3D"HOEnZb"><div class=3D"h5">&gt; Bear in mind a separate =
process doesn&#39;t buy you anything without a sandbox,<br>
&gt; and those are expensive (in terms of complexity).<br>
&gt;<br>
&gt; On 21 Feb 2014 11:40, &quot;Jeff Garzik&quot; &lt;<a href=3D"mailto:jg=
arzik@bitpay.com">jgarzik@bitpay.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; [Meta: &quot;Bitcoin Core&quot; is the newfangled branding of bitc=
oind /<br>
&gt;&gt; Bitcoin-Qt reference implementation, in case you wondering.]<br>
&gt;&gt;<br>
&gt;&gt; Several sites, including BitPay, use bitcoind outside the standard=
<br>
&gt;&gt; role of wallet software. =C2=A0bitcoind can be used purely for pay=
ment<br>
&gt;&gt; network access and management. =C2=A0I call this the &quot;border =
router&quot; role.<br>
&gt;&gt; Upcoming version 0.9 will feature the ability to disable the bitco=
ind<br>
&gt;&gt; wallet at compile time or runtime. This permits a more optimized<b=
r>
&gt;&gt; border router profile, reducing process size by 40-200MB according=
 to<br>
&gt;&gt; some reports.<br>
&gt;&gt;<br>
&gt;&gt; Recent IRC discussion have floated a rough proposal for a wallet<b=
r>
&gt;&gt; next-step: =C2=A0Running the Bitcoin Core wallet as a separate pro=
cess, a<br>
&gt;&gt; separate binary, from the blockchain engine. =C2=A0The wallet proc=
ess would<br>
&gt;&gt; communicate with the blockchain engine using existing RPC and P2P<=
br>
&gt;&gt; channels, becoming a real SPV client. =C2=A0This accomplishes a<br=
>
&gt;&gt; longstanding security goal of sandboxing away wallet keys and<br>
&gt;&gt; sensitive data from the network-exposed P2P engine, in a separate<=
br>
&gt;&gt; process, among other benefits.<br>
&gt;&gt;<br>
&gt;&gt; Simple forking was explored a bit. =C2=A0I did some hacking in tha=
t<br>
&gt;&gt; direction, as it seemed potentially lightweight and somewhat easy =
to<br>
&gt;&gt; me: <a href=3D"https://github.com/jgarzik/bitcoin/tree/fork" targe=
t=3D"_blank">https://github.com/jgarzik/bitcoin/tree/fork</a> =C2=A0fork+pi=
pe is fine<br>
&gt;&gt; for Linux and OSX/BSD. =C2=A0However, Windows requires an exec-lik=
e<br>
&gt;&gt; solution to create a new process. =C2=A0MSDN does give us a Unix-p=
ipe-like<br>
&gt;&gt; solution:<br>
&gt;&gt; <a href=3D"http://msdn.microsoft.com/en-us/library/edze9h7e%28v=3D=
vs.80%29.aspx" target=3D"_blank">http://msdn.microsoft.com/en-us/library/ed=
ze9h7e%28v=3Dvs.80%29.aspx</a><br>
&gt;&gt; =C2=A0Others pointed to boost interprocess communication APIs, whi=
ch come<br>
&gt;&gt; with their own set of caveats. =C2=A0Such a solution would involve=
 a brand<br>
&gt;&gt; new IPC protocol, and lots of brand new glue code.<br>
&gt;&gt;<br>
&gt;&gt; Separate programs seems better. =C2=A0Windows forces us to achieve=
 process<br>
&gt;&gt; separation via exec-like method. =C2=A0We already have IPC: RPC + =
P2P.<br>
&gt;&gt; Modern OS&#39;s make localhost sockets just about as fast as other=
 IPCs<br>
&gt;&gt; methods. =C2=A0Linux, at least, employs zero-copy for localhost so=
ckets in<br>
&gt;&gt; many situations, similar to the kernel&#39;s pipe tricks.<br>
&gt;&gt;<br>
&gt;&gt; Pieter has been working on headers-first sync:<br>
&gt;&gt; <a href=3D"https://github.com/bitcoin/bitcoin/pull/2964" target=3D=
"_blank">https://github.com/bitcoin/bitcoin/pull/2964</a> =C2=A0Moving alon=
g this<br>
&gt;&gt; wallet/blockchain engine split requires upping the review&amp;test=
<br>
&gt;&gt; bandwidth on Pieter&#39;s PRs, such as<br>
&gt;&gt; <a href=3D"https://github.com/bitcoin/bitcoin/pull/3514" target=3D=
"_blank">https://github.com/bitcoin/bitcoin/pull/3514</a><br>
&gt;&gt;<br>
&gt;&gt; Unsure how much of the separate-binary discussion Gavin saw, so cc=
&#39;d<br>
&gt;&gt; for emphasis.<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Jeff Garzik<br>
&gt;&gt; Bitcoin core developer and open source evangelist<br>
&gt;&gt; BitPay, Inc. =C2=A0 =C2=A0 =C2=A0<a href=3D"https://bitpay.com/" t=
arget=3D"_blank">https://bitpay.com/</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; ------------------------------------------------------------------=
------------<br>
&gt;&gt; Managing the Performance of Cloud-Based Applications<br>
&gt;&gt; Take advantage of what the Cloud has to offer - Avoid Common Pitfa=
lls.<br>
&gt;&gt; Read the Whitepaper.<br>
&gt;&gt;<br>
&gt;&gt; <a href=3D"http://pubads.g.doubleclick.net/gampad/clk?id=3D1210544=
71&amp;iu=3D/4140/ostg.clktrk" target=3D"_blank">http://pubads.g.doubleclic=
k.net/gampad/clk?id=3D121054471&amp;iu=3D/4140/ostg.clktrk</a><br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Bitcoin-development mailing list<br>
&gt;&gt; <a href=3D"mailto:Bitcoin-development@lists.sourceforge.net">Bitco=
in-development@lists.sourceforge.net</a><br>
&gt;&gt; <a href=3D"https://lists.sourceforge.net/lists/listinfo/bitcoin-de=
velopment" target=3D"_blank">https://lists.sourceforge.net/lists/listinfo/b=
itcoin-development</a><br>
<br>
<br>
<br>
--<br>
Jeff Garzik<br>
Bitcoin core developer and open source evangelist<br>
BitPay, Inc. =C2=A0 =C2=A0 =C2=A0<a href=3D"https://bitpay.com/" target=3D"=
_blank">https://bitpay.com/</a><br>
</div></div></blockquote></div><br></div>

--089e0102dc825b740d04f2e8427e--