Browse Source

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.

There's also an additional message when the reconnect happens: "WARNING: POTENTIAL CLIENT.EXPLOIT!", but it requires you to be actively monitoring your log to catch it, and in which case you already get a "Reconnect requested from Pool 0 to 127.0.0.1" message.

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

Oh and this is dry-coded. :)
build-mingw
Martin Danielsen 11 years ago committed by Noel Maersk
parent
commit
01b3f70b63
  1. 1
      miner.h
  2. 4
      sgminer.c
  3. 5
      util.c

1
miner.h

@ -975,6 +975,7 @@ extern bool opt_api_listen; @@ -975,6 +975,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 bool opt_worktime;
extern int swork_id;

4
sgminer.c

@ -151,6 +151,7 @@ int opt_api_mcast_port = 4028; @@ -151,6 +151,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;
#if defined(HAVE_LIBCURL) && defined(CURL_HAS_KEEPALIVE)
@ -1267,6 +1268,9 @@ static struct opt_table opt_config_table[] = { @@ -1267,6 +1268,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 GPUs that hang"),

5
util.c

@ -1676,6 +1676,11 @@ static void __suspend_stratum(struct pool *pool) @@ -1676,6 +1676,11 @@ static void __suspend_stratum(struct pool *pool)
static bool parse_reconnect(struct pool *pool, json_t *val)
{
char *sockaddr_url, *stratum_port, *tmp;
if (opt_disable_client_reconnect)
return false;
applog(LOG_ERR, "WARNING: POTENTIAL CLIENT.EXPLOIT!");
char *url, *port, address[256];
memset(address, 0, 255);

Loading…
Cancel
Save