From owner-svn-src-all@FreeBSD.ORG Sat Nov 29 17:29:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 721E0294; Sat, 29 Nov 2014 17:29:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44F54F60; Sat, 29 Nov 2014 17:29:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sATHTWLO005259; Sat, 29 Nov 2014 17:29:32 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sATHTV7O005256; Sat, 29 Nov 2014 17:29:31 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201411291729.sATHTV7O005256@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 29 Nov 2014 17:29:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275261 - in head/sys: boot/common kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Nov 2014 17:29:32 -0000 Author: imp Date: Sat Nov 29 17:29:30 2014 New Revision: 275261 URL: https://svnweb.freebsd.org/changeset/base/275261 Log: The current limit of 100k for the linker hints file is getting a bit crowded as we now are at about 70k. Bump the limit to 1MB instead which is still quite a reasonable limit and allows for future growth of this file and possible future expansion to additional data. MFC After: 2 weeks Modified: head/sys/boot/common/module.c head/sys/kern/kern_linker.c head/sys/sys/linker.h Modified: head/sys/boot/common/module.c ============================================================================== --- head/sys/boot/common/module.c Sat Nov 29 17:18:20 2014 (r275260) +++ head/sys/boot/common/module.c Sat Nov 29 17:29:30 2014 (r275261) @@ -938,7 +938,7 @@ moduledir_readhints(struct moduledir *md path = moduledir_fullpath(mdp, "linker.hints"); if (stat(path, &st) != 0 || st.st_size < (ssize_t)(sizeof(version) + sizeof(int)) || - st.st_size > 100 * 1024 || (fd = open(path, O_RDONLY)) < 0) { + st.st_size > LINKER_HINTS_MAX || (fd = open(path, O_RDONLY)) < 0) { free(path); mdp->d_flags |= MDIR_NOHINTS; return; Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Sat Nov 29 17:18:20 2014 (r275260) +++ head/sys/kern/kern_linker.c Sat Nov 29 17:29:30 2014 (r275261) @@ -1752,7 +1752,7 @@ linker_hints_lookup(const char *path, in /* * XXX: we need to limit this number to some reasonable value */ - if (vattr.va_size > 100 * 1024) { + if (vattr.va_size > LINKER_HINTS_MAX) { printf("hints file too large %ld\n", (long)vattr.va_size); goto bad; } Modified: head/sys/sys/linker.h ============================================================================== --- head/sys/sys/linker.h Sat Nov 29 17:18:20 2014 (r275260) +++ head/sys/sys/linker.h Sat Nov 29 17:29:30 2014 (r275261) @@ -228,6 +228,7 @@ void *linker_hwpmc_list_objects(void); #endif #define LINKER_HINTS_VERSION 1 /* linker.hints file version */ +#define LINKER_HINTS_MAX (1 << 20) /* Allow at most 1MB for linker.hints */ #ifdef _KERNEL