1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-10 14:58:01 +00:00

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. :)
This commit is contained in:
Martin Danielsen 2014-03-24 00:59:31 +01:00 committed by Noel Maersk
parent aa471a2dfd
commit 01b3f70b63
3 changed files with 10 additions and 0 deletions

View File

@ -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;

View File

@ -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[] = {
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
View File

@ -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);