From owner-svn-src-all@freebsd.org Tue Sep 29 11:58:22 2015 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 1C04AA0B011; Tue, 29 Sep 2015 11:58:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.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 0D1541DB2; Tue, 29 Sep 2015 11:58:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8TBwLgZ052485; Tue, 29 Sep 2015 11:58:21 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8TBwLd1052484; Tue, 29 Sep 2015 11:58:21 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201509291158.t8TBwLd1052484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 29 Sep 2015 11:58:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r288362 - head/sys/cddl/dev/sdt 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.20 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, 29 Sep 2015 11:58:22 -0000 Author: avg Date: Tue Sep 29 11:58:21 2015 New Revision: 288362 URL: https://svnweb.freebsd.org/changeset/base/288362 Log: sdt: start checking version field when parsing probe definitions This is an extra safety measure. MFC after: 21 days Modified: head/sys/cddl/dev/sdt/sdt.c Modified: head/sys/cddl/dev/sdt/sdt.c ============================================================================== --- head/sys/cddl/dev/sdt/sdt.c Tue Sep 29 11:55:26 2015 (r288361) +++ head/sys/cddl/dev/sdt/sdt.c Tue Sep 29 11:58:21 2015 (r288362) @@ -141,6 +141,12 @@ sdt_create_probe(struct sdt_probe *probe char *to; size_t len; + if (probe->version != (int)sizeof(*probe)) { + printf("ignoring probe %p, version %u expected %u\n", + probe, probe->version, (int)sizeof(*probe)); + return; + } + TAILQ_FOREACH(prov, &sdt_prov_list, prov_entry) if (strcmp(prov->name, probe->prov->name) == 0) break;