Re: the nul-terminated string helper desk chair rearrangement

2023-10-27 Thread Alexey Dobriyan
On Thu, Oct 26, 2023 at 03:59:28PM +0200, Geert Uytterhoeven wrote: > Hi Steven, > > On Thu, Oct 26, 2023 at 3:52 PM Steven Rostedt wrote: > > On Thu, 26 Oct 2023 07:39:44 -0400 > > James Bottomley wrote: > > > > > While it's nice in theory to have everything documented, it's not much > > > use

Re: the nul-terminated string helper desk chair rearrangement

2023-10-27 Thread Kalle Valo
Jonathan Corbet writes: > Steven Rostedt writes: > >> On Thu, 26 Oct 2023 07:39:44 -0400 >> James Bottomley wrote: >> >>> While it's nice in theory to have everything documented, it's not much >>> use if no one can actually find the information ... >> >> Does kerneldoc provide an automated inde

Re: the nul-terminated string helper desk chair rearrangement

2023-10-26 Thread James Bottomley
On Thu, 2023-10-26 at 15:44 +0200, Andrew Lunn wrote: > > > > [1]: > > > > https://elixir.bootlin.com/linux/v6.6-rc6/source/include/linux/fortify-string.h#L292 > > I found that https://elixir.bootlin.com/linux That's a 404, I think you mean https://elixir.bootlin.com/linux/latest/source >  is t

Re: the nul-terminated string helper desk chair rearrangement

2023-10-26 Thread Jonathan Corbet
Steven Rostedt writes: > On Thu, 26 Oct 2023 07:39:44 -0400 > James Bottomley wrote: > >> While it's nice in theory to have everything documented, it's not much >> use if no one can actually find the information ... > > Does kerneldoc provide an automated index? If you go to https://www.kernel.

Re: the nul-terminated string helper desk chair rearrangement

2023-10-26 Thread Geert Uytterhoeven
Hi Steven, On Thu, Oct 26, 2023 at 3:52 PM Steven Rostedt wrote: > On Thu, 26 Oct 2023 07:39:44 -0400 > James Bottomley wrote: > > > While it's nice in theory to have everything documented, it's not much > > use if no one can actually find the information ... > > Does kerneldoc provide an automa

Re: the nul-terminated string helper desk chair rearrangement

2023-10-26 Thread Steven Rostedt
On Thu, 26 Oct 2023 07:39:44 -0400 James Bottomley wrote: > While it's nice in theory to have everything documented, it's not much > use if no one can actually find the information ... Does kerneldoc provide an automated index? That is, if we had a single file that had every function in the kern

Re: the nul-terminated string helper desk chair rearrangement

2023-10-26 Thread Laurent Pinchart
On Thu, Oct 26, 2023 at 03:44:22PM +0200, Andrew Lunn wrote: > > > > [1]: > > > > https://elixir.bootlin.com/linux/v6.6-rc6/source/include/linux/fortify-string.h#L292 > > I found that https://elixir.bootlin.com/linux is the best way to find > Documentation for functions and structures. I would su

Re: the nul-terminated string helper desk chair rearrangement

2023-10-26 Thread Andrew Lunn
> > > [1]: > > > https://elixir.bootlin.com/linux/v6.6-rc6/source/include/linux/fortify-string.h#L292 I found that https://elixir.bootlin.com/linux is the best way to find Documentation for functions and structures. I would suggest try it first, and only when what fails to start using grep.

Re: the nul-terminated string helper desk chair rearrangement

2023-10-26 Thread James Bottomley
On Thu, 2023-10-26 at 12:01 +0200, Christoph Hellwig wrote: > > > There's some docs at [1]. Perhaps there could be more? > > > > > > [1]: > > > https://elixir.bootlin.com/linux/v6.6-rc6/source/include/linux/fortify-string.h#L292 > > > > Right, And it's even valid kern-doc, which gets rendered in

Re: the nul-terminated string helper desk chair rearrangement

2023-10-26 Thread Christoph Hellwig
On Fri, Oct 20, 2023 at 11:30:49AM -0700, Kees Cook wrote: > I'm curious where you looked and didn't find documentation -- perhaps > there is an improvement to be made to aim one to where the existing > documentation lives? My order was the following: - look for kernel doc on the main function i

Re: the nul-terminated string helper desk chair rearrangement

