Commit graph

29219 commits

Author SHA1 Message Date
Joey Hess
15be5c04a6
git-annex-shell, remotedaemon, git remote: Fix some memory DOS attacks.
The attacker could just send a very lot of data, with no \n and it would
all be buffered in memory until the kernel killed git-annex or perhaps OOM
killed some other more valuable process.

This is a low impact security hole, only affecting communication between
local git-annex and git-annex-shell on the remote system. (With either
able to be the attacker). Only those with the right ssh key can do it. And,
there are probably lots of ways to construct git repositories that make git
use a lot of memory in various ways, which would have similar impact as
this attack.

The fix in P2P/IO.hs would have been higher impact, if it had made it to a
released version, since it would have allowed DOSing the tor hidden
service without needing to authenticate.

(The LockContent and NotifyChanges instances may not be really
exploitable; since the line is read and ignored, it probably gets read
lazily and does not end up staying buffered in memory.)
2016-12-09 13:34:32 -04:00
Joey Hess
3d759a0322
debug on error serving peer 2016-12-09 13:00:19 -04:00
Joey Hess
58f5d41cac
fix 2016-12-09 12:56:38 -04:00
Joey Hess
0f3a3ff1e5
make clear that log is only updated after successful removal
This does not change behavior, because an exception is thrown on
unsuccessful removal. But is clearer.
2016-12-09 12:54:18 -04:00
Joey Hess
bdf2a31424
typo 2016-12-09 12:54:12 -04:00
Joey Hess
71e8cd408e
content removal is supposed to succed if the content was already not present 2016-12-09 12:48:22 -04:00
Joey Hess
ca1bcdcd7c
improve warning on connection loss 2016-12-09 12:35:45 -04:00
Joey Hess
9c5c24aa0a
todo 2016-12-08 20:55:46 -04:00
Joey Hess
e84165dc5e
more todo 2016-12-08 20:15:12 -04:00
Joey Hess
38516b2fca
update progress logs in remotedaemon send/receive 2016-12-08 19:56:02 -04:00
Joey Hess
1f3ed1b6b2
avoid remotedaemon outputting misc Messages when running
It's a daemon or is communictaing with the assistant over stdio, so
should not display checksum messages etc while serving the P2P protocol
etc.
2016-12-08 18:42:59 -04:00
Joey Hess
0f4ee4f298
fix memory leak
I'm unsure why this fixed it, but it did. Seems to suggest that the
memory leak is not due to a bug in my code, but that ghc didn't manage
to take full advantage of laziness, or was failing to gc something it
could have.
2016-12-08 18:42:52 -04:00
Joey Hess
095593a9af
correction 2016-12-08 18:25:51 -04:00
Joey Hess
3b9f6c1b2b
analysis 2016-12-08 17:50:59 -04:00
Joey Hess
5654085e7a
profiling 2016-12-08 17:34:26 -04:00
Joey Hess
41ed0770df
consistent caps 2016-12-08 17:17:01 -04:00
Joey Hess
da8c65601f
comment 2016-12-08 17:12:02 -04:00
Joey Hess
8e00efb938
didn't mean to commit this change yet 2016-12-08 17:10:48 -04:00
Joey Hess
43e7044b43
comment 2016-12-08 17:10:24 -04:00
Joey Hess
0288e934cc
update instructions to work better 2016-12-08 16:55:40 -04:00
Joey Hess
b8fea9f08d
we have a memory leak 2016-12-08 16:35:33 -04:00
Joey Hess
d8f1a0d95c
move byteable to main dep list
Only the webapp had pulled it in, but the authtoken code uses it now.
2016-12-08 16:31:08 -04:00
Joey Hess
2ad06ded7e
force sofar calculation
This could avoid a memory leak. It would only happen when
the meter didn't look at sofar.
2016-12-08 16:28:07 -04:00
Joey Hess
c6972cb914
better format error 2016-12-08 16:02:26 -04:00
Joey Hess
39b7eb7350
update 2016-12-08 16:00:29 -04:00
Joey Hess
23438fb80f
move to debug 2016-12-08 15:56:36 -04:00
Joey Hess
af41519126
convert P2P runners from Maybe to Either String
So we get some useful error messages when things fail.

This commit was sponsored by Peter Hogg on Patreon.
2016-12-08 15:47:49 -04:00
Joey Hess
c05f4eb631
fix laziness problem in git relaying
The switch to hGetMetered subtly changed the laziness of how DATA was
read, and broke git protocol relaying. Fix by sending received data to
the git process's stdin immediately, which ensures that the lazy
bytestring is all read from the peer before going on to process the next
message from the peer.
2016-12-08 15:15:29 -04:00
Joey Hess
e56506d83c
include error message when unable to connect to peer 2016-12-08 14:14:08 -04:00
Joey Hess
b613ccf7a3
update 2016-12-08 13:58:11 -04:00
Joey Hess
df67626cb7
fix build with old ghc 2016-12-08 13:58:03 -04:00
Joey Hess
44c55e2441
fix links 2016-12-07 16:11:30 -04:00
Joey Hess
0766d032bf
link to git-annex-metadata-gui 2016-12-07 16:09:30 -04:00
Joey Hess
8e5f8d91c5
add git-annex-adaptor 2016-12-07 16:06:56 -04:00
Joey Hess
62043df289
git-annex-metadata-gui yay! 2016-12-07 16:00:12 -04:00
Joey Hess
ed6a5bc271
devblog 2016-12-07 15:50:54 -04:00
Joey Hess
138f618002
todo 2016-12-07 15:49:15 -04:00
Joey Hess
46cbd65808
add page for tor special remote 2016-12-07 15:44:52 -04:00
Joey Hess
e5476d42ce
update 2016-12-07 15:38:37 -04:00
Joey Hess
0541f19bea
fix math error that caused resumes to always fail 2016-12-07 15:36:39 -04:00
Joey Hess
db79b69aa0
ReadWriteMode not AppendMode
AppendMode does not allow seeking..
2016-12-07 15:24:28 -04:00
Joey Hess
76b46afed1
add section on tor speed 2016-12-07 15:21:38 -04:00
Joey Hess
99c36f318c
open file for append, not write, so resuming works
WriteMode zeros any existing content, so the seek filled with zeros, and
verification failed after download.
2016-12-07 15:06:07 -04:00
Joey Hess
b55399e3ac
offset meters when resuming 2016-12-07 14:52:10 -04:00
Joey Hess
5ff85c8515
todo 2016-12-07 14:46:27 -04:00
Joey Hess
2fb6fd7434
Merge branch 'master' into tor 2016-12-07 14:32:25 -04:00
Joey Hess
ad5ef51040
more p2p progress meters
Display progress meter on send and receive from remote.

Added a new hGetMetered that can read an exact number of bytes (or
less), updating a meter as it goes.

This commit was sponsored by Andreas on Patreon.
2016-12-07 14:25:01 -04:00
Joey Hess
f3a3dc14ec
add section on security 2016-12-07 13:58:10 -04:00
Joey Hess
83ea1cec86
update progress meter when sending to p2p remote
This commit was sponsored by Thom May on Patreon.
2016-12-07 13:37:35 -04:00
Joey Hess
7c245b2180
update 2016-12-07 12:48:24 -04:00