NetBSD Problem Report #48101

From Wolfgang.Stukenbrock@nagler-company.com  Wed Jul 31 12:49:06 2013
Return-Path: <Wolfgang.Stukenbrock@nagler-company.com>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 0BA4671464
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 31 Jul 2013 12:49:06 +0000 (UTC)
Message-Id: <20130731124855.54D1C123B93@test-s0.nagler-company.com>
Date: Wed, 31 Jul 2013 14:48:55 +0200 (CEST)
From: Wolfgang.Stukenbrock@nagler-company.com
Reply-To: Wolfgang.Stukenbrock@nagler-company.com
To: gnats-bugs@gnats.NetBSD.org
Subject: vsftpd hard coded AS-limit is to small - failed to run on NetBSD 6.1
X-Send-Pr-Version: 3.95

>Number:         48101
>Category:       pkg
>Synopsis:       vsftpd hard coded AS-limit is to small - failed to run on NetBSD 6.1
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 31 12:50:00 +0000 2013
>Originator:     Dr. W. Stukenbrock
>Release:        NetBSD 6.1
>Organization:
Dr. Nagler & Company GmbH
>Environment:


System: NetBSD test-s0 5.1.2 NetBSD 5.1.2 (NSW-WS) #3: Fri Dec 21 15:15:43 CET 2012 wgstuken@test-s0:/usr/src/sys/arch/amd64/compile/NSW-WS amd64
Architecture: x86_64
Machine: amd64
>Description:
	For "security reasons", vsftpd tries to avoid to use a large amount of virtual memory.
	For that reason it sets RLIMIT_AS to a fixed value defined in defs.h, if such a limit
	is present on the system.
	The hardcoded value is 100MB. On 6.1 the process is about 150MB after mapping the
	required libraries (without SSL-libs).
	So the hard coded value is to small ...
>How-To-Repeat:
	Try to run vsftpd on NetBSD 6.1. After a connection is recieved, the mmap() for reading
	in the user config file will fail and the connection is closed again
>Fix:
	The following patch will increase the memory limit from 100MB to 300MB.
	Of couse a configurable value from the makefile would be better, but this works (for now).

--- defs.h.xx   2013-07-31 14:25:32.000000000 +0200
+++ defs.h      2013-07-31 14:25:40.000000000 +0200
@@ -19,7 +19,7 @@
 /* Must be at least the size of VSFTP_MAX_COMMAND_LINE, VSFTP_DIR_BUFSIZE and
    VSFTP_DATA_BUFSIZE*2 */
 #define VSFTP_PRIVSOCK_MAXSTR   VSFTP_DATA_BUFSIZE * 2
-#define VSFTP_AS_LIMIT          100UL * 1024 * 1024
+#define VSFTP_AS_LIMIT          300UL * 1024 * 1024

 #endif /* VSF_DEFS_H */

	Remark:	there is already a patch for defs.h and this one should be added to it.
		Please do not create another patch file for defs.h ...

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.