Skip to content

Commit 1fe8e0a

Browse files
author
Claude Bing
committed
php: update from 7.4.21 to 8.0.12
Various security and bug fixes; adds support for the JIT compiler. * Fixed bug #81026 (PHP-FPM oob R/W in root process leading to privilege escalation) (CVE-2021-21703). https://www.php.net/ChangeLog-8.php#8.0.0 Signed-off-by: Claude Bing <[email protected]>
1 parent b57d824 commit 1fe8e0a

15 files changed

+189
-160
lines changed

meta-oe/recipes-devtools/php/php/0001-opcache-config.m4-enable-opcache.patch renamed to meta-oe/recipes-devtools/php/php/0001-ext-opcache-config.m4-enable-opcache.patch

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
From a74b42098aededd296ec6a3cd4cf5a17e59d6f29 Mon Sep 17 00:00:00 2001
1+
From 8cabcf1043953a0fe48107204a2212609b8e6516 Mon Sep 17 00:00:00 2001
22
From: Claude Bing <[email protected]>
3-
Date: Fri, 8 May 2020 10:15:32 -0400
4-
Subject: [PATCH] opcache/config.m4: enable opcache
3+
Date: Tue, 9 Nov 2021 12:59:15 -0500
4+
Subject: [PATCH 01/11] ext/opcache/config.m4: enable opcache
55

6-
We can't use AC_TRY_RUN to run programs in a cross compile environment.
7-
Set
8-
the variables directly instead since we know that we'd be running on
9-
latest
10-
enough linux kernel.
6+
We can't use AC_TRY_RUN to run programs in a cross compile
7+
environment. Set the variables directly instead since we know
8+
that we'd be running on latest enough linux kernel.
119

1210
Upstream-Status: Inappropriate [Configuration]
1311

@@ -16,17 +14,18 @@ Signed-off-by: Anuj Mittal <[email protected]>
1614
update patch to version 7.4.4
1715
Signed-off-by: Changqing Li <[email protected]>
1816

17+
update patch to version 8.0.12
1918
fix issue linking with librt
2019
Signed-off-by: Claude Bing <[email protected]>
2120
---
22-
ext/opcache/config.m4 | 195 +-----------------------------------------
23-
1 file changed, 4 insertions(+), 191 deletions(-)
21+
ext/opcache/config.m4 | 197 ++----------------------------------------
22+
1 file changed, 8 insertions(+), 189 deletions(-)
2423

2524
diff --git a/ext/opcache/config.m4 b/ext/opcache/config.m4
26-
index 6c40cafc1c..6569aa9e1c 100644
25+
index 5492fd920c..95158ccfd9 100644
2726
--- a/ext/opcache/config.m4
2827
+++ b/ext/opcache/config.m4
29-
@@ -23,201 +23,14 @@ if test "$PHP_OPCACHE" != "no"; then
28+
@@ -101,202 +101,21 @@ if test "$PHP_OPCACHE" != "no"; then
3029
AC_CHECK_FUNCS([mprotect])
3130

3231
AC_MSG_CHECKING(for sysvipc shared memory support)
@@ -96,9 +95,10 @@ index 6c40cafc1c..6569aa9e1c 100644
9695
-}
9796
-]])],[dnl
9897
- AC_DEFINE(HAVE_SHM_IPC, 1, [Define if you have SysV IPC SHM support])
99-
- msg=yes],[msg=no],[msg=no])
100-
- AC_MSG_RESULT([$msg])
98+
- have_shm_ipc=yes],[have_shm_ipc=no],[have_shm_ipc=no])
10199
+ AC_DEFINE(HAVE_SHM_IPC, 1, [Define if you have SysV IPC SHM support])
100+
+ have_shm_ipc=yes
101+
AC_MSG_RESULT([$have_shm_ipc])
102102

103103
AC_MSG_CHECKING(for mmap() using MAP_ANON shared memory support)
104104
- AC_RUN_IFELSE([AC_LANG_SOURCE([[
@@ -116,8 +116,7 @@ index 6c40cafc1c..6569aa9e1c 100644
116116
-#ifndef MAP_FAILED
117117
-# define MAP_FAILED ((void*)-1)
118118
-#endif
119-
+ AC_DEFINE(HAVE_SHM_MMAP_ANON, 1, [Define if you have mmap(MAP_ANON) SHM support])
120-
119+
-
121120
-int main() {
122121
- pid_t pid;
123122
- int status;
@@ -150,10 +149,12 @@ index 6c40cafc1c..6569aa9e1c 100644
150149
-}
151150
-]])],[dnl
152151
- AC_DEFINE(HAVE_SHM_MMAP_ANON, 1, [Define if you have mmap(MAP_ANON) SHM support])
153-
- msg=yes],[msg=no],[msg=no])
154-
- AC_MSG_RESULT([$msg])
155-
-
156-
- PHP_CHECK_FUNC_LIB(shm_open, rt)
152+
- have_shm_mmap_anon=yes],[have_shm_mmap_anon=no],[have_shm_mmap_anon=no])
153+
+ AC_DEFINE(HAVE_SHM_MMAP_ANON, 1, [Define if you have mmap(MAP_ANON) SHM support])
154+
+ have_shm_mmap_anon=yes
155+
AC_MSG_RESULT([$have_shm_mmap_anon])
156+
157+
PHP_CHECK_FUNC_LIB(shm_open, rt, root)
157158
AC_MSG_CHECKING(for mmap() using shm_open() shared memory support)
158159
- AC_RUN_IFELSE([AC_LANG_SOURCE([[
159160
-#include <sys/types.h>
@@ -221,17 +222,20 @@ index 6c40cafc1c..6569aa9e1c 100644
221222
-]])],[dnl
222223
- AC_DEFINE(HAVE_SHM_MMAP_POSIX, 1, [Define if you have POSIX mmap() SHM support])
223224
- AC_MSG_RESULT([yes])
225+
- have_shm_mmap_posix=yes
224226
- PHP_CHECK_LIBRARY(rt, shm_unlink, [PHP_ADD_LIBRARY(rt,1,OPCACHE_SHARED_LIBADD)])
225227
- ],[
226228
- AC_MSG_RESULT([no])
227229
- ],[
228230
- AC_MSG_RESULT([no])
229231
- ])
230232
+ AC_DEFINE(HAVE_SHM_MMAP_POSIX, 1, [Define if you have POSIX mmap() SHM support])
233+
+ AC_MSG_RESULT([yes])
234+
+ have_shm_mmap_posix=yes
231235
+ PHP_CHECK_LIBRARY(rt, shm_unlink, [PHP_ADD_LIBRARY(rt,1,OPCACHE_SHARED_LIBADD)])
232236

