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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.1204131019380.1185-100000@iolanthe.rowland.org>
Date:	Fri, 13 Apr 2012 10:35:59 -0400 (EDT)
From:	Alan Stern <stern@...land.harvard.edu>
To:	Johannes Stezenbach <js@...21.net>
cc:	Jason Baron <jbaron@...hat.com>, <linux-kernel@...r.kernel.org>,
	<linux-usb@...r.kernel.org>
Subject: Re: ehci dynamic debug problem

On Fri, 13 Apr 2012, Johannes Stezenbach wrote:

> Hi,
> 
> I have a quirky device and enabled dynamic debug to
> see the ehci driver debug messages to help me diagnose
> the problem.  I see stuff like this:
> 
> [1790542.363321] ehci_hub_control:940: ehci_hcd 0000:00:1a.0: \xffffffd8\xffffff94\xffffff94\xffffffa8\xffffff81\xffffffff\xffffffff\xffffffff\xffffffff}[<\xffffff81\xffffffff\xffffffff\xffffffff\xffffffff\x01
> [1790542.363470] ehci_hub_control:940: ehci_hcd 0000:00:1a.0: \xffffffd8\xffffff94\xffffff94\xffffffa8\xffffff81\xffffffff\xffffffff\xffffffff\xffffffff}[<\xffffff81\xffffffff\xffffffff\xffffffff\xffffffff\x01
> 
> The problem is in ehci-dbg.c:
> 
> #define dbg_port(ehci, label, port, status) { \
> 	char _buf [80]; \
> 	dbg_port_buf (_buf, sizeof _buf, label, port, status); \
> 	ehci_dbg (ehci, "%s\n", _buf); \
> }
> 
> dbg_port_buf() is a no op when DEBUG is not defined, thus
> the ehci_dbg() prints uninitialized memory.

Interesting.  I have never run across this, because I never use dynamic 
debug.

> Does dynamic debug offer an "is the message two lines below enabled" test?
> Simply changing the "#ifdef DEBUG" for dbg_port_buf()
> to "#if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)"
> is probably not acceptable due to the overhead of dbg_port_buf()?

I don't understand your question.  Doesn't dbg_port_buf need to be 
defined whenever dynamic debugging is enabled?

Alternatively, the definition of dbg_port_buf (and related routines) in 
the !defined(DEBUG) case could be changed; you could add

	buf[0] = 0;

That way you wouldn't get garbage out, although you wouldn't get 
anything useful either.

Alan Stern

--
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