1
0
mirror of https://github.com/php/php-src.git synced 2026-04-22 07:28:09 +02:00
Commit Graph

62211 Commits

Author SHA1 Message Date
Remi Collet 2223853c58 implement fseek for zip stream when possible with libzip 1.9.1 2022-06-28 15:17:27 +02:00
Chen, Hu d8de067b0f JIT: Add IBT support (#8774)
Indirect Branch Tracking (IBT) is part of Intel's Control-Flow
Enforcement Technology (CET). IBT is hardware based, forward edge
Control-Flow-Integrity mechanism where any indirect CALL/JMP must target
an ENDBR instruction or suffer #CP.

This commit adds IBT support for JIT:
1. Add endbr32/64 instruction in Dynasm.
2. Insert endbr32/64 in indirect branch target for jitted code.

gcc support CET since v8.1 and set it to default since gcc 11. With this
commit, endbr is inserted in jitted code if PHP is compiled with "gcc
-fcf-protection=full/branch".

Signed-off-by: Chen, Hu <hu1.chen@intel.com>
2022-06-28 08:42:19 +03:00
Christoph M. Becker 84c160dd90 Increase test portability
The test as is can only work if com_dotnet is built dynamically, and
not already loaded via the php.ini file.  While this is given on
AppVeyor, it may not be given in other environments.

Closes GH-8879.
2022-06-27 17:12:42 +02:00
Dmitry Stogov ad40fffd36 Fixed Bug GH-8863: RW operation on readonly property doesn't throw with JIT 2022-06-27 14:25:30 +03:00
Ilija Tovilo 3b92a96610 Convert return type of various object handlers from int to zend_result (#8755) 2022-06-26 01:00:19 +02:00
Derick Rethans 30cc0c1742 Merge branch 'PHP-8.1' 2022-06-25 17:53:33 +01:00
Derick Rethans 49a3cc63dd Merge branch 'PHP-8.0' into PHP-8.1 2022-06-25 17:53:26 +01:00
Derick Rethans 973c3f6e24 Fixed #80047: DatePeriod doesn't warn with custom DateTimeImmutable 2022-06-25 17:52:14 +01:00
David Carlier 42c57123e9 Merge branch 'PHP-8.1' 2022-06-25 07:40:19 +01:00
David Carlier af6325f68e Merge branch 'PHP-8.0' into PHP-8.1 2022-06-25 07:39:55 +01:00
Grégoire Paris 13f55d5c1b Use proper grammar in error message
Drop period in error messages

2 reasons:
- These error messages are not regular sentences.
- Having the offending value between parenthesis after the period looks weird.
Closes GH-8858.
2022-06-25 07:39:31 +01:00
George Peter Banyard 20638dba3f Use the passed 'this' pointer instead of ZEND_THIS (#8854)
Removes the horrible hack usage of defining execute_data to be able to use ZEND_THING
2022-06-24 03:38:29 +01:00
Ilija Tovilo 50a3cb7cea Get rid of duplicated rotr3 implementation (#8853) 2022-06-23 19:09:48 +02:00
Ilija Tovilo 1453dde423 Remove zend_shared_alloc_pages declaration that was never implemented (#8852) 2022-06-23 19:08:44 +02:00
Máté Kocsis 56137cd26e Declare ext/mbstring constants in stubs (#8798) 2022-06-23 17:34:08 +02:00
Ilija Tovilo cda7e8f1ec Replace another hard-coded line number 2022-06-23 16:48:17 +02:00
Ilija Tovilo 9bfdfcac8f Replace more hard-coded line numbers 2022-06-23 16:28:42 +02:00
Ilija Tovilo 44cd74b624 Fix lineno in backtrace of multi-line function calls
Closes GH-8810
Closes GH-8818
2022-06-23 16:10:32 +02:00
George Peter Banyard 7cd8879d77 Refactor spl_filesystem_object_get_path() to return zend_string* 2022-06-23 14:41:24 +01:00
George Peter Banyard 623fbfe748 Remove Z_SPLFILESYSTEM_P macro
Remove one level of macro expansion hell
2022-06-23 14:41:24 +01:00
George Peter Banyard 4d43241e96 Move some private SPL Directory elements out of the header 2022-06-23 14:41:24 +01:00
Christoph M. Becker 365537fd6d Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix GH-8848: imagecopyresized() error refers to the wrong argument
2022-06-23 15:22:28 +02:00
Christoph M. Becker bc8e52f651 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8848: imagecopyresized() error refers to the wrong argument
2022-06-23 15:22:09 +02:00
Christoph M. Becker 9405f43ba9 Fix GH-8848: imagecopyresized() error refers to the wrong argument
Closes GH-8849.
2022-06-23 15:20:49 +02:00
Ilija Tovilo 0429159775 Fully convert accel_remap_huge_pages to use zend_result
Changes were lost during rebase...
2022-06-22 18:10:05 +02:00
Ilija Tovilo 1380b65d26 Remove reundant address comparison in accel_remap_huge_pages
Closes GH-8830

MAP_FIXED guarantees mmap will return that exact address or fail so the
address comparison is redundant.

The return value of this function is unused but I kept it because it
improves readability.
2022-06-22 18:01:53 +02:00
Pierrick Charron 6b6e5f3748 Add AllowDynamicProperties on OCILob and OCICollection
Fix GH-8756 : oci_new_descriptor() triggers dynamic property
deprecation.

This fix should be temporary. At some point we should either define
those properties or just hide them since they should probably not be
used.

Better fix is here : https://github.com/php/php-src/pull/8758 but
waiting feedback from Oracle team before going ahead.
2022-06-22 06:40:41 -04:00
jcm 804c708023 Add test for iconv_strpos() internal encoding error
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

Closes GH-8816.
2022-06-21 14:14:55 +02:00
Christoph M. Becker 1a3d836fa1 Fix CS (missing space) 2022-06-21 13:43:13 +02:00
Christoph M. Becker a1b05a3a40 Tweak $count range check of array_fill()
We fix the `UNEXPECTED(EXPECTED(…))`, which does not make sense, and
replace the magic number with the respective macro.   We also add a
test case to verify the expected behavior for an `array_fill()` edge
case.

Closes GH-8804.
2022-06-21 11:39:05 +02:00
Christoph M. Becker 7e8ad578ab Fix bad merge (b8dee9b3fc) 2022-06-20 18:46:17 +02:00
George Peter Banyard d5d0b07b4e Early return in spl_filesystem_file_rewind() 2022-06-20 17:27:35 +01:00
George Peter Banyard a493c94471 Use bool for silent parameter in SPL directory.c 2022-06-20 17:27:25 +01:00
Christoph M. Becker b8dee9b3fc Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8827: Intentionally closing std handles no longer possible
2022-06-20 18:04:34 +02:00
Christoph M. Becker a8437d08a8 Fix GH-8827: Intentionally closing std handles no longer possible
We revert the commits which caused this regression from the PHP-8.0 and
PHP-8.1 branches for now.  We keep it in "master" because of PR #8833
which may offer a proper fix without BC break.
2022-06-20 18:01:02 +02:00
David Carlier bfe6f9e66a Introduction of timing attack safe bcmp implementation.
Nothing new but to refactor usage b/w hash and password
extensions but using volatile pointers to be a bit safer,
allowing to expand its usage eventually.
2022-06-20 16:30:30 +01:00
cmp 6bd0175173 Prevent fclose on underlying SplFileObject file stream. (#7920) 2022-06-20 13:37:59 +01:00
Yurun 5cf2659fa5 Replace the use of ZVAL_BOOL() with ZVAL_TRUE() or ZVAL_FALSE() where the value is fixed (#8815) 2022-06-20 13:34:44 +01:00
David CARLIER ec0331f499 intl ICU C++ code modernisation, making it closer to C++11 (#8650) 2022-06-20 13:07:28 +01:00
George Peter Banyard 8c50b8d797 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix GH-8563  Different results for seek() on SplFileObject and SplTempFileObject
2022-06-20 12:53:26 +01:00
George Peter Banyard 080fde2605 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8563  Different results for seek() on SplFileObject and SplTempFileObject
2022-06-20 12:53:01 +01:00
George Peter Banyard 6f87a5c633 Fix GH-8563 Different results for seek() on SplFileObject and SplTempFileObject
With memory streams if we get a NULL buffer we must not instantiate an empty line
2022-06-20 12:47:37 +01:00
Max Kellermann e67565f54c Zend, ext/opcache: use PR_SET_VMA_ANON_NAME (Linux 5.17) (#8234)
The new Linux 5.17 feature PR_SET_VMA_ANON_NAME can give names to
anonymous private memory, see:

 https://lwn.net/Articles/867818/

It can be useful while debugging, to identify which portion of the
process's memory belongs to which subsystem.

This is how /proc/PID/maps can look like:

 555ccd400000-555ccdc00000 r-xp 00000000 00:00 0                          [anon:huge_code_pages]
 7f6ec6600000-7f6ec6800000 rw-p 00000000 00:00 0                          [anon:zend_alloc]

The first mapping is the PHP executable copied to anonymous memory by
option "opcache.huge_code_pages".  The second one is a memory area for
the "zend_alloc.h" memory allocator library.

Unfortunately, it is not possible to give names to shared memory
(MAP_SHARED),  because Linux MAP_SHARED really maps /dev/zero (see
shmem_zero_setup()), which makes madvise_vma_anon_name() believe this
is a file mapping, failing the prctl() with EBADF.
2022-06-20 12:27:01 +01:00
Dmitry Stogov fa75bd0785 Fix incorrect constant propagation for VERIFY_RETURN_TYPE
This fixes oss-fuzz #48104
2022-06-20 11:30:07 +03:00
Dmitry Stogov 3d4a55fea1 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix memory leak
2022-06-20 11:00:41 +03:00
Dmitry Stogov ee17296e7b Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix memory leak
2022-06-20 11:00:32 +03:00
Dmitry Stogov 229e80c6ef Fix memory leak
This fixes oss-fuzz #48051
2022-06-20 10:59:37 +03:00
Jakub Zelenka 305d5e12df Merge branch 'PHP-8.1' 2022-06-19 20:12:43 +01:00
Jakub Zelenka b3e6faed48 Merge branch 'PHP-8.0' into PHP-8.1 2022-06-19 20:09:37 +01:00
Jakub Zelenka e330f443c9 Fix bug #67764: fpm: syslog.ident does not work 2022-06-19 20:05:49 +01:00