From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 14:49:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2B820281; Fri, 6 Jun 2014 14:49:01 +0000 (UTC) Received: from svn.freebsd.org (svn.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 18EC6290B; Fri, 6 Jun 2014 14:49:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56En05B073029; Fri, 6 Jun 2014 14:49:00 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56En06e073028; Fri, 6 Jun 2014 14:49:00 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201406061449.s56En06e073028@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 6 Jun 2014 14:49:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267162 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 06 Jun 2014 14:49:01 -0000 Author: jilles Date: Fri Jun 6 14:49:00 2014 New Revision: 267162 URL: http://svnweb.freebsd.org/changeset/base/267162 Log: ktrace: Use designated initializers for the data_lengths array. In the .o file, this only changes some line numbers (head amd64) because element 0 is no longer explicitly initialized. This should make bugs like FreeBSD-SA-14:12.ktrace less likely. Discussed with: des MFC after: 1 week Modified: head/sys/kern/kern_ktrace.c Modified: head/sys/kern/kern_ktrace.c ============================================================================== --- head/sys/kern/kern_ktrace.c Fri Jun 6 13:37:40 2014 (r267161) +++ head/sys/kern/kern_ktrace.c Fri Jun 6 14:49:00 2014 (r267162) @@ -109,21 +109,20 @@ struct ktr_request { }; static int data_lengths[] = { - 0, /* none */ - offsetof(struct ktr_syscall, ktr_args), /* KTR_SYSCALL */ - sizeof(struct ktr_sysret), /* KTR_SYSRET */ - 0, /* KTR_NAMEI */ - sizeof(struct ktr_genio), /* KTR_GENIO */ - sizeof(struct ktr_psig), /* KTR_PSIG */ - sizeof(struct ktr_csw), /* KTR_CSW */ - 0, /* KTR_USER */ - 0, /* KTR_STRUCT */ - 0, /* KTR_SYSCTL */ - sizeof(struct ktr_proc_ctor), /* KTR_PROCCTOR */ - 0, /* KTR_PROCDTOR */ - sizeof(struct ktr_cap_fail), /* KTR_CAPFAIL */ - sizeof(struct ktr_fault), /* KTR_FAULT */ - sizeof(struct ktr_faultend), /* KTR_FAULTEND */ + [KTR_SYSCALL] = offsetof(struct ktr_syscall, ktr_args), + [KTR_SYSRET] = sizeof(struct ktr_sysret), + [KTR_NAMEI] = 0, + [KTR_GENIO] = sizeof(struct ktr_genio), + [KTR_PSIG] = sizeof(struct ktr_psig), + [KTR_CSW] = sizeof(struct ktr_csw), + [KTR_USER] = 0, + [KTR_STRUCT] = 0, + [KTR_SYSCTL] = 0, + [KTR_PROCCTOR] = sizeof(struct ktr_proc_ctor), + [KTR_PROCDTOR] = 0, + [KTR_CAPFAIL] = sizeof(struct ktr_cap_fail), + [KTR_FAULT] = sizeof(struct ktr_fault), + [KTR_FAULTEND] = sizeof(struct ktr_faultend), }; static STAILQ_HEAD(, ktr_request) ktr_free;