Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Sep 2015 11:58:21 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r288362 - head/sys/cddl/dev/sdt
Message-ID:  <201509291158.t8TBwLd1052484@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201509291158.t8TBwLd1052484>