lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 22 Jan 2020 20:29:40 +0100
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     Jason Baron <jbaron@...mai.com>
Cc:     Will Deacon <will@...nel.org>, linux-kernel@...r.kernel.org,
        kernel-team@...roid.com
Subject: Re: [PATCH v2] dynamic_debug: allow to work if debugfs is disabled

On Wed, Jan 22, 2020 at 01:56:48PM -0500, Jason Baron wrote:
> 
> 
> On 1/22/20 8:53 AM, Greg Kroah-Hartman wrote:
> > 
> > With the realization that having debugfs enabled on "production" systems is
> > generally not a good idea, debugfs is being disabled from more and more
> > platforms over time.  However, the functionality of dynamic debugging still is
> > needed at times, and since it relies on debugfs for its user api, having
> > debugfs disabled also forces dynamic debug to be disabled.
> > 
> > To get around this, move the "control" file for dynamic_debug to procfs IFF
> > debugfs is disabled.  This lets people turn on debugging as needed at runtime
> > for individual driverfs and subsystems.
> > 
> 
> Hi Greg,
> 
> Thanks for updating this. Just a comment below.
> 
> 
> > Reported-by: many different companies
> > Cc: Jason Baron <jbaron@...mai.com>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> > ---
> > v2: Fix up octal permissions and add procfs reference to the Kconfig
> >     entry, thanks to Will for the review.
> > 
> >  .../admin-guide/dynamic-debug-howto.rst         |  3 +++
> >  lib/Kconfig.debug                               |  7 ++++---
> >  lib/dynamic_debug.c                             | 17 ++++++++++++++---
> >  3 files changed, 21 insertions(+), 6 deletions(-)
> > 
> > diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentation/admin-guide/dynamic-debug-howto.rst
> > index 252e5ef324e5..41f43a373a6a 100644
> > --- a/Documentation/admin-guide/dynamic-debug-howto.rst
> > +++ b/Documentation/admin-guide/dynamic-debug-howto.rst
> > @@ -54,6 +54,9 @@ If you make a mistake with the syntax, the write will fail thus::
> >  				<debugfs>/dynamic_debug/control
> >    -bash: echo: write error: Invalid argument
> >  
> > +Note, for systems without 'debugfs' enabled, the control file can be
> > +also found in ``/proc/dynamic_debug/control``.
> > +
> >  Viewing Dynamic Debug Behaviour
> >  ===============================
> >  
> > diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> > index 5ffe144c9794..49980eb8c18e 100644
> > --- a/lib/Kconfig.debug
> > +++ b/lib/Kconfig.debug
> > @@ -98,7 +98,7 @@ config DYNAMIC_DEBUG
> >  	bool "Enable dynamic printk() support"
> >  	default n
> >  	depends on PRINTK
> > -	depends on DEBUG_FS
> > +	depends on (DEBUG_FS || PROC_FS)
> >  	help
> >  
> >  	  Compiles debug level messages into the kernel, which would not
> > @@ -116,8 +116,9 @@ config DYNAMIC_DEBUG
> >  	  Usage:
> >  
> >  	  Dynamic debugging is controlled via the 'dynamic_debug/control' file,
> > -	  which is contained in the 'debugfs' filesystem. Thus, the debugfs
> > -	  filesystem must first be mounted before making use of this feature.
> > +	  which is contained in the 'debugfs' filesystem or procfs if
> > +	  debugfs is not present. Thus, the debugfs or procfs filesystem
> > +	  must first be mounted before making use of this feature.
> >  	  We refer the control file as: <debugfs>/dynamic_debug/control. This
> >  	  file contains a list of the debug statements that can be enabled. The
> >  	  format for each line of the file is:
> > diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
> > index c60409138e13..0f1b26f10fb2 100644
> > --- a/lib/dynamic_debug.c
> > +++ b/lib/dynamic_debug.c
> > @@ -993,13 +993,24 @@ static __initdata int ddebug_init_success;
> >  
> >  static int __init dynamic_debug_init_debugfs(void)
> >  {
> 
> The naming now is a little confusing - dynamic_debug_init_control ?

Ah, good point.  I'll go fix that up, and fix up the foolish build
warning that I missed...

thanks,

greg k-h

Powered by blists - more mailing lists