public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: David Miller <davem@davemloft.net>
Cc: herbert@gondor.apana.org.au, linux-kernel@vger.kernel.org,
	linux-crypto@vger.kernel.org
Subject: Re: [PATCH] crypto: fix error flow of crypto/testmgr.c:test_comp()
Date: Wed, 26 Nov 2008 03:40:32 +0100	[thread overview]
Message-ID: <20081126024032.GA21259@elte.hu> (raw)
In-Reply-To: <20081125.170851.97706149.davem@davemloft.net>


* David Miller <davem@davemloft.net> wrote:

> >     fix warning in drivers/net/sky2.c
> >     fix warning in net/sunrpc/svcauth_unix.c
> >     fix warning in security/selinux/netnode.c
> >     fix warning in net/packet/af_packet.c
> >     fix warning in net/rfkill/rfkill.c
> 
> Not applied.  Changing this from a BUG() to a panic() is wrong. 
> BUG() kills the current execution context, and allows the system to 
> potentially continue.  Panic() takes down the entire machine.

Yeah, although in practice a BUG() in some of those places will take 
down the whole machine:

  > >     fix warning in net/packet/af_packet.c

That's packet receive path, holding spinlocks or in other atomic 
context (irq/softirq)? A BUG() will take down the machine as we will 
crash and try to schedule in atomic context.

> The !CONFIG_BUG BUG() definition should be marked in such a way that 
> gcc thinks it is noreturn.  Otherwise BUG() isn't really BUG() 
> anymore.  The other option is to never allow BUG to be disabled or 
> have it always evaluate to a simple bug trap.

Yeah, but note that that's exactly the current behavior (and intent) 
of !CONFIG_BUG: it is not doing anything (it's just an empty macro 
which returns!), and we get those build warnings because the control 
flow becomes undefined. We cannot mark it noreturn because it does 
return.

	Ingo

  reply	other threads:[~2008-11-26  2:41 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-21  2:43 Crypto Update for 2.6.26 Herbert Xu
2008-07-14 12:14 ` Crypto Update for 2.6.27 Herbert Xu
2008-10-10  7:09   ` Crypto Update for 2.6.28 Herbert Xu
2008-10-10 18:22     ` Linus Torvalds
2008-10-10 18:29       ` Randy Dunlap
2008-10-11  2:13       ` Herbert Xu
2008-11-25  8:58         ` [PATCH] crypto: fix error flow of crypto/testmgr.c:test_comp() Ingo Molnar
2008-11-25 15:20           ` Herbert Xu
2008-11-25 17:14             ` Ingo Molnar
2008-11-25 17:26               ` Patrick McHardy
2008-11-25 21:52               ` David Miller
2008-11-26  1:09                 ` [warnings] 37 warning fixes in networking related files Ingo Molnar
2008-11-26  1:11                   ` David Miller
2008-11-26  1:08               ` [PATCH] crypto: fix error flow of crypto/testmgr.c:test_comp() David Miller
2008-11-26  2:40                 ` Ingo Molnar [this message]
2008-12-10 12:35         ` Crypto Update for 2.6.28 Herbert Xu
2008-12-24 22:20           ` Herbert Xu
2008-12-24 22:32             ` Linus Torvalds
2008-12-24 23:47               ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081126024032.GA21259@elte.hu \
    --to=mingo@elte.hu \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox