Skip to content

Commit

Permalink
php: update from 7.4.21 to 8.0.12
Browse files Browse the repository at this point in the history
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 <cbing@cybernetics.com>
  • Loading branch information
Claude Bing committed Nov 10, 2021
1 parent a2640f3 commit 93aad82
Show file tree
Hide file tree
Showing 15 changed files with 193 additions and 161 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
From a74b42098aededd296ec6a3cd4cf5a17e59d6f29 Mon Sep 17 00:00:00 2001
From 8cabcf1043953a0fe48107204a2212609b8e6516 Mon Sep 17 00:00:00 2001
From: Claude Bing <cbing@cybernetics.com>
Date: Fri, 8 May 2020 10:15:32 -0400
Subject: [PATCH] opcache/config.m4: enable opcache
Date: Tue, 9 Nov 2021 12:59:15 -0500
Subject: [PATCH 01/11] ext/opcache/config.m4: enable opcache

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

Upstream-Status: Inappropriate [Configuration]

Expand All @@ -16,17 +14,18 @@ Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
update patch to version 7.4.4
Signed-off-by: Changqing Li <changqing.li@windriver.com>

update patch to version 8.0.12
fix issue linking with librt
Signed-off-by: Claude Bing <cbing@cybernetics.com>
---
ext/opcache/config.m4 | 195 +-----------------------------------------
1 file changed, 4 insertions(+), 191 deletions(-)
ext/opcache/config.m4 | 197 ++----------------------------------------
1 file changed, 8 insertions(+), 189 deletions(-)

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

AC_MSG_CHECKING(for sysvipc shared memory support)
Expand Down Expand Up @@ -96,9 +95,10 @@ index 6c40cafc1c..6569aa9e1c 100644
-}
-]])],[dnl
- AC_DEFINE(HAVE_SHM_IPC, 1, [Define if you have SysV IPC SHM support])
- msg=yes],[msg=no],[msg=no])
- AC_MSG_RESULT([$msg])
- have_shm_ipc=yes],[have_shm_ipc=no],[have_shm_ipc=no])
+ AC_DEFINE(HAVE_SHM_IPC, 1, [Define if you have SysV IPC SHM support])
+ have_shm_ipc=yes
AC_MSG_RESULT([$have_shm_ipc])

AC_MSG_CHECKING(for mmap() using MAP_ANON shared memory support)
- AC_RUN_IFELSE([AC_LANG_SOURCE([[
Expand All @@ -116,8 +116,7 @@ index 6c40cafc1c..6569aa9e1c 100644
-#ifndef MAP_FAILED
-# define MAP_FAILED ((void*)-1)
-#endif
+ AC_DEFINE(HAVE_SHM_MMAP_ANON, 1, [Define if you have mmap(MAP_ANON) SHM support])

-
-int main() {
- pid_t pid;
- int status;
Expand Down Expand Up @@ -150,10 +149,12 @@ index 6c40cafc1c..6569aa9e1c 100644
-}
-]])],[dnl
- AC_DEFINE(HAVE_SHM_MMAP_ANON, 1, [Define if you have mmap(MAP_ANON) SHM support])
- msg=yes],[msg=no],[msg=no])
- AC_MSG_RESULT([$msg])
-
- PHP_CHECK_FUNC_LIB(shm_open, rt)
- have_shm_mmap_anon=yes],[have_shm_mmap_anon=no],[have_shm_mmap_anon=no])
+ AC_DEFINE(HAVE_SHM_MMAP_ANON, 1, [Define if you have mmap(MAP_ANON) SHM support])
+ have_shm_mmap_anon=yes
AC_MSG_RESULT([$have_shm_mmap_anon])

PHP_CHECK_FUNC_LIB(shm_open, rt, root)
AC_MSG_CHECKING(for mmap() using shm_open() shared memory support)
- AC_RUN_IFELSE([AC_LANG_SOURCE([[
-#include <sys/types.h>
Expand Down Expand Up @@ -221,17 +222,20 @@ index 6c40cafc1c..6569aa9e1c 100644
-]])],[dnl
- AC_DEFINE(HAVE_SHM_MMAP_POSIX, 1, [Define if you have POSIX mmap() SHM support])
- AC_MSG_RESULT([yes])
- have_shm_mmap_posix=yes
- PHP_CHECK_LIBRARY(rt, shm_unlink, [PHP_ADD_LIBRARY(rt,1,OPCACHE_SHARED_LIBADD)])
- ],[
- AC_MSG_RESULT([no])
- ],[
- AC_MSG_RESULT([no])
- ])
+ AC_DEFINE(HAVE_SHM_MMAP_POSIX, 1, [Define if you have POSIX mmap() SHM support])
+ AC_MSG_RESULT([yes])
+ have_shm_mmap_posix=yes
+ PHP_CHECK_LIBRARY(rt, shm_unlink, [PHP_ADD_LIBRARY(rt,1,OPCACHE_SHARED_LIBADD)])

