Commit graph

134385 commits

Author SHA1 Message Date
Sergey Panteleev
70861c82df
Merge branch 'refs/heads/PHP-8.2' into PHP-8.3
* refs/heads/PHP-8.2:
  PHP-8.2 is now for PHP 8.2.22-dev

# Conflicts:
#	Zend/zend.h
#	configure.ac
#	main/php_version.h
2024-06-18 17:56:30 +03:00
Sergey Panteleev
49aaa7cd9f
PHP-8.2 is now for PHP 8.2.22-dev 2024-06-18 17:56:05 +03:00
David Carlier
8690d522a3
Merge branch 'PHP-8.2' into PHP-8.3 2024-06-17 17:46:24 +01:00
David Carlier
03f0776d08
Fix GH-13681: segfault when adding watchpoint fails.
thus when removing its entry, no watch point is set and crash on
pointer access.

close GH-14513
2024-06-17 17:45:53 +01:00
Dmitry Stogov
e842ddfe4f
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-14475: PHP 8.3.7 with JIT encounters infinite loop on specific paths (#14558)
2024-06-17 09:38:02 +03:00
Dmitry Stogov
350af549a0
Fix GH-14475: PHP 8.3.7 with JIT encounters infinite loop on specific paths (#14558) 2024-06-17 09:37:44 +03:00
Gina Peter Banyard
e9b36438ed
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  ext/soap: Fix memory leaks when calling SoapFault::__construct() twice
2024-06-16 23:01:36 +01:00
Gina Peter Banyard
df219ccf9d
ext/soap: Fix memory leaks when calling SoapFault::__construct() twice 2024-06-16 23:00:59 +01:00
Jakub Zelenka
ea79560190
Merge branch 'PHP-8.2' into PHP-8.3 2024-06-16 12:23:15 +01:00
Wilhansen Li
43bc53a730
Fix GH-14037: Make /ping of php-fpm work with pm.status_listen pool
The ping feature of php-fpm monitoring was previously not working
in pm.status_listen pool due to the configuration variables ping.path
and ping.response not being copied over to the worker when forked. This
results in the ping code path being disabled because the worker detects
that ping.path is not configured.

Closes GH-13980

Co-authored-by: Pierrick Charron <pierrick@php.net>
2024-06-16 12:22:21 +01:00
Derick Rethans
784b745e07
Update NEWS 2024-06-13 14:04:42 +01:00
Derick Rethans
31798e4b6d
Merge branch 'PHP-8.2' into PHP-8.3 2024-06-13 14:04:13 +01:00
Derick Rethans
c595ab96ab
Update NEWS 2024-06-13 14:04:03 +01:00
Derick Rethans
e0e9eb4053
Merge branch 'fix-anonymous-socket-at-length-boundary' into PHP-8.2 2024-06-13 14:03:46 +01:00
Ilija Tovilo
9cec164f76
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Remove GitHub actions junit artifacts
2024-06-13 14:07:43 +02:00
Ilija Tovilo
f598b58790
Remove GitHub actions junit artifacts
Nobody looks at those, and nightly regularly fails due to uploading them.

Closes GH-14555
2024-06-13 14:05:50 +02:00
Ilija Tovilo
22ac07a886
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix windows rename test directories clashing
2024-06-13 14:03:26 +02:00
Ilija Tovilo
8d9f9755e8
Fix windows rename test directories clashing
Closes GH-14554
2024-06-13 14:02:57 +02:00
Derick Rethans
ad56ec7bbf
Fixed off-by-one error in checking length of abtract namespace Unix sockets 2024-06-13 12:46:22 +01:00
Peter Kokot
7b40a5a9f3
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix incompatible function pointer types
2024-06-13 12:27:09 +02:00
Ryan Carsten Schmidt
b43378d830
Fix incompatible function pointer types
Closes #14549
2024-06-13 12:24:52 +02:00
Ilija Tovilo
ad470a974d
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Set SG(rfc1867_uploaded_files) to null after destroy
2024-06-10 23:03:37 +02:00
Kévin Dunglas
c47d357db5
Set SG(rfc1867_uploaded_files) to null after destroy
Closes GH-14499
2024-06-10 23:02:56 +02:00
Niels Dossche
ccdd1c4e67
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-11078: PHP Fatal error triggers pointer being freed was not allocated and malloc: double free for ptr errors
2024-06-10 19:39:25 +02:00
Niels Dossche
bc558bf7a3
Fix GH-11078: PHP Fatal error triggers pointer being freed was not allocated and malloc: double free for ptr errors
Although the issue was demonstrated using Curl, the issue is purely in
the streams layer of PHP.

Full analysis is written in GH-11078 [1], but here is the brief version:
Here's what actually happens:
1) We're creating a FILE handle from a stream using the casting mechanism.
   This will create a cookie-based FILE handle using funopen.
2) We're reading stream data using fread from the userspace stream. This will
   temporarily set a buffer into a field _bf.base [2]. This buffer is now equal
   to the upload buffer that Curl allocated and note that that buffer is owned
   by Curl.
