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:   Thu, 12 Oct 2017 11:11:00 -0700
From:   Joe Perches <joe@...ches.com>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Kay Sievers <kay@...y.org>
Cc:     Petr Mladek <pmladek@...e.com>, sergey.senozhatsky@...il.com,
        linux-kernel@...r.kernel.org, rostedt@...dmis.org,
        mingo@...nel.org, tglx@...utronix.de,
        Jason Wessel <jason.wessel@...driver.com>
Subject: Re: [PATCH 1/3] printk: Fix kdb_trap_printk placement

On Thu, 2017-10-12 at 14:08 +0200, Greg Kroah-Hartman wrote:
> On Thu, Oct 12, 2017 at 01:52:29PM +0200, Greg Kroah-Hartman wrote:
> > On Thu, Oct 12, 2017 at 01:34:39PM +0200, Peter Zijlstra wrote:
> > > On Thu, Oct 12, 2017 at 12:03:04PM +0200, Petr Mladek wrote:
> > > > On Thu 2017-10-12 11:45:37, Petr Mladek wrote:
> > > > > Hi,
> > > > > 
> > > > > I thought about this a lot from several angles. And I would prefer
> > > > > sligly different placement, see the patch below.
> > > > > 
> > > > > On Thu 2017-09-28 14:18:24, Peter Zijlstra wrote:
> > > > > > Some people figured vprintk_emit() makes for a nice API and exported
> > > > > > it, bypassing the kdb trap.
> > > > > 
> > > > > Sigh, printk() API is pretty complicated and this export
> > > > > made it much worse. Well, there are two things:
> > > > > 
> > > > > First, kdb_trap_printk name is a bit misleading. It is not a
> > > > > generic trap of any printk message. Instead it seems to be
> > > > > used to redirect only particular messages from some existing
> > > > > functions, e.g. show_regs() called from kdb_dumpregs().
> > > > > 
> > > > > Second, it seems that the only user of the exported vprintk_emit()
> > > > > is dev_vprintk_emit(). I believe that code using this wrapper
> > > > > is not called in the sections where kdb_trap_printk is incremented.
> > > > 
> > > > Well, I wonder if we should go even further and stop exporting
> > > > vprintk_emit(). IMHO, the only reason was dev_print_emit() and
> > > > the ability to pass the extra "dict" parameter.
> > > 
> > > You have my blessing there, but the device folks might have an opinion
> > > on that; Cc'ed Gregkh.
> > 
> > Hm, we "need" that dict option, otherwise the whole dev_printk() family
> > of messages will not work properly, right?
> > 
> > Or am I missing something?  If you can figure out a way to still support
> > the same thing (we need a prefix at the beginning of the message that
> > shows the device/driver/binding/etc that emitted the message), that's
> > fine with me, I'm not wed to vprintk_emit() :)
> 
> Nope, this doesn't seem to deal with the prefix, except in some odd way
> that is tied to the dynamic debugging logic.  I really don't know what
> this does anymore.  Joe wrote it in 2012 as part of the dynamic debug
> code.
> 
> Joe, any thoughts?

Man I hate rabbit-holes.  I need a few days as I'm
otherwise busy.

This stuff has been broken for half a decade now.
Perhaps it doesn't need fixing?

In any case, printk needs a thorough breaking up
and refactoring.

Pushing around at its edges just makes it worse.

vprintk_emit came from Kay Sievers.

commit 7ff9554bb578ba02166071d2d487b7fc7d860d62
Author: Kay Sievers <kay@...y.org>
Date:   Thu May 3 02:29:13 2012 +0200

    printk: convert byte-buffer to variable-length record buffer

It seems printk_emit is also exported and unused.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