Commit ea7344da authored by Geoff Simmons's avatar Geoff Simmons

add the configure option to enable the stack protector (on by default)

parent c787c253
...@@ -69,6 +69,19 @@ AC_PATH_PROG([VARNISHTEST], [varnishtest], [], ...@@ -69,6 +69,19 @@ AC_PATH_PROG([VARNISHTEST], [varnishtest], [],
AC_PATH_PROG([VARNISHD], [varnishd], [], AC_PATH_PROG([VARNISHD], [varnishd], [],
[$LIBVARNISHAPI_SBINDIR:$LIBVARNISHAPI_BINDIR:$PATH]) [$LIBVARNISHAPI_SBINDIR:$LIBVARNISHAPI_BINDIR:$PATH])
# --enable-stack-protector
AC_ARG_ENABLE(stack-protector,
AS_HELP_STRING([--enable-stack-protector],[enable stack protector (default is YES)]),
[],
[enable_stack_protector=yes])
if test "x$enable_stack_protector" != "xno"; then
AX_CHECK_COMPILE_FLAG([-fstack-protector],
AX_CHECK_LINK_FLAG([-fstack-protector],
[CFLAGS="${CFLAGS} -fstack-protector"], [], []),
[], [])
fi
AC_CONFIG_FILES([ AC_CONFIG_FILES([
Makefile Makefile
src/Makefile src/Makefile
......
...@@ -297,17 +297,18 @@ The VMOD allocates memory in various ways for new blobs and ...@@ -297,17 +297,18 @@ The VMOD allocates memory in various ways for new blobs and
strings. The ``blob`` object and its methods allocate memory from the strings. The ``blob`` object and its methods allocate memory from the
heap, and hence they are only limited by available virtual memory. heap, and hence they are only limited by available virtual memory.
The ``encode()`` and ``decode()`` functions allocate Varnish The ``encode()``, ``decode()`` and ``transcode()`` functions allocate
workspace. If these functions are failing, as indicated by "out of Varnish workspace. If these functions are failing, as indicated by
space" messages in the Varnish log (with the ``VCL_Error`` tag), then "out of space" messages in the Varnish log (with the ``VCL_Error``
you will need to increase the varnishd parameters ``workspace_client`` tag), then you will need to increase the varnishd parameters
and/or ``workspace_backend``. ``workspace_client`` and/or ``workspace_backend``.
The ``transcode()`` function also allocates workspace for the string The ``transcode()`` function also allocates space on the stack for a
that it returns, and it allocates space on the stack for a temporary temporary BLOB. If this function causes stack overflow, you may need
BLOB. If this function causes stack overflow, you may need to increase to increase the stack size for the varnishd process, for example with
the stack size for the varnishd process, for example with ``ulimit ``ulimit -s``. By default, the VMOD is built with the stack protector
-s``. enabled (compile option ``-fstack-protector``), but it can be disabled
with the ``./configure`` option ``--disable-stack-protector``.
AUTHORS AUTHORS
======= =======
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment