From: David Miller <davem@davemloft.net>
To: danborkmann@iogearbox.net
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net-next] af_packet: remove BUG statement in tpacket_destruct_skb
Date: Sun, 12 Aug 2012 13:42:31 -0700 (PDT) [thread overview]
Message-ID: <20120812.134231.2073879653802622537.davem@davemloft.net> (raw)
In-Reply-To: <1344674934.16015.3.camel@thinkbox>
From: Daniel Borkmann <danborkmann@iogearbox.net>
Date: Sat, 11 Aug 2012 10:48:54 +0200
> Here's a quote of the comment about the BUG macro from asm-generic/bug.h:
>
> Don't use BUG() or BUG_ON() unless there's really no way out; one
> example might be detecting data structure corruption in the middle
> of an operation that can't be backed out of. If the (sub)system
> can somehow continue operating, perhaps with reduced functionality,
> it's probably not BUG-worthy.
>
> If you're tempted to BUG(), think again: is completely giving up
> really the *only* solution? There are usually better options, where
> users don't need to reboot ASAP and can mostly shut down cleanly.
>
> In our case, the status flag of a ring buffer slot is managed from both sides,
> the kernel space and the user space. This means that even though the kernel
> side might work as expected, the user space screws up and changes this flag
> right between the send(2) is triggered when the flag is changed to
> TP_STATUS_SENDING and a given skb is destructed after some time. Then, this
> will hit the BUG macro. As David suggested, the best solution is to simply
> remove this statement since it cannot be used for kernel side internal
> consistency checks. I've tested it and the system still behaves /stable/ in
> this case, so in accordance with the above comment, we should rather remove it.
>
> Signed-off-by: Daniel Borkmann <daniel.borkmann@tik.ee.ethz.ch>
Applied.
prev parent reply other threads:[~2012-08-12 20:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-11 8:48 [PATCH net-next] af_packet: remove BUG statement in tpacket_destruct_skb Daniel Borkmann
2012-08-12 20:42 ` David Miller [this message]
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=20120812.134231.2073879653802622537.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=danborkmann@iogearbox.net \
--cc=netdev@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;
as well as URLs for NNTP newsgroup(s).