From 6f23e217f7abbd7928ddd798ec3a75c8919c233c Mon Sep 17 00:00:00 2001 From: Kevin Mihelich Date: Thu, 12 Dec 2019 14:00:22 +0000 Subject: [PATCH] community/uwsgi to 2.0.18-6 --- community/uwsgi/PKGBUILD | 8 ++++--- community/uwsgi/fix-php74.patch | 39 +++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 community/uwsgi/fix-php74.patch diff --git a/community/uwsgi/PKGBUILD b/community/uwsgi/PKGBUILD index ae9785780..127d36365 100644 --- a/community/uwsgi/PKGBUILD +++ b/community/uwsgi/PKGBUILD @@ -1,5 +1,5 @@ # Maintainer: Daniel Wallace -# Maintainer: Sven-Hendrik Haase +# Maintainer: Sven-Hendrik Haase # Contributor: Valentin Hăloiu # Contributor: Angel Velasquez # Contributor: Kevin Zuber @@ -24,7 +24,7 @@ pkgname=(uwsgi uwsgi-plugin-zabbix uwsgi-plugin-notfound) pkgver=2.0.18 -pkgrel=5 +pkgrel=6 arch=(x86_64) url="http://projects.unbit.it/$pkgbase" license=(GPL2) @@ -41,6 +41,7 @@ source=("https://projects.unbit.it/downloads/$pkgbase-$pkgver.tar.gz" uwsgi_at.service uwsgi_at.socket uwsgi_ruby20_compatibility.patch + fix-php74.patch uwsgi_trick_chroot.patch emperor.ini emperor.uwsgi.service @@ -54,6 +55,7 @@ sha512sums=('6561703279bcc4a81311d033810ac066d0f113bab13b0942f3eef86cac29c584a66 'c0c1a5c2d31cdb7e0dc878ea3d0b6025532fb640ae7cf4d5f1eed2f89987e625c8dc7844d367283ed560fb3ef37915e3e9199be2e1b06fc4586ca862a653b4b5' 'fb51a4d102a1bc7d9f7d4c4f310ee65076bcfbc94b47e2dafdf9b20e99a661c5f938185dcf698437d81409376f0276b966f09b13c8a29462c48612df43c3f3ef' '162ca1be96282b32e8e6be919b6315bfd08954c491056958985bf99e7f5bdad3511665f059329d6cb6ef5d222f9aa11d4dc43c72e6a963ab941ada959fe8d964' + '52a9c2e5d5c3841d22d4e87f46c7a1e9de0350bb2aca854b899d5729132156116ab4db4ca7d99d79aacf846812adf0db0c4f7cedf4575767266a713e622827a6' 'bc30f8ec69abd14fb96ada5b36cf65811a7a63ee27e224fcb6ceabe9935c1f17379cd872149a17da3d590b8ff60fbe7f77140d777aaf06e25e83388f897f611d' 'd54c84838ddb2f389e115ebb81aa2583705c9e330f020e6583b496f9c271ed236b6820c2a065f2b55a79adbf13e262b9ff2428124a8044b8fa20ca29ca4930ac' '83a6859d729bf186236aaa7fb7433415f6b985f17e05b7ac571d8919bbf1fb9bd577b4f673d9787dea09752e3d8043f47ce3d9c7d5690faaa1365e477e6c9388' @@ -64,7 +66,7 @@ sha512sums=('6561703279bcc4a81311d033810ac066d0f113bab13b0942f3eef86cac29c584a66 prepare() { cd $srcdir/$pkgbase-$pkgver cp $srcdir/archlinux.ini buildconf/archlinux.ini - for patch in uwsgi_ruby20_compatibility.patch uwsgi_trick_chroot.patch; do + for patch in fix-php74.patch uwsgi_ruby20_compatibility.patch uwsgi_trick_chroot.patch; do msg2 "Applying $patch" patch -Np1 -i $srcdir/$patch done diff --git a/community/uwsgi/fix-php74.patch b/community/uwsgi/fix-php74.patch new file mode 100644 index 000000000..75b4277d6 --- /dev/null +++ b/community/uwsgi/fix-php74.patch @@ -0,0 +1,39 @@ +From c4a2ad579a2fe5d357f2d6486c1afe84ef18a029 Mon Sep 17 00:00:00 2001 +From: Arne Welzel +Date: Sun, 8 Dec 2019 12:59:45 +0100 +Subject: [PATCH] php: Properly zero initialize zend_file_handle + +In the PHP bugtracker [1], the stacktrace included a bogus pointer value +being passed to `_efree`. The ASCII value of the pointer is "02.11.81" +which heavily pointed at usage of non-initialized data. + + #1 0x00007f8fe07e9e96 in _efree (ptr=0x30322e31312e3831) at /data/work/php-src-php-7.4.0RC6/Zend/zend_alloc.c:2549 + +The solution is to use an open-coded version of`zend_stream_init_filename()` [2]. +Maybe we could actually use the above helper, but I'm not familiar enough +with PHP/versions/compat, so the proposed change seems safer. + +Should fix #2096. + +[1] https://bugs.php.net/bug.php?id=78828 +[2] https://github.com/php/php-src/blob/bc6e4b6c574261188519a1e83ba49998ffbcb12b/Zend/zend_stream.c#L70 +--- + plugins/php/php_plugin.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/plugins/php/php_plugin.c b/plugins/php/php_plugin.c +index 72c390223..1690fb60c 100644 +--- a/plugins/php/php_plugin.c ++++ b/plugins/php/php_plugin.c +@@ -1115,10 +1115,9 @@ int uwsgi_php_request(struct wsgi_request *wsgi_req) { + + SG(request_info).path_translated = wsgi_req->file; + ++ memset(&file_handle, 0, sizeof(zend_file_handle)); + file_handle.type = ZEND_HANDLE_FILENAME; + file_handle.filename = real_filename; +- file_handle.free_filename = 0; +- file_handle.opened_path = NULL; + + if (php_request_startup(TSRMLS_C) == FAILURE) { + uwsgi_500(wsgi_req);