|
Message-ID: <12356C813DFF6F479B608F81178A561587AF87@BGSMSX101.gar.corp.intel.com> Date: Thu, 25 Jul 2019 07:26:14 +0000 From: "Gote, Nitin R" <nitin.r.gote@...el.com> To: Joe Perches <joe@...ches.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 > -----Original Message----- > From: Joe Perches [mailto:joe@...ches.com] > Sent: Wednesday, July 24, 2019 11:59 PM > To: Gote, Nitin R <nitin.r.gote@...el.com>; Kees Cook > <keescook@...omium.org> > Cc: corbet@....net; akpm@...ux-foundation.org; apw@...onical.com; > linux-doc@...r.kernel.org; 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. > Thanks for clarification. I will remove strscpy_pad() from patch. > > 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. Noted. I will correct this. > I think stracpy should be preferred over strscpy. > Agreed. I will use stracpy() instead of strscpy(). Thanks, Nitin
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.