Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0d69778626901a841108ae024b8a105da679d9af.camel@perches.com>
Date: Wed, 24 Jul 2019 11:29:13 -0700
From: Joe Perches <joe@...ches.com>
To: "Gote, Nitin R" <nitin.r.gote@...el.com>, Kees Cook
 <keescook@...omium.org>
Cc: "corbet@....net" <corbet@....net>, "akpm@...ux-foundation.org"
	 <akpm@...ux-foundation.org>, "apw@...onical.com" <apw@...onical.com>, 
	"linux-doc@...r.kernel.org"
	 <linux-doc@...r.kernel.org>, "kernel-hardening@...ts.openwall.com"
	 <kernel-hardening@...ts.openwall.com>
Subject: Re: [PATCH v5] Documentation/checkpatch: Prefer strscpy/strscpy_pad
 over strcpy/strlcpy/strncpy

On Wed, 2019-07-24 at 18:17 +0000, Gote, Nitin R wrote:
> Hi,

Hi again.

[]
> > > > > 3. Deprecate strncpy() in favor of strscpy() or strscpy_pad().

Please remember there does not exist a single actual use
of strscpy_pad in the kernel sources and no apparent real
need for it.  I don't find one anyway.

> Could you please give your opinion on below comment.
>  
> > But, if the destination buffer needs extra NUL-padding for remaining size of
> > destination, then safe replacement is strscpy_pad().  Right?  If yes, then what
> > is your opinion on below change :
> > 
> >         "strncpy" => "strscpy, strcpy_pad - for non-NUL-terminated uses,
> > strncpy() dst should be __nonstring",
> > 
> If you agree on this, then I will include this change in next patch version.

Two things:

The kernel-doc documentation uses dest not dst.
I think stracpy should be preferred over strscpy.


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.