new file mode 100644
@@ -0,0 +1,71 @@
+From 338f6231e347c17a07c381802b1bc3c20c55b529 Mon Sep 17 00:00:00 2001
+From: Roman Arutyunyan <arut@nginx.com>
+Date: Fri, 6 Nov 2026 20:02:09 +0400
+Subject: [PATCH] Resolver: report error on CNAME restart failure
+
+Previously, if restarting a resolve with a CNAME name failed due to a
+memory allocation error, no error was reported. The waiting requests
+were left detached from any node until their timeouts expired.
+
+Now the error is reported to the waiting requests immediately.
+
+CVE: CVE-2026-123634
+Upstream-Status: Backport [https://github.com/nginx/nginx/commit/338f6231e347c17a07c381802b1bc3c20c55b529]
+
+Signed-off-by: Hetvi Thakar <hthakar@cisco.com>
+---
+ src/core/ngx_resolver.c | 34 ++++++++++++++++++++++++++++++++--
+ 1 file changed, 32 insertions(+), 2 deletions(-)
+
+diff --git a/src/core/ngx_resolver.c b/src/core/ngx_resolver.c
+index f8f677878a..ec3df0e875 100644
+--- a/src/core/ngx_resolver.c
++++ b/src/core/ngx_resolver.c
+@@ -2550,7 +2550,22 @@ ngx_resolver_process_a(ngx_resolver_t *r, u_char *buf, size_t n,
+ next->node = NULL;
+ }
+
+- (void) ngx_resolve_name_locked(r, ctx, &name);
++ if (ngx_resolve_name_locked(r, ctx, &name) == NGX_ERROR) {
++
++ /* unlock name mutex */
++
++ do {
++ ctx->state = NGX_ERROR;
++ ctx->valid = ngx_time() + (r->valid ? r->valid : 10);
++ next = ctx->next;
++
++ ctx->handler(ctx);
++
++ ctx = next;
++ } while (ctx);
++
++ return;
++ }
+ }
+
+ /* unlock name mutex */
+@@ -2935,7 +2950,22 @@ ngx_resolver_process_srv(ngx_resolver_t *r, u_char *buf, size_t n,
+ next->node = NULL;
+ }
+
+- (void) ngx_resolve_name_locked(r, ctx, &name);
++ if (ngx_resolve_name_locked(r, ctx, &name) == NGX_ERROR) {
++
++ /* unlock name mutex */
++
++ do {
++ ctx->state = NGX_ERROR;
++ ctx->valid = ngx_time() + (r->valid ? r->valid : 10);
++ next = ctx->next;
++
++ ctx->handler(ctx);
++
++ ctx = next;
++ } while (ctx);
++
++ return;
++ }
+ }
+
+ /* unlock name mutex */
new file mode 100644
@@ -0,0 +1,135 @@
+From 7426c29f140c330dd6c6cdfeb2943be1978c69e0 Mon Sep 17 00:00:00 2001
+From: Roman Arutyunyan <arut@nginx.com>
+Date: Wed, 28 Oct 2026 21:51:48 +0400
+Subject: [PATCH] Resolver: fix non-current resolve finalization from resolve
+ handler
+
+Previously, when a resolve handler called ngx_resolve_name_done() or
+ngx_resolve_addr_done() for another resolve of the same name/address,
+a use-after-free could happen while reporting the finalized resolve.
+This may happen with upstream resolve when at least one subrequest is
+resolving the same name, and the request is terminated from the
+upstream resolve handler.
+
+The problem occurs when finalizing a non-current resolve that is
+already detached from rn->waiting and is about to be reported. Such
+cases produced "could not cancel" alerts. The resolve may also be
+detached with its node reset, while following a CNAME, in which case
+no alert was produced.
+
+Now the alerts are converted to debug messages and a finalizer is
+installed into ctx->handler to release the context memory later.
+
+Reported by Xint.io.
+
+CVE: CVE-2026-123634
+Upstream-Status: Backport [https://github.com/nginx/nginx/commit/7426c29f140c330dd6c6cdfeb2943be1978c69e0]
+
+Signed-off-by: Hetvi Thakar <hthakar@cisco.com>
+---
+ src/core/ngx_resolver.c | 37 +++++++++++++++++++++++++++++++------
+ 1 file changed, 31 insertions(+), 6 deletions(-)
+
+diff --git a/src/core/ngx_resolver.c b/src/core/ngx_resolver.c
+index ec3df0e875..1cf772772f 100644
+--- a/src/core/ngx_resolver.c
++++ b/src/core/ngx_resolver.c
+@@ -106,6 +106,7 @@ static ngx_int_t ngx_resolver_copy(ngx_resolver_t *r, ngx_str_t *name,
+ static ngx_int_t ngx_resolver_set_timeout(ngx_resolver_t *r,
+ ngx_resolver_ctx_t *ctx);
+ static void ngx_resolver_timeout_handler(ngx_event_t *ev);
++static void ngx_resolver_free_handler(ngx_resolver_ctx_t *ctx);
+ static void ngx_resolver_free_node(ngx_resolver_t *r, ngx_resolver_node_t *rn);
+ static void *ngx_resolver_alloc(ngx_resolver_t *r, size_t size);
+ static void *ngx_resolver_calloc(ngx_resolver_t *r, size_t size);
+@@ -570,9 +571,11 @@ ngx_resolve_name_done(ngx_resolver_ctx_t *ctx)
+ w = w->next;
+ }
+
+- ngx_log_error(NGX_LOG_ALERT, r->log, 0,
+- "could not cancel %V resolving", &ctx->name);
++ ngx_log_debug1(NGX_LOG_DEBUG_CORE, r->log, 0,
++ "could not cancel %V resolving", &ctx->name);
+ }
++
++ ctx->handler = ngx_resolver_free_handler;
+ }
+
+ done:
+@@ -590,9 +593,12 @@ ngx_resolve_name_done(ngx_resolver_ctx_t *ctx)
+
+ if (ctx->event) {
+ ngx_resolver_free_locked(r, ctx->event);
++ ctx->event = NULL;
+ }
+
+- ngx_resolver_free_locked(r, ctx);
++ if (ctx->handler != ngx_resolver_free_handler) {
++ ngx_resolver_free_locked(r, ctx);
++ }
+
+ /* unlock alloc mutex */
+
+@@ -1202,6 +1208,7 @@ ngx_resolve_addr_done(ngx_resolver_ctx_t *ctx)
+ }
+ }
+
++#if (NGX_DEBUG)
+ {
+ u_char text[NGX_SOCKADDR_STRLEN];
+ ngx_str_t addrtext;
+@@ -1210,9 +1217,12 @@ ngx_resolve_addr_done(ngx_resolver_ctx_t *ctx)
+ addrtext.len = ngx_sock_ntop(ctx->addr.sockaddr, ctx->addr.socklen,
+ text, NGX_SOCKADDR_STRLEN, 0);
+
+- ngx_log_error(NGX_LOG_ALERT, r->log, 0,
+- "could not cancel %V resolving", &addrtext);
++ ngx_log_debug1(NGX_LOG_DEBUG_CORE, r->log, 0,
++ "could not cancel %V resolving", &addrtext);
+ }
++#endif
++
++ ctx->handler = ngx_resolver_free_handler;
+ }
+
+ done:
+@@ -1225,9 +1235,12 @@ ngx_resolve_addr_done(ngx_resolver_ctx_t *ctx)
+
+ if (ctx->event) {
+ ngx_resolver_free_locked(r, ctx->event);
++ ctx->event = NULL;
+ }
+
+- ngx_resolver_free_locked(r, ctx);
++ if (ctx->handler != ngx_resolver_free_handler) {
++ ngx_resolver_free_locked(r, ctx);
++ }
+
+ /* unlock alloc mutex */
+
+@@ -3005,6 +3018,11 @@ ngx_resolver_resolve_srv_names(ngx_resolver_ctx_t *ctx, ngx_resolver_node_t *rn)
+ ngx_resolver_ctx_t *cctx;
+ ngx_resolver_srv_name_t *srvs;
+
++ if (ctx->handler == ngx_resolver_free_handler) {
++ ctx->handler(ctx);
++ return;
++ }
++
+ r = ctx->resolver;
+
+ ctx->node = NULL;
+@@ -4136,6 +4154,13 @@ ngx_resolver_timeout_handler(ngx_event_t *ev)
+ }
+
+
++static void
++ngx_resolver_free_handler(ngx_resolver_ctx_t *ctx)
++{
++ ngx_resolver_free(ctx->resolver, ctx);
++}
++
++
+ static void
+ ngx_resolver_free_node(ngx_resolver_t *r, ngx_resolver_node_t *rn)
+ {
@@ -25,6 +25,8 @@ SRC_URI:append = " \
file://CVE-2026-120967.patch \
file://CVE-2026-118899_p1.patch \
file://CVE-2026-118899_p2.patch \
+ file://CVE-2026-123634-dependent.patch \
+ file://CVE-2026-123634.patch \
"
LIC_FILES_CHKSUM = "file://LICENSE;md5=3dc49537b08b14c8b66ad247bb4c4593"
@@ -25,6 +25,8 @@ SRC_URI:append = " \
file://CVE-2026-120967.patch \
file://CVE-2026-118899_p1.patch \
file://CVE-2026-118899_p2.patch \
+ file://CVE-2026-123634-dependent.patch \
+ file://CVE-2026-123634.patch \
"
# 1.28.x branch is the current stable branch, the recommended default