Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Jan 2018 12:42:37 +1100 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Pedro Giffuni <pfg@freebsd.org>
Cc:        Bruce Evans <brde@optusnet.com.au>, Dimitry Andric <dim@freebsd.org>,  Ed Schouten <ed@nuxi.nl>, src-committers <src-committers@freebsd.org>,  svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r328492 - head/contrib/opie/libopie
Message-ID:  <20180128121851.U4596@besplex.bde.org>
In-Reply-To: <5c39c37d-8d0a-22e9-710b-2453e0dd4481@FreeBSD.org>
References:  <201801272216.w0RMGJwo057492@repo.freebsd.org> <CABh_MKn=3pRWyMHUAQkG17dQVBFEwFA2esFixPtgkCt7VE5oCw@mail.gmail.com> <7C471160-44B3-4EA6-8995-08A4EB4332A1@FreeBSD.org> <20180128093811.G4029@besplex.bde.org> <5c39c37d-8d0a-22e9-710b-2453e0dd4481@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <ed@nuxi.nl> 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: <owner-svn-src-all@freebsd.org>
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 <Cy.Schubert@cschubert.com>
From: Cy Schubert <Cy.Schubert@cschubert.com>
X-os: FreeBSD
X-Sender: cy@cwsent.com
X-URL: http://www.cschubert.com/
To: Mariusz Zaborski <oshogbo@FreeBSD.org>
cc: Cy Schubert <Cy.Schubert@cschubert.com>, 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 <oshogbo@FreeBSD.org>
 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 &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>;
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=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 <Cy.Schubert@cschubert.com>
FreeBSD UNIX:  <cy@FreeBSD.org>   Web:  http://www.FreeBSD.org

	The need of the many outweighs the greed of the few.





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180128121851.U4596>