mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-10 00:57:02 +02:00
BUG/MAJOR: spoe: Don't try to get agent config during SPOP healthcheck
During SPOP healthchecks, a dummy appctx is used to create the HAPROXY-HELLO frame and then to parse the AGENT-HELLO frame. No agent are attached to it. So it is important to not rely on an agent during these stages. When HAPROXY-HELLO frame is created, there is no problem, all accesses to an agent are guarded. This is not true during the parsing of the AGENT-HELLO frame. Thus, it is possible to crash HAProxy with a SPOA declaring the async or the pipelining capability during a healthcheck. This patch must be backported to 1.9 and 1.8.
This commit is contained in:
parent
ff9c9140f4
commit
11389018bc
@ -825,10 +825,14 @@ spoe_handle_agenthello_frame(struct appctx *appctx, char *frame, size_t size)
|
|||||||
SPOE_APPCTX(appctx)->status_code = SPOE_FRM_ERR_NO_FRAME_SIZE;
|
SPOE_APPCTX(appctx)->status_code = SPOE_FRM_ERR_NO_FRAME_SIZE;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if ((flags & SPOE_APPCTX_FL_PIPELINING) && !(agent->flags & SPOE_FL_PIPELINING))
|
if (!agent)
|
||||||
flags &= ~SPOE_APPCTX_FL_PIPELINING;
|
flags &= ~(SPOE_APPCTX_FL_PIPELINING|SPOE_APPCTX_FL_ASYNC);
|
||||||
if ((flags & SPOE_APPCTX_FL_ASYNC) && !(agent->flags & SPOE_FL_ASYNC))
|
else {
|
||||||
flags &= ~SPOE_APPCTX_FL_ASYNC;
|
if ((flags & SPOE_APPCTX_FL_PIPELINING) && !(agent->flags & SPOE_FL_PIPELINING))
|
||||||
|
flags &= ~SPOE_APPCTX_FL_PIPELINING;
|
||||||
|
if ((flags & SPOE_APPCTX_FL_ASYNC) && !(agent->flags & SPOE_FL_ASYNC))
|
||||||
|
flags &= ~SPOE_APPCTX_FL_ASYNC;
|
||||||
|
}
|
||||||
|
|
||||||
SPOE_APPCTX(appctx)->version = (unsigned int)vsn;
|
SPOE_APPCTX(appctx)->version = (unsigned int)vsn;
|
||||||
SPOE_APPCTX(appctx)->max_frame_size = (unsigned int)max_frame_size;
|
SPOE_APPCTX(appctx)->max_frame_size = (unsigned int)max_frame_size;
|
||||||
|
Loading…
Reference in New Issue
Block a user