From patchwork Tue Dec 1 10:56:01 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joao Marcos Costa X-Patchwork-Id: 106780 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.8535.1796123326875659278 for ; Tue, 01 Dec 2026 03:08:47 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@bootlin.com header.s=dkim header.b=xS8UQjbo; spf=pass (domain: bootlin.com, ip: 185.171.202.116, mailfrom: joaomarcos.costa@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 94D04C2B9C6 for ; Tue, 1 Dec 2026 11:08:54 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 1C386603CB; Tue, 1 Dec 2026 11:08:44 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 7EFED11EA1308; Tue, 01 Dec 2026 12:08:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1796123319; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding; bh=pFi09X5SapnwYwidRBNbUOAXggUFek1y/fuD74TM2xU=; b=xS8UQjbou0rdTNI9prULj2xLwUhb59xc2fv4uY61/z72Vbu0/1S7SYEJdeSL+SBtvXWObn xZykQzn/RmkhTI4XZY48OB2fEnnoWwCI/vh7E3QN3AutOyVVJWzFcdT40T7smXgko8SVjG vqVNBeRVcU9fyPzxtUDUes72VAtvpFErvWIRxBc0/ycSJ/Ayi6UaKSDKqubiE9/Z7Zm/fF ywqa6juwDDGEprnmICczdLaWg+axVLHOc2oiIUSoWjS28TwKfEipu5/IsLu/JSJD9YD/3T WTUzahBcT+Uaz4fjgyuclcMfYs2nGzXRYwSP3PxOJ1OCxgCmHVqOj3GFyIjJ1A== From: "Joao Marcos Costa" To: openembedded-devel@lists.openembedded.org Cc: thomas.petazzoni@bootlin.com, anuj.mittal@oss.qualcomm.com, =?utf-8?q?Jo?= =?utf-8?q?=C3=A3o_Marcos_Costa_=28Schneider_Electric=29?= Subject: [meta-webserver][scarthgap][PATCH] nginx: fix CVE-2026-92705 Date: Tue, 1 Dec 2026 11:56:01 +0100 Message-ID: <20261201105601.599279-1-joaomarcos.costa@bootlin.com> X-Mailer: git-send-email 2.55.0 MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Tue, 01 Dec 2026 11:38:25 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/133748 The fix comes from the stable ('stable-1.30') branch [1], and CVE-2026-92705 is marked as Critical [2]. Backport it to both 1.24.0 and 1.26.3 versions. [1] https://github.com/nginx/nginx/commit/587c47aed19ddec799eee953a38837936e585b39 [2] https://security-tracker.debian.org/tracker/CVE-2026-97205 Signed-off-by: João Marcos Costa (Schneider Electric) --- .../nginx/files/CVE-2026-97205.patch | 156 ++++++++++++++++++ meta-webserver/recipes-httpd/nginx/nginx.inc | 1 + 2 files changed, 157 insertions(+) create mode 100644 meta-webserver/recipes-httpd/nginx/files/CVE-2026-97205.patch diff --git a/meta-webserver/recipes-httpd/nginx/files/CVE-2026-97205.patch b/meta-webserver/recipes-httpd/nginx/files/CVE-2026-97205.patch new file mode 100644 index 0000000000..d29e67e074 --- /dev/null +++ b/meta-webserver/recipes-httpd/nginx/files/CVE-2026-97205.patch @@ -0,0 +1,156 @@ +From e0e871490fe4ec1df60659aab5f0d495da18cea7 Mon Sep 17 00:00:00 2001 +From: Vadim Zhestikov +Date: Mon, 17 Aug 2026 09:19:46 -0700 +Subject: [PATCH] Limited the number of pending operations per request +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Each pending asynchronous operation holds a reference in +r->main->blocked, an 8-bit field, and the increments were not checked. +With 256 operations pending on a single request the counter wrapped to +zero, after which the request could be freed while those operations +still referenced its pool. This is the same overflow that 4ec67cf86 +addressed for r->main->count, and left unaddressed for r->main->blocked. + +Operations beyond the limit are now performed synchronously where a +synchronous path exists, and refused otherwise, so that the counter +cannot overflow. + +Reported by cyberlancer. + +CVE: CVE-2026-97205 +Upstream-Status: Backport [https://github.com/nginx/nginx/commit/587c47aed19ddec799eee953a38837936e585b39] + +Signed-off-by: João Marcos Costa +--- + src/http/ngx_http_copy_filter_module.c | 36 ++++++++++++++++++++++++++ + src/http/ngx_http_file_cache.c | 12 +++++++-- + src/http/ngx_http_request.h | 1 + + src/http/ngx_http_upstream.c | 6 +++++ + 4 files changed, 53 insertions(+), 2 deletions(-) + +diff --git a/src/http/ngx_http_copy_filter_module.c b/src/http/ngx_http_copy_filter_module.c +index bd3028bc7..9ad953717 100644 +--- a/src/http/ngx_http_copy_filter_module.c ++++ b/src/http/ngx_http_copy_filter_module.c +@@ -87,6 +87,13 @@ ngx_http_copy_filter(ngx_http_request_t *r, ngx_chain_t *in) + ngx_output_chain_ctx_t *ctx; + ngx_http_core_loc_conf_t *clcf; + ngx_http_copy_filter_conf_t *conf; ++#if (NGX_HAVE_FILE_AIO) ++ ngx_output_chain_aio_pt aio_handler; ++#endif ++#if (NGX_THREADS) ++ ngx_int_t (*thread_handler)(ngx_thread_task_t *task, ++ ngx_file_t *file); ++#endif + + c = r->connection; + +@@ -140,10 +147,39 @@ ngx_http_copy_filter(ngx_http_request_t *r, ngx_chain_t *in) + + #if (NGX_HAVE_FILE_AIO || NGX_THREADS) + ctx->aio = r->aio; ++ ++#if (NGX_HAVE_FILE_AIO) ++ aio_handler = ctx->aio_handler; ++#endif ++#if (NGX_THREADS) ++ thread_handler = ctx->thread_handler; ++#endif ++ ++ /* ++ * each pending operation holds a reference in r->main->blocked; ++ * with the counter close to its limit the file is read ++ * synchronously instead, so that it cannot overflow ++ */ ++ ++ if (r->main->blocked >= NGX_HTTP_MAX_BLOCKED) { ++#if (NGX_HAVE_FILE_AIO) ++ ctx->aio_handler = NULL; ++#endif ++#if (NGX_THREADS) ++ ctx->thread_handler = NULL; ++#endif ++ } + #endif + + rc = ngx_output_chain(ctx, in); + ++#if (NGX_HAVE_FILE_AIO) ++ ctx->aio_handler = aio_handler; ++#endif ++#if (NGX_THREADS) ++ ctx->thread_handler = thread_handler; ++#endif ++ + if (ctx->in == NULL) { + r->buffered &= ~NGX_HTTP_COPY_BUFFERED; + +diff --git a/src/http/ngx_http_file_cache.c b/src/http/ngx_http_file_cache.c +index aa5fd1917..cc3900320 100644 +--- a/src/http/ngx_http_file_cache.c ++++ b/src/http/ngx_http_file_cache.c +@@ -440,6 +440,10 @@ ngx_http_file_cache_lock(ngx_http_request_t *r, ngx_http_cache_t *c) + return NGX_HTTP_CACHE_SCARCE; + } + ++ if (r->main->blocked >= NGX_HTTP_MAX_BLOCKED) { ++ return NGX_HTTP_CACHE_SCARCE; ++ } ++ + c->waiting = 1; + + if (c->wait_time == 0) { +@@ -677,7 +681,9 @@ ngx_http_file_cache_aio_read(ngx_http_request_t *r, ngx_http_cache_t *c) + + #if (NGX_HAVE_FILE_AIO) + +- if (clcf->aio == NGX_HTTP_AIO_ON && ngx_file_aio) { ++ if (clcf->aio == NGX_HTTP_AIO_ON && ngx_file_aio ++ && r->main->blocked < NGX_HTTP_MAX_BLOCKED) ++ { + n = ngx_file_aio_read(&c->file, c->buf->pos, c->body_start, 0, r->pool); + + if (n != NGX_AGAIN) { +@@ -700,7 +706,9 @@ ngx_http_file_cache_aio_read(ngx_http_request_t *r, ngx_http_cache_t *c) + + #if (NGX_THREADS) + +- if (clcf->aio == NGX_HTTP_AIO_THREADS) { ++ if (clcf->aio == NGX_HTTP_AIO_THREADS ++ && r->main->blocked < NGX_HTTP_MAX_BLOCKED) ++ { + c->file.thread_task = c->thread_task; + c->file.thread_handler = ngx_http_cache_thread_handler; + c->file.thread_ctx = r; +diff --git a/src/http/ngx_http_request.h b/src/http/ngx_http_request.h +index 8c9eed249..019166cf3 100644 +--- a/src/http/ngx_http_request.h ++++ b/src/http/ngx_http_request.h +@@ -11,6 +11,7 @@ + + #define NGX_HTTP_MAX_URI_CHANGES 10 + #define NGX_HTTP_MAX_SUBREQUESTS 50 ++#define NGX_HTTP_MAX_BLOCKED 250 + + /* must be 2^n */ + #define NGX_HTTP_LC_HEADER_LEN 32 +diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c +index 6c310d8ce..9b9906830 100644 +--- a/src/http/ngx_http_upstream.c ++++ b/src/http/ngx_http_upstream.c +@@ -3930,6 +3930,12 @@ ngx_http_upstream_thread_handler(ngx_thread_task_t *task, ngx_file_t *file) + task->event.data = r; + task->event.handler = ngx_http_upstream_thread_event_handler; + ++ if (r->main->blocked >= NGX_HTTP_MAX_BLOCKED) { ++ ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, ++ "too many operations pending"); ++ return NGX_ERROR; ++ } ++ + if (ngx_thread_task_post(tp, task) != NGX_OK) { + return NGX_ERROR; + } diff --git a/meta-webserver/recipes-httpd/nginx/nginx.inc b/meta-webserver/recipes-httpd/nginx/nginx.inc index 401a207103..5c2ae64e2f 100644 --- a/meta-webserver/recipes-httpd/nginx/nginx.inc +++ b/meta-webserver/recipes-httpd/nginx/nginx.inc @@ -26,6 +26,7 @@ SRC_URI = " \ file://CVE-2025-53859.patch \ file://CVE-2026-1642.patch \ file://CVE-2026-27784.patch \ + file://CVE-2026-97205.patch \ " inherit siteinfo update-rc.d useradd systemd