233237
PHP_NEW_EXTENSION(opcache,
234238
ZendAccelerator.c \
235239
--
236-
2.17.1
240+
2.25.1
237241

Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
php.m4: don't unset cache variables
1+
From 1af203e8e385d46ad3e33b1c253b1c564aa99034 Mon Sep 17 00:00:00 2001
2+
From: Claude Bing <[email protected]>
3+
Date: Tue, 9 Nov 2021 13:01:55 -0500
4+
Subject: [PATCH 02/11] build/php.m4: don't unset cache variables
25

36
Unsetting prevents cache variable from being passed to configure.
47

@@ -8,15 +11,18 @@ Signed-off-by: Anuj Mittal <[email protected]>
811

912
update this patch to 7.4.4, acinclude.m4 move to build/php.m4
1013
Signed-off-by: Changqing Li <[email protected]>
14+
15+
update patch to 8.0.12
16+
Signed-off-by: Claude Bing <[email protected]>
1117
---
1218
build/php.m4 | 4 ----
1319
1 file changed, 4 deletions(-)
1420

1521
diff --git a/build/php.m4 b/build/php.m4
16-
index 5c45d13..218ec47 100644
22+
index 9746ba28f3..93551d9ca7 100644
1723
--- a/build/php.m4
1824
+++ b/build/php.m4
19-
@@ -1587,8 +1587,6 @@ dnl PHP_CHECK_FUNC_LIB
25+
@@ -1568,8 +1568,6 @@ dnl PHP_CHECK_FUNC_LIB
2026
dnl
2127
AC_DEFUN([PHP_CHECK_FUNC_LIB],[
2228
ifelse($2,,:,[
@@ -25,7 +31,7 @@ index 5c45d13..218ec47 100644
2531
unset found
2632
AC_CHECK_LIB($2, $1, [found=yes], [
2733
AC_CHECK_LIB($2, __$1, [found=yes], [found=no])
28-
@@ -1620,8 +1618,6 @@ dnl and as a fall back in the specified library. Defines HAVE_func and
34+
@@ -1601,8 +1599,6 @@ dnl and as a fall back in the specified library. Defines HAVE_func and
2935
dnl HAVE_library if found and adds the library to LIBS.
3036
dnl
3137
AC_DEFUN([PHP_CHECK_FUNC],[
@@ -35,5 +41,5 @@ index 5c45d13..218ec47 100644
3541

3642
AC_CHECK_FUNC($1, [found=yes],[ AC_CHECK_FUNC(__$1,[found=yes],[found=no]) ])
3743
--
38-
2.7.4
44+
2.25.1
3945

Original file line numberDiff line numberDiff line change
@@ -1,32 +1,36 @@
1-
From 1234a8ef7c5ab88e24bc5908f0ccfd55af21aa39 Mon Sep 17 00:00:00 2001
2-
From: Leon Anavi <leon.anavi@konsulko.com>
3-
Date: Mon, 31 Aug 2020 16:03:27 +0300
4-
Subject: [PATCH] php: remove host specific info from header file
1+
From c81d0bd3491a6c6371d9df2f43956d109f984310 Mon Sep 17 00:00:00 2001
2+
From: Claude Bing <cbing@cybernetics.com>
3+
Date: Tue, 9 Nov 2021 13:02:29 -0500
4+
Subject: [PATCH 03/11] php: remove host specific info from header file
55

66
Based on:
77
https://sources.debian.org/data/main/p/php7.3/7.3.6-1/debian/patches/
88
0036-php-5.4.9-fixheader.patch
99

1010
Upstream-Status: Inappropriate [not author]
11+
1112
Signed-off-by: Joe Slater <[email protected]>
1213
Signed-off-by: Leon Anavi <[email protected]>
14+
15+
update patch to 8.0.12
16+
Signed-off-by: Claude Bing <[email protected]>
1317
---
1418
configure.ac | 2 +-
1519
1 file changed, 1 insertion(+), 1 deletion(-)
1620

1721
diff --git a/configure.ac b/configure.ac
18-
index 2a474ba36d..6d22a21630 100644
22+
index 1eafd62a44..90c94323aa 100644
1923
--- a/configure.ac
2024
+++ b/configure.ac
21-
@@ -1323,7 +1323,7 @@ PHP_BUILD_DATE=`date -u +%Y-%m-%d`
22-
fi
23-
AC_DEFINE_UNQUOTED(PHP_BUILD_DATE,"$PHP_BUILD_DATE",[PHP build date])
25+
@@ -1289,7 +1289,7 @@ PHP_REMOVE_USR_LIB(LDFLAGS)
26+
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PHP_LDFLAGS"
27+
EXTRA_LDFLAGS_PROGRAM="$EXTRA_LDFLAGS_PROGRAM $PHP_LDFLAGS"
2428

2529
-UNAME=`uname -a | xargs`
2630
+UNAME=`uname | xargs`
2731
PHP_UNAME=${PHP_UNAME:-$UNAME}
2832
AC_DEFINE_UNQUOTED(PHP_UNAME,"$PHP_UNAME",[uname -a output])
2933
PHP_OS=`uname | xargs`
3034
--
31-
2.17.1
35+
2.25.1
3236

Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
1-
From f5a34e771532b8433f307b679500c26af328ba35 Mon Sep 17 00:00:00 2001
2-
From: Changqing Li <changqing.li@windriver.com>
3-
Date: Fri, 17 Apr 2020 15:01:57 +0800
4-
Subject: [PATCH] configure.ac: don't include build/libtool.m4
1+
From 41ef1121682c245b10df7de4b78c45baf9114c04 Mon Sep 17 00:00:00 2001
2+
From: Claude Bing <cbing@cybernetics.com>
3+
Date: Tue, 9 Nov 2021 13:03:46 -0500
4+
Subject: [PATCH 04/11] configure.ac: don't include build/libtool.m4
55

66
we delete build/libtool.m4 before do_configure,
77
we will use libtool.m4 under ACLOCALDIR
88

99
Upstream-Status: Inappropriate [oe-specific]
1010

1111
Signed-off-by: Changqing Li <[email protected]>
12+
13+
update patch to 8.0.12
14+
Signed-off-by: Claude Bing <[email protected]>
1215
---
1316
configure.ac | 1 -
1417
1 file changed, 1 deletion(-)
1518

1619
diff --git a/configure.ac b/configure.ac
17-
index 06c6a27..f85144e 100644
20+
index 90c94323aa..161e7c3f53 100644
1821
--- a/configure.ac
1922
+++ b/configure.ac
2023
@@ -6,7 +6,6 @@ dnl ----------------------------------------------------------------------------
@@ -26,5 +29,5 @@ index 06c6a27..f85144e 100644
2629
m4_include([build/php.m4])
2730
m4_include([build/pkg.m4])
2831
--
29-
2.7.4
32+
2.25.1
3033

Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
1-
From edd575a546d56bb5683aff19782b16963d61fd0b Mon Sep 17 00:00:00 2001
2-
From: Koen Kooi <[email protected]>
3-
Date: Wed, 2 Nov 2011 16:54:57 +0100
4-
Subject: [PATCH] Upstream-Status: Pending
1+
From f22958b4c1348eec3bb4c0f2cbe2d22676e0ad23 Mon Sep 17 00:00:00 2001
2+
From: Claude Bing <[email protected]>
3+
Date: Tue, 9 Nov 2021 13:04:29 -0500
4+
Subject: [PATCH 05/11] pear: fix Makefile.frag for Yocto
55

6+
Signed-off-by: Koen Kooi <[email protected]>
7+
8+
update patch to 8.0.12
9+
Signed-off-by: Claude Bing <[email protected]>
610
---
711
pear/Makefile.frag | 2 +-
812
1 file changed, 1 insertion(+), 1 deletion(-)
913

1014
diff --git a/pear/Makefile.frag b/pear/Makefile.frag
11-
index bbe8ec3..16f43e2 100644
15+
index 9408757a3a..69072f39e0 100644
1216
--- a/pear/Makefile.frag
1317
+++ b/pear/Makefile.frag
14-
@@ -12,7 +12,7 @@ PEAR_SUFFIX = -ds a$(program_suffix)
18+
@@ -10,7 +10,7 @@ PEAR_SUFFIX = -ds a$(program_suffix)
1519
PEAR_INSTALLER_URL = https://pear.php.net/install-pear-nozlib.phar
1620

1721
install-pear-installer: $(SAPI_CLI_PATH)
@@ -20,3 +24,6 @@ index bbe8ec3..16f43e2 100644
2024

2125
install-pear:
2226
@echo "Installing PEAR environment: $(INSTALL_ROOT)$(peardir)/"
27+
--
28+
2.25.1
29+

meta-oe/recipes-devtools/php/php/phar-makefile.patch renamed to meta-oe/recipes-devtools/php/php/0006-ext-phar-Makefile.frag-Fix-phar-packaging.patch

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
Subject: [PATCH] From 08962a56f69963e01892d98ca5b75de8354bd3f5 Mon Sep 17
2-
00:00:00 2001 From: Koen Kooi <[email protected]> Date: Wed, 2 Nov
3-
2011 16:54:57 +0100 Subject: [PATCH] Fix phar packaging
1+
From eab5babdadea487bbbef025068c553f5ba741774 Mon Sep 17 00:00:00 2001
2+
From: Claude Bing <[email protected]>
3+
Date: Tue, 9 Nov 2021 13:07:25 -0500
4+
Subject: [PATCH 06/11] ext/phar/Makefile.frag: Fix phar packaging
45

56
Inherited from OE-Classic, with some additions to fix host paths leaking
67
into the target package.
@@ -9,12 +10,16 @@ Upstream-Status: Inappropriate [config]
910

1011
update patch to version 7.4.4
1112
Signed-off-by: Changqing Li <[email protected]>
13+
Signed-off-by: Koen Kooi <[email protected]>
14+
15+
update patch to version 8.0.12
16+
Signed-off-by: Claude Bing <[email protected]>
1217
---
1318
ext/phar/Makefile.frag | 17 +++--------------
1419
1 file changed, 3 insertions(+), 14 deletions(-)
1520

1621
diff --git a/ext/phar/Makefile.frag b/ext/phar/Makefile.frag
17-
index 6442f33..6145412 100644
22+
index 58789cae25..c02af1b186 100644
1823
--- a/ext/phar/Makefile.frag
1924
+++ b/ext/phar/Makefile.frag
2025
@@ -10,20 +10,9 @@ pharcmd: $(builddir)/phar.php $(builddir)/phar.phar
@@ -42,5 +47,5 @@ index 6442f33..6145412 100644
4247
$(builddir)/phar/phar.inc: $(srcdir)/phar/phar.inc
4348
-@test -d $(builddir)/phar || mkdir $(builddir)/phar
4449
--
45-
2.7.4
50+
2.25.1
4651

Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
1-
Subject: [PATCH] rom d251b5aa3d23803d016ca16818e2e1d2f2b70a02 Mon Sep 17
2-
00:00:00 2001 From: Koen Kooi <[email protected]> Date: Wed, 2 Nov
3-
2011 16:54:57 +0100 Subject: [PATCH] Upstream-Status: Inappriate
1+
From 03aa51625e0d1aa156c2f7cd71503b1f435d35a4 Mon Sep 17 00:00:00 2001
2+
From: Claude Bing <[email protected]>
3+
Date: Tue, 9 Nov 2021 13:08:06 -0500
4+
Subject: [PATCH 07/11] sapi/cli/config.m4: fix build directory
5+
6+
Upstream-Status: Inappropriate
47

58
update patch to version 7.4.4
69
Signed-off-by: Changqing Li <[email protected]>
10+
11+
update patch to version 8.0.12
12+
Signed-off-by: Claude Bing <[email protected]>
713
---
814
sapi/cli/config.m4 | 2 +-
915
1 file changed, 1 insertion(+), 1 deletion(-)
1016

1117
diff --git a/sapi/cli/config.m4 b/sapi/cli/config.m4
12-
index 917d45f..aaf1e27 100644
18+
index d17d531683..f2f87f9164 100644
1319
--- a/sapi/cli/config.m4
1420
+++ b/sapi/cli/config.m4
1521
@@ -47,7 +47,7 @@ if test "$PHP_CLI" != "no"; then
@@ -22,5 +28,5 @@ index 917d45f..aaf1e27 100644
2228

2329
dnl Expose to Makefile.
2430
--
25-
2.7.4
31+
2.25.1
2632

meta-oe/recipes-devtools/php/php/imap-fix-autofoo.patch renamed to meta-oe/recipes-devtools/php/php/0008-ext-imap-config.m4-fix-include-paths.patch

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1-
Subject: [PATCH] From c084c8349d1780980e232cb28b60a109e3d89438 Mon Sep 17
2-
00:00:00 2001 From: Koen Kooi <[email protected]> Date: Wed, 2 Nov
3-
2011 16:54:57 +0100 Subject: [PATCH] Upstream-Status: Pending
1+
From c3c20db4415e0f6c4a601d6f9da1f3746a96b301 Mon Sep 17 00:00:00 2001
2+
From: Claude Bing <[email protected]>
3+
Date: Tue, 9 Nov 2021 13:08:58 -0500
4+
Subject: [PATCH 08/11] ext/imap/config.m4: fix include paths
45

5-
update patch to version 7.4.4
6-
Signed-off-by: Changqing Li <[email protected]>
6+
Upstream-Status: Pending
7+
Signed-off-by: Koen Kooi <[email protected]>
8+
9+
update patch to version 8.0.12
10+
Signed-off-by: Claude Bing <[email protected]>
711
---
812
ext/imap/config.m4 | 10 ++--------
913
1 file changed, 2 insertions(+), 8 deletions(-)
1014

1115
diff --git a/ext/imap/config.m4 b/ext/imap/config.m4
12-
index 5086a31..0e938bd 100644
16+
index 5086a312d0..0e938bd544 100644
1317
--- a/ext/imap/config.m4
1418
+++ b/ext/imap/config.m4
1519
@@ -110,7 +110,7 @@ if test "$PHP_IMAP" != "no"; then
@@ -37,5 +41,5 @@ index 5086a31..0e938bd 100644
3741
IMAP_LIB_CHK($PHP_LIBDIR)
3842
IMAP_LIB_CHK(c-client)
3943
--
40-
2.7.4
44+
2.25.1
4145

0 commit comments

Comments
 (0)