3) The fatal error occurs and we bail out from the fread function, notice how
   the reset code is never executed and so the buffer will still point to
   Curl's upload buffer instead of FILE's own buffer [3].
4) The resources are destroyed, this includes our opened stream and because the
   FILE handle is cached, it gets destroyed as well.
   In fact, the stream code calls through fclose on purpose in this case.
5) The fclose code frees the _bs.base buffer [4].
   However, this is not the buffer that FILE owns but the one that Curl owns
   because it isn't reset properly due to the bailout!
6) The objects are getting destroyed, and so the curl free logic is invoked.
   When Curl tries to gracefully clean up, it tries to free the buffer.
   But that buffer is actually already freed mistakingly by the C library!

This also explains why we can't reproduce it on Linux: this bizarre buffer
swapping only happens on macOS and BSD, not on Linux.

To solve this, we switch to an unbuffered mode for cookie-based FILEs.
This avoids any stateful problems related to buffers especially when the
bailout mechanism triggers. As streams have their own buffering
mechanism, I don't expect this to impact performance.

[1] https://github.com/php/php-src/issues/11078#issuecomment-2155616843
[2] 5e566be7a7/stdio/FreeBSD/fread.c (L102-L103)
[3] 5e566be7a7/stdio/FreeBSD/fread.c (L117)
[4] 5e566be7a7/stdio/FreeBSD/fclose.c (L66-L67)

