已开启
backport some patches from upstream #240
AtomGit-Bot创建于 2025年7月30日
backport some patches from upstream #240
已开启
AtomGit-Bot创建于 2025年7月30日
refs/pull/240/head合入到master
5 个文件变更+295-1
Abackport-Temporarily-add-back-the-query-string-to-the-URL.patch+58-0
@@ -0,0 +1,58 @@
1+From f82a9e886f42db063fb87c2973b33a88320ae65b Mon Sep 17 00:00:00 2001
2+From: Ruediger Pluem <rpluem@apache.org>
3+Date: Wed, 4 Jun 2025 07:36:11 +0000
4+Subject: [PATCH] Merge r1925109 from trunk:
5+ 
6+* Temporarily add back the query string to the URL as it might contain the
7+ routing information for sticky sessions.
8+ 
9+PR: 69443
10+ 
11+Reviewed by: rpluem, covener, ylavic
12+ 
13+ 
14+git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1926107 13f79535-47bb-0310-9956-ffa450edef68
15+---
16+ changes-entries/pr69443.txt | 3 +++
17+ modules/proxy/mod_proxy_balancer.c | 14 +++++++++++++-
18+ 2 files changed, 16 insertions(+), 1 deletions(-)
19+ create mode 100644 changes-entries/pr69443.txt
20+ 
21+diff --git a/changes-entries/pr69443.txt b/changes-entries/pr69443.txt
22+new file mode 100644
23+index 00000000000..97de7693937
24+--- /dev/null
25++++ b/changes-entries/pr69443.txt
26+@@ -0,0 +1,3 @@
27++ *) mod_proxy_balancer: Fix a regression that caused stickysession keys no
28++ longer be recognized if they are provided as query parameter in the URL.
29++ PR 69443 [Ruediger Pluem]
30+diff --git a/modules/proxy/mod_proxy_balancer.c b/modules/proxy/mod_proxy_balancer.c
31+index 140366e6d52..daec21ad6c3 100644
32+--- a/modules/proxy/mod_proxy_balancer.c
33++++ b/modules/proxy/mod_proxy_balancer.c
34+@@ -276,11 +276,23 @@ static proxy_worker *find_session_route(proxy_balancer *balancer,
35+ char **url)
36+ {
37+ proxy_worker *worker = NULL;
38++ char *url_with_qs;
39+
40+ if (!*balancer->s->sticky)
41+ return NULL;
42++ /*
43++ * The route might be contained in the query string and *url is not
44++ * supposed to contain the query string. Hence add it temporarily if
45++ * present.
46++ */
47++ if (r->args) {
48++ url_with_qs = apr_pstrcat(r->pool, *url, "?", r->args, NULL);
49++ }
50++ else {
51++ url_with_qs = *url;
52++ }
53+ /* Try to find the sticky route inside url */
54+- *route = get_path_param(r->pool, *url, balancer->s->sticky_path, balancer->s->scolonsep);
55++ *route = get_path_param(r->pool, url_with_qs, balancer->s->sticky_path, balancer->s->scolonsep);
56+ if (*route) {
57+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01159)
58+ "Found value %s for stickysession %s",
Abackport-avoid-ap_set_content_type-when-processing.patch+76-0
@@ -0,0 +1,76 @@
1+From 6764774d51f3dcb07e79779c64a463d3c112b53f Mon Sep 17 00:00:00 2001
2+From: Yann Ylavic <ylavic@apache.org>
3+Date: Tue, 10 Jun 2025 10:58:15 +0000
4+Subject: [PATCH] avoid ap_set_content_type when processing a _Request_Header
5+ set|edit|unset Content-Type.
6+ 
7+identified by ylavic
8+ 
9+ 
10+Merges r1820750 from trunk
11+Submitted by: covener
12+Reviewed by: covener, rpluem, jorton
13+ 
14+ 
15+git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1926323 13f79535-47bb-0310-9956-ffa450edef68
16+---
17+ CHANGES | 4 +++++
18+ modules/metadata/mod_headers.c | 12 +++++++++---
19+ 2 files changed, 13 insertions(+), 3 deletions(-)
20+ 
21+diff --git a/CHANGES b/CHANGES
22+index b7bd6055425..8fac45be5c5 100644
23+@@ -6,6 +6,10 @@ Changes with Apache 2.4.59
24+ *) mod_ssl: release memory to the OS when needed. [Giovanni Bechis]
25+
26+ Changes with Apache 2.4.58
27++ *) mod_headers: 'RequestHeader set|edit|edit_r Content-Type X' could
28++ inadvertently modify the Content-Type _response_ header. Applies to
29++ Content-Type only and likely to only affect static file responses.
30++ [Eric Covener]
31+
32+ *) mod_ssl: Silence info log message "SSL Library Error: error:0A000126:
33+ SSL routines::unexpected eof while reading" when using
34+diff --git a/modules/metadata/mod_headers.c b/modules/metadata/mod_headers.c
35+index 4838bd6cd0d..57da3fc538d 100644
36+--- a/modules/metadata/mod_headers.c
37++++ b/modules/metadata/mod_headers.c
38+@@ -782,14 +782,16 @@ static int do_headers_fixup(request_rec *r, apr_table_t *headers,
39+ }
40+ break;
41+ case hdr_set:
42+- if (!ap_cstr_casecmp(hdr->header, "Content-Type")) {
43++ if (r->headers_in != headers &&
44++ !ap_cstr_casecmp(hdr->header, "Content-Type")) {
45+ ap_set_content_type_ex(r, process_tags(hdr, r), 1);
46+ }
47+ apr_table_setn(headers, hdr->header, process_tags(hdr, r));
48+ break;
49+ case hdr_setifempty:
50+ if (NULL == apr_table_get(headers, hdr->header)) {
51+- if (!ap_cstr_casecmp(hdr->header, "Content-Type")) {
52++ if (r->headers_in != headers &&
53++ !ap_cstr_casecmp(hdr->header, "Content-Type")) {
54+ ap_set_content_type_ex(r, process_tags(hdr, r), 1);
55+ }
56+ apr_table_setn(headers, hdr->header, process_tags(hdr, r));
57+@@ -797,6 +799,10 @@ static int do_headers_fixup(request_rec *r, apr_table_t *headers,
58+ break;
59+ case hdr_unset:
60+ apr_table_unset(headers, hdr->header);
61++ if (r->headers_in != headers &&
62++ !ap_cstr_casecmp(hdr->header, "Content-Type")) {
63++ ap_set_content_type(r, NULL);
64++ }
65+ break;
66+ case hdr_echo:
67+ v.r = r;
68+@@ -809,7 +815,7 @@ static int do_headers_fixup(request_rec *r, apr_table_t *headers,
69+ const char *repl = process_regexp(hdr, r->content_type, r);
70+ if (repl == NULL)
71+ return 0;
72+- ap_set_content_type_ex(r, repl, 1);
73++ if (r->headers_in != headers) ap_set_content_type_ex(r, repl, 1);
74+ }
75+ if (apr_table_get(headers, hdr->header)) {
76+ edit_do ed;
Abackport-mod_lua-Fix-memory-handling-in-output-filters.patch+69-0
@@ -0,0 +1,69 @@
1+From 3dec975c92ed1e2d5e60c88bbc331edd37ab49d7 Mon Sep 17 00:00:00 2001
2+From: Joe Orton <jorton@apache.org>
3+Date: Mon, 2 Jun 2025 14:48:53 +0000
4+Subject: [PATCH] Merge r1924095 from trunk:
5+ 
6+mod_lua: Fix memory handling in output filters.
7+ 
8+* modules/lua/mod_lua.c (lua_output_filter_handle): Fix brigade
9+ iteration to use constant memory.
10+ 
11+Submitted by: G.Grandes <guillermo.grandes gmail.com>
12+PR: 69590
13+Github: closes #517
14+Reviewed by: jorton, rpluem, covener
15+ 
16+ 
17+git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1926063 13f79535-47bb-0310-9956-ffa450edef68
18+---
19+ changes-entries/pr69590.txt | 2 ++
20+ modules/lua/mod_lua.c | 13 ++++++++-----
21+ 2 files changed, 10 insertions(+), 5 deletions(-)
22+ create mode 100644 changes-entries/pr69590.txt
23+ 
24+diff --git a/changes-entries/pr69590.txt b/changes-entries/pr69590.txt
25+new file mode 100644
26+index 00000000000..ebf3f1a5b04
27+--- /dev/null
28++++ b/changes-entries/pr69590.txt
29+@@ -0,0 +1,2 @@
30++ *) mod_lua: Fix memory handling in LuaOutputFilter. PR 69590.
31++ [Guillermo Grandes <guillermo.grandes gmail.com>]
32+diff --git a/modules/lua/mod_lua.c b/modules/lua/mod_lua.c
33+index ed5c839fe9a..793466ba688 100644
34+--- a/modules/lua/mod_lua.c
35++++ b/modules/lua/mod_lua.c
36+@@ -473,14 +473,16 @@ static apr_status_t lua_output_filter_handle(ap_filter_t *f, apr_bucket_brigade
37+ L = ctx->L;
38+ /* While the Lua function is still yielding, pass in buckets to the coroutine */
39+ if (!ctx->broken) {
40+- for (pbktIn = APR_BRIGADE_FIRST(pbbIn);
41+- pbktIn != APR_BRIGADE_SENTINEL(pbbIn);
42+- pbktIn = APR_BUCKET_NEXT(pbktIn))
43+- {
44++ while (!APR_BRIGADE_EMPTY(pbbIn)) {
45+ const char *data;
46+ apr_size_t len;
47+ apr_bucket *pbktOut;
48+
49++ pbktIn = APR_BRIGADE_FIRST(pbbIn);
50++ if (APR_BUCKET_IS_EOS(pbktIn)) {
51++ break;
52++ }
53++
54+ /* read the bucket */
55+ apr_bucket_read(pbktIn,&data,&len,APR_BLOCK_READ);
56+
57+@@ -514,10 +516,11 @@ static apr_status_t lua_output_filter_handle(ap_filter_t *f, apr_bucket_brigade
58+ lua_tostring(L, -1));
59+ return HTTP_INTERNAL_SERVER_ERROR;
60+ }
61++ apr_bucket_delete(pbktIn);
62+ }
63+ /* If we've safely reached the end, do a final call to Lua to allow for any
64+ finishing moves by the script, such as appending a tail. */
65+- if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(pbbIn))) {
66++ if (!APR_BRIGADE_EMPTY(pbbIn) && APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(pbbIn))) {
67+ apr_bucket *pbktEOS;
68+ lua_pushnil(L);
69+ lua_setglobal(L, "bucket");
Mhttpd.spec+14-1
@@ -8,7 +8,7 @@
8Name: httpd8Name: httpd
9Summary: Apache HTTP Server9Summary: Apache HTTP Server
10Version: 2.4.5810Version: 2.4.58
11-Release: 911+Release: 10
12License: ASL 2.012License: ASL 2.0
13URL: https://httpd.apache.org/13URL: https://httpd.apache.org/
14Source0: https://archive.apache.org/dist/httpd/httpd-%{version}.tar.bz214Source0: https://archive.apache.org/dist/httpd/httpd-%{version}.tar.bz2
@@ -94,6 +94,10 @@ Patch40: backport-Fix-the-handling-of-the-stickysession-configuration-p
94Patch41: backport-Fix-possible-crash-on-error-path.patch94Patch41: backport-Fix-possible-crash-on-error-path.patch
95Patch42: backport-Check-SSL_CTX_new-return-value.patch95Patch42: backport-Check-SSL_CTX_new-return-value.patch
96Patch43: backport-Report-invalid-Options-argument-when-parsing-AllowOverride-directives.patch96Patch43: backport-Report-invalid-Options-argument-when-parsing-AllowOverride-directives.patch
97+Patch40: backport-avoid-ap_set_content_type-when-processing.patch
98+Patch41: backport-set_cookie_name-ensure-correct-format.patch
99+Patch42: backport-mod_lua-Fix-memory-handling-in-output-filters.patch
100+Patch43: backport-Temporarily-add-back-the-query-string-to-the-URL.patch
97 101 
98BuildRequires: gcc autoconf pkgconfig findutils xmlto perl-interpreter perl-generators systemd-devel102BuildRequires: gcc autoconf pkgconfig findutils xmlto perl-interpreter perl-generators systemd-devel
99BuildRequires: zlib-devel libselinux-devel lua-devel brotli-devel103BuildRequires: zlib-devel libselinux-devel lua-devel brotli-devel
@@ -531,6 +535,15 @@ exit $rv
531%{_rpmconfigdir}/macros.d/macros.httpd535%{_rpmconfigdir}/macros.d/macros.httpd
532 536 
533%changelog537%changelog
538+* Wed Jul 30 2025 andy <liuyang01@kylinos.cn> - 2.4.58-10
539+- Type:NA
540+- CVE:NA
541+- SUG:NA
542+- DESC:avoid ap_set_content_type when processing a _Request_Header set|edit|unset Content-Type
543+ set_cookie_name: ensure correct format
544+ mod_lua: Fix memory handling in output filter
545+ Temporarily add back the query string to the URL as it might contain the routing information for sticky sessions
546+ 
534* Wed Apr 16 2025 xingwei <xingwei14@h-partners.com> - 2.4.58-9547* Wed Apr 16 2025 xingwei <xingwei14@h-partners.com> - 2.4.58-9
535- Type:bugfix548- Type:bugfix
536- CVE:NA549- CVE:NA