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]
Message-ID: <20120723130759.GB28867@redhat.com>
Date:	Mon, 23 Jul 2012 09:07:59 -0400
From:	Jason Baron <jbaron@...hat.com>
To:	Jim Cromie <jim.cromie@...il.com>, greg@...ah.com
Cc:	linux-kernel@...r.kernel.org, kay@...y.com, joe@...ches.com
Subject: Re: [PATCH 1/3] drivers-core: make structured logging play nice with
 dynamic-debug

On Thu, Jul 19, 2012 at 01:46:20PM -0600, Jim Cromie wrote:
> commit c4e00daaa96d3a0786f1f4fe6456281c60ef9a16 changed __dev_printk
> in a way that broke dynamic-debug's ability to control the dynamic
> prefix of dev_dbg(dev,..), but not dev_dbg(NULL,..) or pr_debug(..),
> which is why it wasnt noticed sooner.
> 
> When dev==NULL, __dev_printk() just calls printk(), which just works.
> But otherwise, it assumed that level was always a string like "<L>"
> and just plucked out the 'L', ignoring the rest.  However,
> dynamic_emit_prefix() adds "[tid] module:func:line:" to the string,
> those additions all got lost.
> 
> Signed-off-by: Jim Cromie <jim.cromie@...il.com>
> ---
>  drivers/base/core.c |    9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 

Acked-by: Jason Baron <jbaron@...hat.com>


> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index 346be8b..ebdb7c5 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -1848,6 +1848,7 @@ int __dev_printk(const char *level, const struct device *dev,
>  		 struct va_format *vaf)
>  {
>  	char dict[128];
> +	const char *level_extra = "";
>  	size_t dictlen = 0;
>  	const char *subsys;
>  
> @@ -1894,10 +1895,14 @@ int __dev_printk(const char *level, const struct device *dev,
>  				    "DEVICE=+%s:%s", subsys, dev_name(dev));
>  	}
>  skip:
> +	if (level[3])
> +		level_extra = &level[3]; /* skip past "<L>" */
> +
>  	return printk_emit(0, level[1] - '0',
>  			   dictlen ? dict : NULL, dictlen,
> -			   "%s %s: %pV",
> -			   dev_driver_string(dev), dev_name(dev), vaf);
> +			   "%s %s: %s%pV", 
> +			   dev_driver_string(dev), dev_name(dev),
> +			   level_extra, vaf);
>  }
>  EXPORT_SYMBOL(__dev_printk);
>  
> -- 
> 1.7.10.4
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