PHP_NEW_EXTENSION(opcache,
ZendAccelerator.c \
--
2.17.1
2.25.1

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

Unsetting prevents cache variable from being passed to configure.

Expand All @@ -8,15 +11,18 @@ Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>

update this patch to 7.4.4, acinclude.m4 move to build/php.m4
Signed-off-by: Changqing Li <changqing.li@windriver.com>

update patch to 8.0.12
Signed-off-by: Claude Bing <cbing@cybernetics.com>
---
build/php.m4 | 4 ----
1 file changed, 4 deletions(-)

diff --git a/build/php.m4 b/build/php.m4
index 5c45d13..218ec47 100644
index 9746ba28f3..93551d9ca7 100644
--- a/build/php.m4
+++ b/build/php.m4
@@ -1587,8 +1587,6 @@ dnl PHP_CHECK_FUNC_LIB
@@ -1568,8 +1568,6 @@ dnl PHP_CHECK_FUNC_LIB
dnl
AC_DEFUN([PHP_CHECK_FUNC_LIB],[
ifelse($2,,:,[
Expand All @@ -25,7 +31,7 @@ index 5c45d13..218ec47 100644
unset found
AC_CHECK_LIB($2, $1, [found=yes], [
AC_CHECK_LIB($2, __$1, [found=yes], [found=no])
@@ -1620,8 +1618,6 @@ dnl and as a fall back in the specified library. Defines HAVE_func and
@@ -1601,8 +1599,6 @@ dnl and as a fall back in the specified library. Defines HAVE_func and
dnl HAVE_library if found and adds the library to LIBS.
dnl
AC_DEFUN([PHP_CHECK_FUNC],[
Expand All @@ -35,5 +41,5 @@ index 5c45d13..218ec47 100644

AC_CHECK_FUNC($1, [found=yes],[ AC_CHECK_FUNC(__$1,[found=yes],[found=no]) ])
--
2.7.4
2.25.1

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

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

Upstream-Status: Inappropriate [not author]

Signed-off-by: Joe Slater <joe.slater@windriver.com>
Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>

update patch to 8.0.12
Signed-off-by: Claude Bing <cbing@cybernetics.com>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

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

-UNAME=`uname -a | xargs`
+UNAME=`uname | xargs`
PHP_UNAME=${PHP_UNAME:-$UNAME}
AC_DEFINE_UNQUOTED(PHP_UNAME,"$PHP_UNAME",[uname -a output])
PHP_OS=`uname | xargs`
--
2.17.1
2.25.1

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

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

Upstream-Status: Inappropriate [oe-specific]

Signed-off-by: Changqing Li <changqing.li@windriver.com>

update patch to 8.0.12
Signed-off-by: Claude Bing <cbing@cybernetics.com>
---
configure.ac | 1 -
1 file changed, 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 06c6a27..f85144e 100644
index 90c94323aa..161e7c3f53 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,7 +6,6 @@ dnl ----------------------------------------------------------------------------
Expand All @@ -26,5 +29,5 @@ index 06c6a27..f85144e 100644
m4_include([build/php.m4])
m4_include([build/pkg.m4])
--
2.7.4
2.25.1

Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
From edd575a546d56bb5683aff19782b16963d61fd0b Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Wed, 2 Nov 2011 16:54:57 +0100
Subject: [PATCH] Upstream-Status: Pending
From f22958b4c1348eec3bb4c0f2cbe2d22676e0ad23 Mon Sep 17 00:00:00 2001
From: Claude Bing <cbing@cybernetics.com>
Date: Tue, 9 Nov 2021 13:04:29 -0500
Subject: [PATCH 05/11] pear: fix Makefile.frag for Yocto

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>

update patch to 8.0.12
Signed-off-by: Claude Bing <cbing@cybernetics.com>
---
pear/Makefile.frag | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

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

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

install-pear:
@echo "Installing PEAR environment: $(INSTALL_ROOT)$(peardir)/"
--
2.25.1

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Subject: [PATCH] From 08962a56f69963e01892d98ca5b75de8354bd3f5 Mon Sep 17
00:00:00 2001 From: Koen Kooi <koen@dominion.thruhere.net> Date: Wed, 2 Nov
2011 16:54:57 +0100 Subject: [PATCH] Fix phar packaging
From eab5babdadea487bbbef025068c553f5ba741774 Mon Sep 17 00:00:00 2001
From: Claude Bing <cbing@cybernetics.com>
Date: Tue, 9 Nov 2021 13:07:25 -0500
Subject: [PATCH 06/11] ext/phar/Makefile.frag: Fix phar packaging

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

update patch to version 7.4.4
Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>

update patch to version 8.0.12
Signed-off-by: Claude Bing <cbing@cybernetics.com>
---
ext/phar/Makefile.frag | 17 +++--------------
1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/ext/phar/Makefile.frag b/ext/phar/Makefile.frag
index 6442f33..6145412 100644
index 58789cae25..c02af1b186 100644
--- a/ext/phar/Makefile.frag
+++ b/ext/phar/Makefile.frag
@@ -10,20 +10,9 @@ pharcmd: $(builddir)/phar.php $(builddir)/phar.phar
Expand Down Expand Up @@ -42,5 +47,5 @@ index 6442f33..6145412 100644
$(builddir)/phar/phar.inc: $(srcdir)/phar/phar.inc
-@test -d $(builddir)/phar || mkdir $(builddir)/phar
--
2.7.4
2.25.1

Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
Subject: [PATCH] rom d251b5aa3d23803d016ca16818e2e1d2f2b70a02 Mon Sep 17
00:00:00 2001 From: Koen Kooi <koen@dominion.thruhere.net> Date: Wed, 2 Nov
2011 16:54:57 +0100 Subject: [PATCH] Upstream-Status: Inappriate
From 03aa51625e0d1aa156c2f7cd71503b1f435d35a4 Mon Sep 17 00:00:00 2001
From: Claude Bing <cbing@cybernetics.com>
Date: Tue, 9 Nov 2021 13:08:06 -0500
Subject: [PATCH 07/11] sapi/cli/config.m4: fix build directory

Upstream-Status: Inappropriate

update patch to version 7.4.4
Signed-off-by: Changqing Li <changqing.li@windriver.com>

update patch to version 8.0.12
Signed-off-by: Claude Bing <cbing@cybernetics.com>
---
sapi/cli/config.m4 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

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

dnl Expose to Makefile.
--
2.7.4
2.25.1

Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
Subject: [PATCH] From c084c8349d1780980e232cb28b60a109e3d89438 Mon Sep 17
00:00:00 2001 From: Koen Kooi <koen@dominion.thruhere.net> Date: Wed, 2 Nov
2011 16:54:57 +0100 Subject: [PATCH] Upstream-Status: Pending
From c3c20db4415e0f6c4a601d6f9da1f3746a96b301 Mon Sep 17 00:00:00 2001
From: Claude Bing <cbing@cybernetics.com>
Date: Tue, 9 Nov 2021 13:08:58 -0500
Subject: [PATCH 08/11] ext/imap/config.m4: fix include paths

update patch to version 7.4.4
Signed-off-by: Changqing Li <changqing.li@windriver.com>
Upstream-Status: Pending
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>

update patch to version 8.0.12
Signed-off-by: Claude Bing <cbing@cybernetics.com>
---
ext/imap/config.m4 | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/ext/imap/config.m4 b/ext/imap/config.m4
index 5086a31..0e938bd 100644
index 5086a312d0..0e938bd544 100644
--- a/ext/imap/config.m4
+++ b/ext/imap/config.m4
@@ -110,7 +110,7 @@ if test "$PHP_IMAP" != "no"; then
Expand Down Expand Up @@ -37,5 +41,5 @@ index 5086a31..0e938bd 100644
IMAP_LIB_CHK($PHP_LIBDIR)
IMAP_LIB_CHK(c-client)
--
2.7.4
2.25.1

Loading

0 comments on commit 93aad82

Please sign in to comment.