Skip to content

Commit 7b8722c

Browse files
committed
update nginx to v1.27.1
1 parent e6f2972 commit 7b8722c

File tree

9 files changed

+94
-21
lines changed

9 files changed

+94
-21
lines changed

CHANGES

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
11

2+
Changes with nginx 1.27.1 14 Aug 2024
3+
4+
*) Security: processing of a specially crafted mp4 file by the
5+
ngx_http_mp4_module might cause a worker process crash
6+
(CVE-2024-7347).
7+
Thanks to Nils Bars.
8+
9+
*) Change: now the stream module handler is not mandatory.
10+
11+
*) Bugfix: new HTTP/2 connections might ignore graceful shutdown of old
12+
worker processes.
13+
Thanks to Kasei Wang.
14+
15+
*) Bugfixes in HTTP/3.
16+
17+
218
Changes with nginx 1.27.0 29 May 2024
319

420
*) Security: when using HTTP/3, processing of a specially crafted QUIC
@@ -15,7 +31,7 @@ Changes with nginx 1.27.0 29 May 2024
1531
*) Bugfix: reduced memory consumption for long-lived requests if "gzip",
1632
"gunzip", "ssi", "sub_filter", or "grpc_pass" directives are used.
1733

18-
*) Bugfix: nginx could not be built by gcc 14 if the --with-atomic
34+
*) Bugfix: nginx could not be built by gcc 14 if the --with-libatomic
1935
option was used.
2036
Thanks to Edgar Bonet.
2137

CHANGES.ru

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
11

2+
Изменения в nginx 1.27.1 14.08.2024
3+
4+
*) Безопасность: обработка специально созданного mp4-файла модулем
5+
ngx_http_mp4_module могла приводить к падению рабочего процесса
6+
(CVE-2024-7347).
7+
Спасибо Nils Bars.
8+
9+
*) Изменение: теперь обработчик в модуле stream не является
10+
обязательным.
11+
12+
*) Исправление: новые HTTP/2-соединения могли игнорировать плавное
13+
завершение старых рабочих процессов.
14+
Спасибо Kasei Wang.
15+
16+
*) Исправления в HTTP/3.
17+
18+
219
Изменения в nginx 1.27.0 29.05.2024
320

421
*) Безопасность: при использовании HTTP/3 обработка специально созданной
@@ -16,7 +33,7 @@
1633
grpc_pass.
1734

1835
*) Исправление: nginx не собирался gcc 14, если использовался параметр
19-
--with-atomic.
36+
--with-libatomic.
2037
Спасибо Edgar Bonet.
2138

2239
*) Исправления в HTTP/3.

src/core/nginx.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#define _NGINX_H_INCLUDED_
1010

1111

12-
#define nginx_version 1027000
13-
#define NGINX_VERSION "1.27.0"
12+
#define nginx_version 1027001
13+
#define NGINX_VERSION "1.27.1"
1414
#define NGINX_VER "nginx/" NGINX_VERSION
1515

1616
#ifdef NGX_BUILD

src/event/quic/ngx_event_quic.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,6 +1022,16 @@ ngx_quic_handle_payload(ngx_connection_t *c, ngx_quic_header_t *pkt)
10221022
}
10231023
}
10241024

