Date: Wed, 6 Nov 2019 19:44:45 +0000 (UTC) From: Brooks Davis <brooks@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354409 - head/sys/kern Message-ID: <201911061944.xA6Jijg5055313@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: brooks Date: Wed Nov 6 19:44:44 2019 New Revision: 354409 URL: https://svnweb.freebsd.org/changeset/base/354409 Log: libstats: Improve ABI assertion. On platforms where pointers are larger than 64-bits, struct statsblob may be harmlessly padded out such that opaque[] always has some included space. Make the assertion more general by comparing to the offset of opaque rather than the size of struct statsblob. Discussed with: jhb, James Clarke Reviewed by: trasz, lstewart Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22188 Modified: head/sys/kern/subr_stats.c Modified: head/sys/kern/subr_stats.c ============================================================================== --- head/sys/kern/subr_stats.c Wed Nov 6 18:54:04 2019 (r354408) +++ head/sys/kern/subr_stats.c Wed Nov 6 19:44:44 2019 (r354409) @@ -124,7 +124,8 @@ struct statsblobv1 { struct voi vois[]; /* Array indexed by [voi_id]. */ } __aligned(sizeof(void *)); _Static_assert(offsetof(struct statsblobv1, cursz) + - SIZEOF_MEMBER(struct statsblobv1, cursz) == sizeof(struct statsblob), + SIZEOF_MEMBER(struct statsblobv1, cursz) == + offsetof(struct statsblob, opaque), "statsblobv1 ABI mismatch"); struct statsblobv1_tpl {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201911061944.xA6Jijg5055313>