]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: spoe: clear the applet pointer when the applet fails to start
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 6 Aug 2026 07:26:05 +0000 (09:26 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 7 Aug 2026 08:29:19 +0000 (10:29 +0200)
commitc4184069d4cd2cd21090664825c030455de6e948
treea8ef903b88a1d6983c68efab470a6b8e133da639
parenta01ba66bc2573105717a0f4f58b2b48667f1ccba
BUG/MEDIUM: spoe: clear the applet pointer when the applet fails to start

spoe_create_appctx() assigns the freshly allocated spoe_appctx to
ctx->spoe_appctx before creating and initializing the applet, both of which
may fail. On these error paths the spoe_appctx is released but the pointer
is left in the SPOE context, and the caller reports the failure through
spoe_stop_processing(), which reads it back, writes into it, then performs
appctx_strm(sa->owner)->parent = NULL and appctx_wakeup(sa->owner). As
<owner> sits at offset 0, right where pool_free() stores its cache linkage,
it is not even NULL but points into the pool cache, so these two writes go
through a bogus appctx. An allocation failure is needed to reach this,
either the appctx itself or the session/stream set up by spoe_init_appctx().

Let's simply clear ctx->spoe_appctx before releasing the applet context.

This was introduced in 3.1 by commit 07cf7769c ("MEDIUM: spoe: Directly
xfer NOTIFY frame when SPOE applet is created"). It must be backported to
3.1.

Reported-by: Claude (ANT-2026-KBZN81X2)
src/flt_spoe.c