Author: avg
Date: Fri Oct 23 07:57:33 2015
New Revision: 289804
URL: https://svnweb.freebsd.org/changeset/base/289804

Log:
  MFC r288362: sdt: start checking version field when parsing probe definitions

Modified:
  stable/9/sys/cddl/dev/sdt/sdt.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cddl/dev/sdt/sdt.c
==============================================================================
--- stable/9/sys/cddl/dev/sdt/sdt.c     Fri Oct 23 07:57:21 2015        
(r289803)
+++ stable/9/sys/cddl/dev/sdt/sdt.c     Fri Oct 23 07:57:33 2015        
(r289804)
@@ -142,6 +142,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;
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to