Browse Source

Partial: A new --no-client-reconnect command that disables the 'client.reconnect' function.

It looks like there's an exploit that abuses said command, but it is still not clear exactly how.

Note that disabling 'client.reconnect' might affect some pools that rely on the feature, like pools that you lease your rig to.

Conflicts:
	util.c
Martin Danielsen 12 years ago
parent
commit
92f3dbbf37
4 changed files with 9 additions and 0 deletions
  1. 1 0
      AUTHORS
  2. 4 0
      miner.c
  3. 1 0
      miner.h
  4. 3 0
      util.c

+ 1 - 0
AUTHORS

@@ -31,6 +31,7 @@ Philip Kaufmann <phil.kaufmann@t-online.de>
 Rusty Russell <rusty@rustcorp.com.au>
 Znort 987 <znort987@yahoo.com>
 Phateus <Jesse.Moll@gmail.com>
+Martin Danielsen <kalroth@gmail.com>
 Olivier Gay <olivier.gay@a3.epfl.ch>
 Glenn Francis Murray <glenn@gfm.cc>
 fleger <florian6.leger@laposte.net>

+ 4 - 0
miner.c

@@ -238,6 +238,7 @@ int opt_api_mcast_port = 4028;
 bool opt_api_network;
 bool opt_delaynet;
 bool opt_disable_pool;
+bool opt_disable_client_reconnect = false;
 static bool no_work;
 bool opt_worktime;
 bool opt_weighed_stats;
@@ -2184,6 +2185,9 @@ static struct opt_table opt_config_table[] = {
 	OPT_WITHOUT_ARG("--no-pool-disable",
 			opt_set_invbool, &opt_disable_pool,
 			opt_hidden),
+	OPT_WITHOUT_ARG("--no-client-reconnect",
+			opt_set_invbool, &opt_disable_client_reconnect,
+			"Disable 'client.reconnect' stratum functionality"),
 	OPT_WITHOUT_ARG("--no-restart",
 			opt_set_invbool, &opt_restart,
 			"Do not attempt to restart devices that hang"

+ 1 - 0
miner.h

@@ -924,6 +924,7 @@ extern bool opt_api_listen;
 extern bool opt_api_network;
 extern bool opt_delaynet;
 extern time_t last_getwork;
+extern bool opt_disable_client_reconnect;
 extern bool opt_restart;
 extern char *opt_icarus_options;
 extern char *opt_icarus_timing;

+ 3 - 0
util.c

@@ -1976,6 +1976,9 @@ static bool parse_diff(struct pool *pool, json_t *val)
 
 static bool parse_reconnect(struct pool *pool, json_t *val)
 {
+	if (opt_disable_client_reconnect)
+		return false;
+	
 	const char *url;
 	char address[256];
 	json_t *port_json;