1025+
if (pkt->level == ssl_encryption_application) {
1026+
/*
1027+
* RFC 9001, 4.9.3. Discarding 0-RTT Keys
1028+
*
1029+
* After receiving a 1-RTT packet, servers MUST discard
1030+
* 0-RTT keys within a short time
1031+
*/
1032+
ngx_quic_discard_ctx(c, ssl_encryption_early_data);
1033+
}
1034+
10251035
if (qc->closing) {
10261036
/*
10271037
* RFC 9000, 10.2. Immediate Close

src/event/quic/ngx_event_quic_protection.c

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -743,8 +743,15 @@ ngx_quic_keys_discard(ngx_quic_keys_t *keys,
743743
ngx_quic_crypto_hp_cleanup(client);
744744
ngx_quic_crypto_hp_cleanup(server);
745745

746-
ngx_explicit_memzero(client->secret.data, client->secret.len);
747-
ngx_explicit_memzero(server->secret.data, server->secret.len);
746+
if (client->secret.len) {
747+
ngx_explicit_memzero(client->secret.data, client->secret.len);
748+
client->secret.len = 0;
749+
}
750+
751+
if (server->secret.len) {
752+
ngx_explicit_memzero(server->secret.data, server->secret.len);
753+
server->secret.len = 0;
754+
}
748755
}
749756

750757

@@ -844,6 +851,9 @@ ngx_quic_keys_update(ngx_event_t *ev)
844851
ngx_explicit_memzero(current->server.secret.data,
845852
current->server.secret.len);
846853

854+
current->client.secret.len = 0;
855+
current->server.secret.len = 0;
856+
847857
ngx_explicit_memzero(client_key.data, client_key.len);
848858
ngx_explicit_memzero(server_key.data, server_key.len);
849859

@@ -870,10 +880,17 @@ ngx_quic_keys_cleanup(ngx_quic_keys_t *keys)
870880
ngx_quic_crypto_cleanup(&next->client);
871881
ngx_quic_crypto_cleanup(&next->server);
872882

873-
ngx_explicit_memzero(next->client.secret.data,
874-
next->client.secret.len);
875-
ngx_explicit_memzero(next->server.secret.data,
876-
next->server.secret.len);
883+
if (next->client.secret.len) {
884+
ngx_explicit_memzero(next->client.secret.data,
885+
next->client.secret.len);
886+
next->client.secret.len = 0;
887+
}
888+
889+
if (next->server.secret.len) {
890+
ngx_explicit_memzero(next->server.secret.data,
891+
next->server.secret.len);
892+
next->server.secret.len = 0;
893+
}
877894
}
878895

879896

src/http/modules/ngx_http_mp4_module.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3099,7 +3099,8 @@ static ngx_int_t
30993099
ngx_http_mp4_crop_stsc_data(ngx_http_mp4_file_t *mp4,
31003100
ngx_http_mp4_trak_t *trak, ngx_uint_t start)
31013101
{
3102-
uint32_t start_sample, chunk, samples, id, next_chunk, n,
3102+
uint64_t n;
3103+
uint32_t start_sample, chunk, samples, id, next_chunk,
31033104
prev_samples;
31043105
ngx_buf_t *data, *buf;
31053106
ngx_uint_t entries, target_chunk, chunk_samples;
@@ -3155,12 +3156,19 @@ ngx_http_mp4_crop_stsc_data(ngx_http_mp4_file_t *mp4,
31553156

31563157
next_chunk = ngx_mp4_get_32value(entry->chunk);
31573158

3159+
if (next_chunk < chunk) {
3160+
ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
3161+
"unordered mp4 stsc chunks in \"%s\"",
3162+
mp4->file.name.data);
3163+
return NGX_ERROR;
3164+
}
3165+
31583166
ngx_log_debug5(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
31593167
"sample:%uD, chunk:%uD, chunks:%uD, "
31603168
"samples:%uD, id:%uD",
31613169
start_sample, chunk, next_chunk - chunk, samples, id);
31623170

3163-
n = (next_chunk - chunk) * samples;
3171+
n = (uint64_t) (next_chunk - chunk) * samples;
31643172

31653173
if (start_sample < n) {
31663174
goto found;
@@ -3182,7 +3190,7 @@ ngx_http_mp4_crop_stsc_data(ngx_http_mp4_file_t *mp4,
31823190
"sample:%uD, chunk:%uD, chunks:%uD, samples:%uD",
31833191
start_sample, chunk, next_chunk - chunk, samples);
31843192

3185-
n = (next_chunk - chunk) * samples;
3193+
n = (uint64_t) (next_chunk - chunk) * samples;
31863194

31873195
if (start_sample > n) {
31883196
ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,

src/http/v2/ngx_http_v2.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,11 @@ ngx_http_v2_init(ngx_event_t *rev)
292292

293293
c->data = h2c;
294294

295+
if (ngx_exiting) {
296+
ngx_http_v2_finalize_connection(h2c, NGX_HTTP_V2_NO_ERROR);
297+
return;
298+
}
299+
295300
rev->handler = ngx_http_v2_read_handler;
296301
c->write->handler = ngx_http_v2_write_handler;
297302

src/stream/ngx_stream_core_module.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,13 @@ ngx_stream_core_content_phase(ngx_stream_session_t *s,
458458
return NGX_OK;
459459
}
460460

461+
if (cscf->handler == NULL) {
462+
ngx_log_debug0(NGX_LOG_DEBUG_STREAM, c->log, 0,
463+
"no handler for server");
464+
ngx_stream_finalize_session(s, NGX_STREAM_INTERNAL_SERVER_ERROR);
465+
return NGX_OK;
466+
}
467+
461468
cscf->handler(s);
462469

463470
return NGX_OK;
@@ -734,13 +741,6 @@ ngx_stream_core_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
734741
conf->resolver = prev->resolver;
735742
}
736743

737-
if (conf->handler == NULL) {
738-
ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
739-
"no handler for server in %s:%ui",
740-
conf->file_name, conf->line);
741-
return NGX_CONF_ERROR;
742-
}
743-
744744
if (conf->error_log == NULL) {
745745
if (prev->error_log) {
746746
conf->error_log = prev->error_log;

src/stream/ngx_stream_ssl_preread_module.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ ngx_stream_ssl_preread_servername(ngx_stream_session_t *s,
519519

520520
host = *servername;
521521

522-
rc = ngx_stream_validate_host(&host, c->pool, 1);
522+
rc = ngx_stream_validate_host(&host, c->pool, 0);
523523

524524
if (rc == NGX_ERROR) {
525525
return NGX_ERROR;

0 commit comments

Comments
 (0)