From owner-svn-src-head@freebsd.org Thu Jan 14 21:31:27 2016 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 B84B8A82F90; Thu, 14 Jan 2016 21:31:27 +0000 (UTC) (envelope-from smh@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 8CB731A79; Thu, 14 Jan 2016 21:31:27 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0ELVQa2054945; Thu, 14 Jan 2016 21:31:26 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0ELVQ70054944; Thu, 14 Jan 2016 21:31:26 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601142131.u0ELVQ70054944@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 14 Jan 2016 21:31:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294040 - head/sys/boot/zfs 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, 14 Jan 2016 21:31:27 -0000 Author: smh Date: Thu Jan 14 21:31:26 2016 New Revision: 294040 URL: https://svnweb.freebsd.org/changeset/base/294040 Log: Prevent bogus compiler in ZFS boot code Silence a bogus compiler warning about indexing past the end of dn_bonus. The ZFS code ensures this is not possible but the compiler can't determine this so added an additional check to prevent this warning. Sponsored by: Multiplay Modified: head/sys/boot/zfs/zfsimpl.c Modified: head/sys/boot/zfs/zfsimpl.c ============================================================================== --- head/sys/boot/zfs/zfsimpl.c Thu Jan 14 21:29:38 2016 (r294039) +++ head/sys/boot/zfs/zfsimpl.c Thu Jan 14 21:31:26 2016 (r294040) @@ -2165,7 +2165,13 @@ zfs_lookup(const struct zfsmount *mount, strcpy(&path[sb.st_size], p); else path[sb.st_size] = 0; - if (sb.st_size + sizeof(znode_phys_t) <= dn.dn_bonuslen) { + /* + * Second test is purely to silence bogus compiler + * warning about accessing past the end of dn_bonus. + */ + if (sb.st_size + sizeof(znode_phys_t) <= + dn.dn_bonuslen && sizeof(znode_phys_t) <= + sizeof(dn.dn_bonus)) { memcpy(path, &dn.dn_bonus[sizeof(znode_phys_t)], sb.st_size); } else {