On Thu, Aug 27, 2020 at 12:37:03PM -0700, Joe Perches wrote: > On Thu, 2020-08-27 at 11:30 -0700, Kees Cook wrote: > > > Most of the uses of strcpy() in the kernel are just copying between two > > known-at-compile-time NUL-terminated character arrays. We had wanted to > > introduce stracpy() for this, but Linus objected to yet more string > > functions. > > https://lore.kernel.org/kernel-hardening/[email protected]/T/ > > I still think stracpy is a good idea. > > Maybe when the strcpy/strlcpy uses are removed > it'll be more acceptable. > > And here's a cocci script to convert most of them. > https://lore.kernel.org/kernel-hardening/[email protected]/
Yeah, thanks again for that. Most of this is very mechanical. (strncpy is not, unfortunately) -- Kees Cook

