From owner-svn-src-all@freebsd.org Sun Jan 28 01:42:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65A4CED12B6; Sun, 28 Jan 2018 01:42:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id D63B685058; Sun, 28 Jan 2018 01:42:46 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 26BBDD6E9A7; Sun, 28 Jan 2018 12:42:38 +1100 (AEDT) Date: Sun, 28 Jan 2018 12:42:37 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Pedro Giffuni cc: Bruce Evans , Dimitry Andric , Ed Schouten , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328492 - head/contrib/opie/libopie In-Reply-To: <5c39c37d-8d0a-22e9-710b-2453e0dd4481@FreeBSD.org> Message-ID: <20180128121851.U4596@besplex.bde.org> References: <201801272216.w0RMGJwo057492@repo.freebsd.org> <7C471160-44B3-4EA6-8995-08A4EB4332A1@FreeBSD.org> <20180128093811.G4029@besplex.bde.org> <5c39c37d-8d0a-22e9-710b-2453e0dd4481@FreeBSD.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=DIX/22Fb c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=nlC_4_pT8q9DhB4Ho9EA:9 a=JR47EUaj5dUosQkC4R8A:9 a=xtHLe4mNsMW_yGvb:21 a=3uVtrHTtWy3TCr6j:21 a=45ClL6m2LaAA:10 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jan 2018 01:42:47 -0000 On Sat, 27 Jan 2018, Pedro Giffuni wrote: > On 01/27/18 18:21, Bruce Evans wrote: >> On Sat, 27 Jan 2018, Dimitry Andric wrote: >>=20 >>> On 27 Jan 2018, at 23:20, Ed Schouten wrote: >* [... context lost to corruption of spaces which makes it unreadable] >>>>=20 >>>> Wait... This may access utmp.ut_host one byte past the end and no >>>> longer guarantees that host is null-terminated, right? >>=20 >>> No, strncpy "copies at most len characters from src into dst".=C2=A0 Ho= wever, >>=20 >> No, the change breaks the length so 1 byte past the end is accessed >> in implementations where ut_host is not guaranteed to be NUL terminated >> and the current instance of ut_host is not NUL terminated. >>=20 > The main change is in the sizeof(). Regularly you should use the size of= =20 > destination not the source, and apparently GCC8 decided there was somethi= ng=20 > to check there. That is the main breakage. Using the size of the destination is very wrong= , since that size is intentionally 1 larger than the size of the source, to leave space for appending a NUL. > ... > Looking in detail, upstream (which appears to have disappeared) does have= the=20 > explicit NULL termination in our last import. For consistency and given t= hat=20 > we already have a strlcpy in that code, we should use strlcpy() there. Ev= ery=20 > modern OS out there has strlcpy(3) and if not they can figure out what to= do. strlcpy() still seems to be intentionally left out of glibc. Bruce From owner-svn-src-all@freebsd.org Sun Jan 28 02:26:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5418BED2F9F; Sun, 28 Jan 2018 02:26:11 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AECCA86949; Sun, 28 Jan 2018 02:26:10 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with ESMTPA id fcfReIhEPS7BpfcfSenou8; Sat, 27 Jan 2018 19:26:03 -0700 X-Authority-Analysis: v=2.2 cv=NKylwwyg c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=RgaUWeydRksA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=mDrIFqkUxoSzuNa0Tf8A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 619E6504; Sat, 27 Jan 2018 18:26:00 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w0S2Px4S010114; Sat, 27 Jan 2018 18:25:59 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w0S2Px1G010111; Sat, 27 Jan 2018 18:25:59 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201801280225.w0S2Px1G010111@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Mariusz Zaborski cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328474 - head/sys/contrib/libnv In-Reply-To: Message from Mariusz Zaborski of "Sat, 27 Jan 2018 22:56:58 +0100." <20180127215658.GA75080@jarvis> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 27 Jan 2018 18:25:59 -0800 X-CMAE-Envelope: MS4wfJ7gxLVponPZz9Gt5YiJACeD7VRGWhhuqy/rQWPbQBhIX7s5BW5v66l1u36K5Tb4zqAiG1HpozCIZLrEPl36hiVyhhb1vxxaSVLfG2nMUMGUy0VWULc9 zVeR/OxD+bj5wRjb6Unh0LMgWXdNwSdYrYSOapE7mQkZzZUHqdkyNotVnKySrijCbDjmr10aitFcWiNmuczhNEKla94IgCxDqFaxJVCu96/qVF+AqIBXby1X DqLG2hglEDHBUguyxtnDJ22nnaM2Rhvs3FzF94jNDe7Lo5XIHXEzvWG57xaefPcT X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jan 2018 02:26:11 -0000 In message <20180127215658.GA75080@jarvis>, Mariusz Zaborski writes: > > > --ew6BAiZeqk4r7MaW > Content-Type: text/plain; charset=us-ascii > Content-Disposition: inline > Content-Transfer-Encoding: quoted-printable > > On Sat, Jan 27, 2018 at 07:32:39AM -0800, Cy Schubert wrote: > > In message <201801271258.w0RCwMl0078832@repo.freebsd.org>, Mariusz Zabors= > ki=20 > > wri > > tes: > > > Author: oshogbo > > > Date: Sat Jan 27 12:58:21 2018 > > > New Revision: 328474 > > > URL: https://svnweb.freebsd.org/changeset/base/328474 > > > > > > Log: > > > Add SPDX tags for nv(9). > > > =20 > > > MFC after: 2 weeks > > > > > > Modified: > > > head/sys/contrib/libnv/cnvlist.c > > > head/sys/contrib/libnv/dnvlist.c > > > head/sys/contrib/libnv/nv_impl.h > > > head/sys/contrib/libnv/nvlist.c > > > head/sys/contrib/libnv/nvlist_impl.h > > > head/sys/contrib/libnv/nvpair.c > > > head/sys/contrib/libnv/nvpair_impl.h > > > > >=20 > > When was it decided to add SPDX to contrib? > The nv was development for and in FreeBSD. > First whole library was in lib/libnv. > Then the part which is also in the kernel was moved to sys/kern and sys/sys > directories. > The problem with that was that evrything in the sys/sys is instaled in > /usr/include and in the *_impl.h we have things that should not be accesibl= > e by > developers. > > This was the main reason of moving libnv to contrib file at the time. > If you have any other place where libnv can be kept I'm happy to move it. It's native to FreeBSD then and not an import through a vendor branch. That's what was led to understand. However this was not concern I had. As this is native FreeBSD code it should have SPDX tags. My concern about SPDX in contrib is MFV. I think we should encourage our upstream source providers to include SPDX tags in their code we import into the vendor branches. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few.