From owner-svn-src-all@freebsd.org Tue Aug 16 02:16:55 2016 Return-Path: Delivered-To: svn-src-all@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 D4FDCBBBF16; Tue, 16 Aug 2016 02:16:55 +0000 (UTC) (envelope-from markj@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 98C6F1877; Tue, 16 Aug 2016 02:16:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7G2GsB3051248; Tue, 16 Aug 2016 02:16:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G2GsUV051244; Tue, 16 Aug 2016 02:16:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608160216.u7G2GsUV051244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 16 Aug 2016 02:16:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304196 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars sys/cddl/contrib/opensolaris/uts/common/dtrace 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.22 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: Tue, 16 Aug 2016 02:16:55 -0000 Author: markj Date: Tue Aug 16 02:16:54 2016 New Revision: 304196 URL: https://svnweb.freebsd.org/changeset/base/304196 Log: MFV r296989: 6734 dtrace_canstore_statvar() fails for some valid static variables Reviewed by: Dan McDonald Approved by: Richard Lowe Author: Bryan Cantrill illumos/illumos-gate@d65f2bb4e50559c6c375a2aa9f728cbc34379015 MFC after: 2 weeks Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16kglobal.d - copied unchanged from r296989, vendor/illumos/dist/cmd/dtrace/test/tst/common/scalars/tst.16kglobal.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16klocal.d - copied unchanged from r296989, vendor/illumos/dist/cmd/dtrace/test/tst/common/scalars/tst.16klocal.d Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Copied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16kglobal.d (from r296989, vendor/illumos/dist/cmd/dtrace/test/tst/common/scalars/tst.16kglobal.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16kglobal.d Tue Aug 16 02:16:54 2016 (r304196, copy of r296989, vendor/illumos/dist/cmd/dtrace/test/tst/common/scalars/tst.16kglobal.d) @@ -0,0 +1,32 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright (c) 2016, Joyent, Inc. All rights reserved. + */ + +#pragma D option strsize=16k + +char *k; + +BEGIN +{ + j = probeprov; + k = j; + k[0] = 'D'; + k[1] = 'T'; +} + +BEGIN +{ + trace(stringof(k)); + exit(k == "DTrace" ? 0 : 1); +} Copied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16klocal.d (from r296989, vendor/illumos/dist/cmd/dtrace/test/tst/common/scalars/tst.16klocal.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16klocal.d Tue Aug 16 02:16:54 2016 (r304196, copy of r296989, vendor/illumos/dist/cmd/dtrace/test/tst/common/scalars/tst.16klocal.d) @@ -0,0 +1,29 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright (c) 2016, Joyent, Inc. All rights reserved. + */ + +#pragma D option strsize=16k + +BEGIN +{ + this->j = probeprov; + this->j[0] = 'D'; + this->j[1] = 'T'; +} + +BEGIN +{ + trace(this->j); + exit(this->j == "DTrace" ? 0 : 1); +} Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Aug 16 02:14:36 2016 (r304195) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Aug 16 02:16:54 2016 (r304196) @@ -707,8 +707,8 @@ dtrace_canstore_statvar(uint64_t addr, s if (nsvars == 0) return (0); - maxglobalsize = dtrace_statvar_maxsize; - maxlocalsize = (maxglobalsize + sizeof (uint64_t)) * NCPU; + maxglobalsize = dtrace_statvar_maxsize + sizeof (uint64_t); + maxlocalsize = maxglobalsize * NCPU; for (i = 0; i < nsvars; i++) { dtrace_statvar_t *svar = svars[i]; @@ -726,8 +726,8 @@ dtrace_canstore_statvar(uint64_t addr, s * DTrace to escalate an orthogonal kernel heap corruption bug * into the ability to store to arbitrary locations in memory. */ - VERIFY((scope == DIFV_SCOPE_GLOBAL && size < maxglobalsize) || - (scope == DIFV_SCOPE_LOCAL && size < maxlocalsize)); + VERIFY((scope == DIFV_SCOPE_GLOBAL && size <= maxglobalsize) || + (scope == DIFV_SCOPE_LOCAL && size <= maxlocalsize)); if (DTRACE_INRANGE(addr, sz, svar->dtsv_data, svar->dtsv_size)) return (1);