[PATCH 34/34] autofs-5.1.2 - increase worker thread per-thread stack size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



automount(8) uses a worker thread per-thread stack size of 1M which is
sufficient for its needs.

But some glibc functions (such as nscd_getgr_r()) use alloca() to allocate
working storage that can have an arbitary size. Since alloca() never fails
there is no way to check for stack overflow so I think this usage is wrong
and needs to be fixed.

All that can be done by automount to avoid this is to increase the stack size.

Signed-off-by: Ian Kent <raven@xxxxxxxxxx>
---
 CHANGELOG          |    1 +
 daemon/automount.c |    2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG b/CHANGELOG
index 46487f1..a2a22ce 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -60,6 +60,7 @@ xx/xx/2016 autofs-5.1.3
 - fix invalid reference in remount_active_mount().
 - use malloc for expanded map location.
 - fix offset mount location multiple expansion.
+- increase worker thread per-thread stack size.
 
 15/06/2016 autofs-5.1.2
 =======================
diff --git a/daemon/automount.c b/daemon/automount.c
index d27804d..109f8f9 100644
--- a/daemon/automount.c
+++ b/daemon/automount.c
@@ -2476,7 +2476,7 @@ int main(int argc, char *argv[])
 
 #ifdef _POSIX_THREAD_ATTR_STACKSIZE
 	if (pthread_attr_setstacksize(
-			&th_attr_detached, PTHREAD_STACK_MIN*64)) {
+			&th_attr_detached, PTHREAD_STACK_MIN*128)) {
 		logerr("%s: failed to set stack size thread attribute!",
 		       program);
 		res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));

--
To unsubscribe from this list: send the line "unsubscribe autofs" in



[Index of Archives]     [Linux Filesystem Development]     [Linux Ext4]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux