lkml.org 
[lkml]   [2019]   [Jun]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] lkdtm: no need to check return value of debugfs_create functions
On Tue, Jun 11, 2019 at 11:44:53AM -0700, Kees Cook wrote:
> On Tue, Jun 11, 2019 at 08:32:13PM +0200, Greg Kroah-Hartman wrote:
> > When calling debugfs functions, there is no need to ever check the
> > return value. The function can work or not, but the code logic should
> > never do something different based on this.
>
> What is the user-visible feedback when, say, debugfs_create_file()
> fails?

All of the memory in your system is now gone and it would have long
locked up a while before this call ever happened :)

And no user functionality should ever change if a debugfs call fails, or
succeeds, this is debugging only.

> And what happens when debugfs_create_file() passes in a NULL root?

The file ends up in the root of debugfs. But as this can only happen if
the system is dead, I wouldn't worry about it.

thanks,

greg k-h

\
 
 \ /
  Last update: 2019-06-11 20:57    [W:0.341 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site