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, 20 Jan 2010 10:53:50 +0000
From:	Russell King <rmk+lkml@....linux.org.uk>
To:	monstr@...str.eu
Cc:	linux-kernel@...r.kernel.org, michal.simek@...alogix.com,
	arnd@...db.de, linux-arch@...r.kernel.org,
	fujita.tomonori@....ntt.co.jp, akpm@...ux-foundation.org,
	mingo@...e.hu, joerg.roedel@....com
Subject: Re: Generic DMA - BUG_ON

On Wed, Jan 20, 2010 at 11:08:30AM +0100, monstr@...str.eu wrote:
> Hi All,
> 
> I have this patch in my repo. I just added BUG_ON for dma ops.
> The reason for that is if driver not setup ops correctly than
> the system do bad access to any memory space without any visible reason.
> BUG_ON points to it and helps to solve where the problem is.

I have a question of principle to raise here.

If you have code which does:

	if (ops->foo)
		ops->foo();

and ops is NULL, then this code will oops; you will get a full register
dump and backtrace.  You can use this information along with markup_oops.pl
to find out where the problem is.

If you add a BUG_ON() to this, the only additional information you end
up with is (possibly) a nice friendly message which tells you the file
and line number - but you add additional run-time tests to the code.

The question is: is this worth it?  Is there some problem with the
original oops that makes the problem hard to find?  Should we be using
BUG_ON() to augment normal oopses in this way?

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:
--
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