diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2016-03-02 11:00:12 +0100 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2016-03-02 11:22:03 +0100 |
commit | 2e4fa20349066e203b84df45a3ec428ecc827a39 (patch) | |
tree | 75295c5ce151bfeeaba6b0cdaac9cbc9aeaddeff /main/varnish | |
parent | 585e9be30225c2b01ca5770d995753116496e833 (diff) | |
download | aports-2e4fa20349066e203b84df45a3ec428ecc827a39.tar.bz2 aports-2e4fa20349066e203b84df45a3ec428ecc827a39.tar.xz |
main/varnish: fix stack overflow
ref #4938
Diffstat (limited to 'main/varnish')
-rw-r--r-- | main/varnish/APKBUILD | 6 | ||||
-rw-r--r-- | main/varnish/fix-stack-overflow.patch | 44 |
2 files changed, 49 insertions, 1 deletions
diff --git a/main/varnish/APKBUILD b/main/varnish/APKBUILD index fd30088d2c..88815489fd 100644 --- a/main/varnish/APKBUILD +++ b/main/varnish/APKBUILD @@ -3,7 +3,7 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=varnish pkgver=4.1.0 -pkgrel=1 +pkgrel=2 pkgdesc="High-performance HTTP accelerator" url="http://www.varnish-cache.org/" arch="all" @@ -18,6 +18,7 @@ pkgusers="varnish" pkggroups="varnish" source="http://repo.varnish-cache.org/source/varnish-$pkgver.tar.gz fix-compat-execinfo.patch + fix-stack-overflow.patch musl-mode_t.patch varnishd.initd @@ -85,6 +86,7 @@ geoip() { md5sums="d93e32b59c0c7487180a37781aae13f7 varnish-4.1.0.tar.gz 2fec4f98c892e07d97d93a7bb8529fea fix-compat-execinfo.patch +c942796a1359c9b7e0a5a53d16db476e fix-stack-overflow.patch 54d12d231c505c95ae3ae09487b5dde4 musl-mode_t.patch 1cd8138a4ef92060948f800475f72532 varnishd.initd 1ed5a6de82e6204400229fa79a54d9a7 varnishd.confd @@ -92,6 +94,7 @@ a6cb8a43c9465699cf956dc992998225 varnishd.logrotate 2cbaa46b9da9f78ecf4c906730f7c5e3 maxminddb.vcl" sha256sums="4a6ea08e30b62fbf25f884a65f0d8af42e9cc9d25bf70f45ae4417c4f1c99017 varnish-4.1.0.tar.gz 66a281c03bcf0c01bc8215fe39a3b6a593751fb2034824b471596d517554e183 fix-compat-execinfo.patch +a58d9c5dd2c1a0e9883d58ddec684993bc9fe6e91132c99b00c82a1c4228e647 fix-stack-overflow.patch f96b6dab0e68e169cffceb63776e312d8585bc2a46dfcc5fa2b1ec5e953ad624 musl-mode_t.patch b608ac5177cd93cf7b2ed305c564c344ea7d4ef19bff7944599d87081a7d4b1d varnishd.initd c252697811103e9846069b4d4de750105d79960a289ea1f7fcf1e99f682fb5dc varnishd.confd @@ -99,6 +102,7 @@ c252697811103e9846069b4d4de750105d79960a289ea1f7fcf1e99f682fb5dc varnishd.confd fd6c810a6099b1b0c2eb572aec239e3f51debc52a6c32fce715f265d7b1a1f85 maxminddb.vcl" sha512sums="b50aaa41247b912b40307423f99ae519ae5e19bea3546b049f148661727887f06b3d27712e685c219ae18cb6d53d89b415ddbd10bada7cfac00b2fd995995f5c varnish-4.1.0.tar.gz e4c3b8fe85ccb3f37c69561b981f89c757acc5534379afec551b7eabc2fe8661e3566513f4bfea9192af8576fc587b34170008f5818038c17c412ac64b27cf51 fix-compat-execinfo.patch +d07a187f5e17644d724b1b555506f65bd9e0a23084d0f4dbb836ec6cc1f1585b6e2d8b3818543823f60dcc3089a0466e08c627c9518ed178238580ec3996caef fix-stack-overflow.patch 8758bef9039a2cca23b7302668bd49f1ea07f54835512a8a9558bb9ed5de1c0fca53f2085ccd298fe0c6579fc81c3b583a85f4f6b25b6ad85f89bf3be04afb70 musl-mode_t.patch 070d1a9d11bcc7b5adc5a41fa32ad48780013634d6d4f8bdb0b67d4e54241ecc5c4280b9738f0e6d7f0e4e9c31ed1b2c8221df18b19e11fb69288d218849a7d7 varnishd.initd f2b4f88c1cea5d8576bf5c6ea82ee841c1fa9dd10daaef668c262669c2d3bc9d151f3c491f8678717047cf0d161c25b4104dd4d29bc8ddb44dd749b7f58c39e7 varnishd.confd diff --git a/main/varnish/fix-stack-overflow.patch b/main/varnish/fix-stack-overflow.patch new file mode 100644 index 0000000000..67677b3306 --- /dev/null +++ b/main/varnish/fix-stack-overflow.patch @@ -0,0 +1,44 @@ +From bc0b56b8703e7e02af745af28bc6fff48ab806ba Mon Sep 17 00:00:00 2001 +From: Natanael Copa <ncopa@alpinelinux.org> +Date: Wed, 2 Mar 2016 10:46:49 +0100 +Subject: [PATCH] fix stack overflow in epoll waiter + +musl libc has a default thread stack of 80k. avoid overflow the stack by +allocating the epol_event array on heap instead of stack. +--- + bin/varnishd/waiter/cache_waiter_epoll.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/bin/varnishd/waiter/cache_waiter_epoll.c b/bin/varnishd/waiter/cache_waiter_epoll.c +index f50ae46..65719e5 100644 +--- a/bin/varnishd/waiter/cache_waiter_epoll.c ++++ b/bin/varnishd/waiter/cache_waiter_epoll.c +@@ -71,7 +71,7 @@ struct vwe { + static void * + vwe_thread(void *priv) + { +- struct epoll_event ev[NEEV], *ep; ++ struct epoll_event *ev, *ep; + struct waited *wp; + struct waiter *w; + double now, then; +@@ -83,6 +83,8 @@ vwe_thread(void *priv) + w = vwe->waiter; + CHECK_OBJ_NOTNULL(w, WAITER_MAGIC); + THR_SetName("cache-epoll"); ++ ev = malloc(NEEV * sizeof(struct epoll_event)); ++ assert(ev != NULL); + + now = VTIM_real(); + while (1) { +@@ -146,6 +148,7 @@ vwe_thread(void *priv) + AZ(close(vwe->pipe[0])); + AZ(close(vwe->pipe[1])); + AZ(close(vwe->epfd)); ++ free(ev); + return (NULL); + } + +-- +2.7.2 + |