From owner-svn-src-head@freebsd.org Thu Dec 24 00:58:12 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8DA7A482F6; Thu, 24 Dec 2015 00:58:12 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 B9E9517C1; Thu, 24 Dec 2015 00:58:12 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBO0wBLn043453; Thu, 24 Dec 2015 00:58:11 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBO0wBve043452; Thu, 24 Dec 2015 00:58:11 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201512240058.tBO0wBve043452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Thu, 24 Dec 2015 00:58:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292676 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 00:58:13 -0000 Author: jtl Date: Thu Dec 24 00:58:11 2015 New Revision: 292676 URL: https://svnweb.freebsd.org/changeset/base/292676 Log: Only allow one PT_INTERP ELF program header. This also fixes a potential memory leak for interp_buf. Differential Revision: https://reviews.freebsd.org/D4692 Reviewed by: kib MFC after: 2 weeks Sponsored by: Juniper Networks Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Wed Dec 23 23:35:32 2015 (r292675) +++ head/sys/kern/imgact_elf.c Thu Dec 24 00:58:11 2015 (r292676) @@ -799,6 +799,11 @@ __CONCAT(exec_, __elfN(imgact))(struct i error = ENOEXEC; goto ret; } + if (interp != NULL) { + uprintf("Multiple PT_INTERP headers\n"); + error = ENOEXEC; + goto ret; + } interp_name_len = phdr[i].p_filesz; if (phdr[i].p_offset > PAGE_SIZE || interp_name_len > PAGE_SIZE - phdr[i].p_offset) {