2023-10-20 Thread Kees Cook
On Fri, Oct 20, 2023 at 10:40:12AM -0700, Justin Stitt wrote: > On Thu, Oct 19, 2023 at 9:46 PM Christoph Hellwig wrote: > > > > On Wed, Oct 18, 2023 at 11:01:54PM -0700, Kees Cook wrote: > > > Almost all of the remaining strncpy() usage is just string to string > > > copying, but the corner cases

Re: the nul-terminated string helper desk chair rearrangement

2023-10-20 Thread Kees Cook
On Fri, Oct 20, 2023 at 10:56:31AM -0700, Linus Torvalds wrote: > On Fri, 20 Oct 2023 at 10:40, Justin Stitt wrote: > > > > There's some docs at [1]. Perhaps there could be more? > > > > [1]: > > https://elixir.bootlin.com/linux/v6.6-rc6/source/include/linux/fortify-string.h#L292 > > Note that w

Re: the nul-terminated string helper desk chair rearrangement

2023-10-20 Thread Linus Torvalds
On Fri, 20 Oct 2023 at 10:40, Justin Stitt wrote: > > There's some docs at [1]. Perhaps there could be more? > > [1]: > https://elixir.bootlin.com/linux/v6.6-rc6/source/include/linux/fortify-string.h#L292 Note that we have so few 'strlcpy()' calls that we really should remove that horrid horrid

Re: the nul-terminated string helper desk chair rearrangement

2023-10-20 Thread Justin Stitt
On Thu, Oct 19, 2023 at 9:46 PM Christoph Hellwig wrote: > > On Wed, Oct 18, 2023 at 11:01:54PM -0700, Kees Cook wrote: > > Almost all of the remaining strncpy() usage is just string to string > > copying, but the corner cases that are being spun out that aren't > > strscpy() or strscpy_pad() are

Re: the nul-terminated string helper desk chair rearrangement

2023-10-19 Thread Christoph Hellwig
On Wed, Oct 18, 2023 at 11:01:54PM -0700, Kees Cook wrote: > Almost all of the remaining strncpy() usage is just string to string > copying, but the corner cases that are being spun out that aren't > strscpy() or strscpy_pad() are covered by strtomem(), kmemdup_nul(), > and memcpy(). Each of these

Re: the nul-terminated string helper desk chair rearrangement

2023-10-19 Thread Willy Tarreau
On Thu, Oct 19, 2023 at 02:40:52PM +0300, Alexey Dobriyan wrote: > On Thu, Oct 19, 2023 at 09:01:53AM +0200, Willy Tarreau wrote: > > On Wed, Oct 18, 2023 at 11:01:54PM -0700, Kees Cook wrote: > > > On Thu, Oct 19, 2023 at 07:46:42AM +0200, Christoph Hellwig wrote: > > > > On Wed, Oct 18, 2023 at 1

Re: the nul-terminated string helper desk chair rearrangement

2023-10-19 Thread Alexey Dobriyan
On Thu, Oct 19, 2023 at 09:01:53AM +0200, Willy Tarreau wrote: > On Wed, Oct 18, 2023 at 11:01:54PM -0700, Kees Cook wrote: > > On Thu, Oct 19, 2023 at 07:46:42AM +0200, Christoph Hellwig wrote: > > > On Wed, Oct 18, 2023 at 10:48:49PM +, Justin Stitt wrote: > > > > strncpy() is deprecated for

Re: the nul-terminated string helper desk chair rearrangement

2023-10-19 Thread Willy Tarreau
On Wed, Oct 18, 2023 at 11:01:54PM -0700, Kees Cook wrote: > On Thu, Oct 19, 2023 at 07:46:42AM +0200, Christoph Hellwig wrote: > > On Wed, Oct 18, 2023 at 10:48:49PM +, Justin Stitt wrote: > > > strncpy() is deprecated for use on NUL-terminated destination strings > > > [1] and as such we shou

Re: the nul-terminated string helper desk chair rearrangement

2023-10-18 Thread Kees Cook
On Thu, Oct 19, 2023 at 07:46:42AM +0200, Christoph Hellwig wrote: > On Wed, Oct 18, 2023 at 10:48:49PM +, Justin Stitt wrote: > > strncpy() is deprecated for use on NUL-terminated destination strings > > [1] and as such we should prefer more robust and less ambiguous string > > interfaces. >