Closes GH-14524.
2024-06-10 19:38:21 +02:00
Florian Engelhardt
159f14c45f
fix memleak due to missing pthread_attr_destroy()-call
Closes GH-14510
2024-06-10 16:09:26 +02:00
Jakub Zelenka
82e6040cff
Merge branch 'PHP-8.2' into PHP-8.3 2024-06-09 12:40:51 +01:00
Jakub Zelenka
46013f1c55
Skip test for OpenSSL bug #74341 which is not a bug 2024-06-09 12:40:24 +01:00
Gina Peter Banyard
7bab3a3a80
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix bug GH-14456: Attempting to initialize class with private constructor calls destructor
2024-06-06 15:51:34 +01:00
Gina Peter Banyard
cdb7677b38
Fix bug GH-14456: Attempting to initialize class with private constructor calls destructor
Closes GH-14469
2024-06-06 15:50:41 +01:00
Dmitry Stogov
ee7d35cc4d
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-14480: Method visibility issue introduced in version 8.3.8 (#14484)
2024-06-05 23:59:37 +03:00
Dmitry Stogov
86b93bc479
Fix GH-14480: Method visibility issue introduced in version 8.3.8 (#14484) 2024-06-05 23:53:31 +03:00
Eric Mann
9e1a1c104d
Fix NEWS typo 2024-06-05 10:21:52 -07:00
Niels Dossche
7fe03e1a1b
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix parameter numbers for imagecolorset()
2024-06-05 18:04:53 +02:00
Giovanni Giacobbi
da769be7c9
Fix parameter numbers for imagecolorset()
This is the 8.2 & 8.3 version of GH-14477.
2024-06-05 18:01:59 +02:00
Eric Mann
b8196977b9
[skip ci] update NEWS 2024-06-05 06:58:24 -07:00
Pierrick Charron
04b9bc2ae7
Merge branch 'PHP-8.2' into PHP-8.3 2024-06-05 09:06:52 -04:00
Pierrick Charron
473cbdf558
[skip ci] Update NEWS 2024-06-05 09:00:31 -04:00
Dmitry Stogov
4dc86fe6fa
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix undefined behavior (left shift of negative number)
2024-06-05 12:27:08 +03:00
Dmitry Stogov
9534e0d42d
Fix undefined behavior (left shift of negative number)
Fixes oss-fuzz #69441
2024-06-05 11:15:36 +03:00
Ben Ramsey
e4453dcbd2
Merge branch 'PHP-8.2' into PHP-8.3 2024-06-05 01:11:30 -05:00
Ben Ramsey
8aff5b49c3
Merge branch 'PHP-8.1' into PHP-8.2 2024-06-05 01:10:47 -05:00
Ben Ramsey
a87ccc7ca2
PHP-8.1 is now for PHP 8.1.30-dev 2024-06-05 00:48:17 -05:00
Ben Ramsey
557e09f678
Update NEWS
Co-authored-by: Eric Mann <ericmann@php.net>
2024-06-05 00:39:47 -05:00
Niels Dossche
7e0e3cc820
Fix GHSA-w8qr-v226-r27w
We should not early-out with success status if we found an ipv6
hostname, we should keep checking the rest of the conditions.
Because integrating the if-check of the ipv6 hostname in the
"Validate domain" if-check made the code hard to read, I extracted the
condition out to a separate function. This also required to make
a few pointers const in order to have some clean code.
2024-06-05 00:31:17 -05:00
Niels Dossche
9382673148
Fix GHSA-3qgc-jrrr-25jv
The original code is error-prone due to the "best fit mapping" that
happens with the argument parsing but not with the query string.
When we get a non-ASCII character, try to remap it and see if it becomes
a hyphen.

An alternative approach is to create a custom main `wmain` receiving
wide-character variations that does the ANSI transformation with the
best-fit mapping, but that's more error-prone and could cause unexpected
breakage.

Another alternative was just don't doing this check altogether and
always check for `cgi || fastcgi` instead, but that breaks real-world
use-cases.
2024-06-05 00:29:19 -05:00
Niels Dossche
4b15f5d4ec
Fix GHSA-9fcc-425m-g385: bypass CVE-2024-1874
The old code checked for suffixes but didn't take into account trailing
whitespace. Furthermore, there is peculiar behaviour with trailing dots
too. This all happens because of the special path-handling code inside
CreateProcessW.

By studying Wine's code, we can see that CreateProcessInternalW calls
get_file_name [1] in our case because we haven't provided an application
name. That code gets the first whitespace-delimited string into app_name
excluding the quotes. It's then passed to create_process_params [2]
where there is the path handling code that transforms the command line
argument to an image path [3]. Inside Wine, the extension check if
performed after these transformations [4]. By doing the same thing in
PHP we match the behaviour and can properly match the extension even in
the given edge cases.

[1] 166895ae3a/dlls/kernelbase/process.c (L542-L543)
[2] 166895ae3a/dlls/kernelbase/process.c (L565)
[3] 166895ae3a/dlls/kernelbase/process.c (L150-L151)
[4] 166895ae3a/dlls/kernelbase/process.c (L647-L654)
2024-06-05 00:26:14 -05:00
Calvin Buckley
b8a7cf9f19 [skip ci] update NEWS for GH-14457 2024-06-04 12:50:53 -03:00
Calvin Buckley
05fbea8513 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [skip ci] update NEWS for GH-14457
  Remove use of SDWORD and SWORD in ODBC extensions (GH-14457)
2024-06-04 12:49:36 -03:00
Calvin Buckley
3e3e3b33f8 [skip ci] update NEWS for GH-14457 2024-06-04 12:49:02 -03:00