From owner-svn-src-head@freebsd.org Fri Oct 2 19:47:34 2015 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 1339AA0DC74; Fri, 2 Oct 2015 19:47:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id EA8F811EA; Fri, 2 Oct 2015 19:47:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id WAA14952; Fri, 02 Oct 2015 22:47:29 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Zi6Ij-0000IG-4p; Fri, 02 Oct 2015 22:47:29 +0300 Subject: Re: svn commit: r288362 - head/sys/cddl/dev/sdt To: Rui Paulo , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201509291158.t8TBwLd1052484@repo.freebsd.org> <1443808493.13078.11.camel@me.com> From: Andriy Gapon Message-ID: <560EDEF6.8050009@FreeBSD.org> Date: Fri, 2 Oct 2015 22:45:58 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <1443808493.13078.11.camel@me.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 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: Fri, 02 Oct 2015 19:47:34 -0000 On 02/10/2015 20:54, Rui Paulo wrote: > On Tue, 2015-09-29 at 11:58 +0000, Andriy Gapon wrote: >> 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; >> + } >> + >> > > Not picking on your change, but this version management sounds like a > bad idea to me... > It's certainly not very robust, but I think that it's better than nothing. Having proper SDT binary layout versions would be better, of course. -- Andriy Gapon