Skip to content

Commit

Permalink
A new --no-client-reconnect command that disables the 'client.reconne…
Browse files Browse the repository at this point in the history
…ct' 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. :)
  • Loading branch information
Kalroth authored and veox committed Mar 24, 2014
1 parent aa471a2 commit 01b3f70
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions miner.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions sgminer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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"),
Expand Down
5 changes: 5 additions & 0 deletions util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 01b3f70

Please sign in to comment.