From owner-freebsd-arch@freebsd.org Thu Dec 3 16:36:01 2020 Return-Path: Delivered-To: freebsd-arch@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B67A24AA464 for ; Thu, 3 Dec 2020 16:36:01 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (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 4Cn1g45cp7z4ScX for ; Thu, 3 Dec 2020 16:36:00 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 8E2053C0199; Thu, 3 Dec 2020 16:35:54 +0000 (UTC) Date: Thu, 3 Dec 2020 16:35:54 +0000 From: Brooks Davis To: Konstantin Belousov Cc: Cy Schubert , freebsd-arch@freebsd.org Subject: Re: struct timex and Linux adjtimex() Message-ID: <20201203163554.GG18452@spindle.one-eyed-alien.net> References: <202012030523.0B35NsG7003810@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Pql/uPZNXIm1JCle" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 4Cn1g45cp7z4ScX X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of brooks@spindle.one-eyed-alien.net has no SPF policy when checking 199.48.129.229) smtp.mailfrom=brooks@spindle.one-eyed-alien.net X-Spamd-Result: default: False [-3.90 / 15.00]; ARC_NA(0.00)[]; FORGED_SENDER(0.30)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; FREEFALL_USER(0.00)[brooks]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[freebsd.org]; RBL_DBL_DONT_QUERY_IPS(0.00)[199.48.129.229:from]; AUTH_NA(1.00)[]; SPAMHAUS_ZRD(0.00)[199.48.129.229:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; SIGNED_PGP(-2.00)[]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_COUNT_ZERO(0.00)[0]; R_SPF_NA(0.00)[no SPF record]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US]; FROM_NEQ_ENVFROM(0.00)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; MAILMAN_DEST(0.00)[freebsd-arch] X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2020 16:36:01 -0000 --Pql/uPZNXIm1JCle Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Dec 03, 2020 at 12:05:04PM +0200, Konstantin Belousov wrote: > 2. Extend existing struct timex with struct timeval at the end of > the structure, but do not require it for any mode except when > ADJ_SETOFFSET is specified in modes. In other words, syscall > should copyin legacy struct timex, and if ADJ_SETOFFSET is set, > copying struct timeval from the address right after timex. Discussion seems to have selected option 1, but to put a stake in it, this option should be avoided due to the complexity it imposes on system call wrappers and argument validators. In general, paths should be the only arguments with lengths not immediately determinable from the type or a length argument. Anything that complicates determining the memory footprint of a system call is to be avoided. -- Brooks --Pql/uPZNXIm1JCle Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJfyRPpAAoJEKzQXbSebgfAoFYIAJKQo4O8PC/eIydoLkiS2Gwf kk46p43taa81b7brS2CSeNkUjNKKmICvoKYhEduM7U197wDK8aEm2AVg/dAidXVN 5vs8oQxHGyKO2WpIOAyOxHpAugKSJuerg37gG7oVwkYAhpOn+mZqCwdHkfiF/f1M ssNmP6sOZ7+4BXyStsmYlMR3oXETBHmKeFGYeaBSzLFNOz8t9qKjER2+Nc6Rwz9K V9g3J5qgvCCdcBNVp9FybxGq1Q/b1ii5OEGijWvLOGZB9ET9UwkXd6IF52U3Tq+L +/y1Cid2EAjMDgECV4LCjgsFCm4Nwyo2imP2duIAutndPtQPhFVoAql3IOxLcns= =th0k -----END PGP SIGNATURE----- --Pql/uPZNXIm1JCle--