From: "Myklebust, Trond" <Trond.Myklebust@netapp.com>
To: "J. Bruce Fields" <bfields@redhat.com>
Cc: "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH 1/2] rpc: change BUG to WARN in gss_encode_v1_msg
Date: Wed, 16 Oct 2013 18:17:54 +0000 [thread overview]
Message-ID: <1381947473.17178.2.camel@leira.trondhjem.org> (raw)
In-Reply-To: <1380721695-14755-1-git-send-email-bfields@redhat.com>
On Wed, 2013-10-02 at 09:48 -0400, J. Bruce Fields wrote:
> From: "J. Bruce Fields" <bfields@redhat.com>
>
> Failure of this assertion would indeed be serious, but as we've seen a
> BUG() in a worker thread (this can run from rpciod context) can screw up
> the system so badly that the oops doesn't even get to the logs; better
> to WARN() and soldier on.
>
> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
> ---
> net/sunrpc/auth_gss/auth_gss.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
> index 0846566..254a9f0 100644
> --- a/net/sunrpc/auth_gss/auth_gss.c
> +++ b/net/sunrpc/auth_gss/auth_gss.c
> @@ -454,7 +454,7 @@ static void gss_encode_v1_msg(struct gss_upcall_msg *gss_msg,
> gss_msg->msg.len += len;
>
> gss_msg->msg.data = gss_msg->databuf;
> - BUG_ON(gss_msg->msg.len > UPCALL_BUF_LEN);
> + WARN_ON_ONCE(gss_msg->msg.len > UPCALL_BUF_LEN);
> }
>
> static struct gss_upcall_msg *
Umm.... Why aren't we using scnprintf() in order to prevent string
buffer overflows before they happen?
--
Trond Myklebust
Linux NFS client maintainer
NetApp
Trond.Myklebust@netapp.com
www.netapp.com
next prev parent reply other threads:[~2013-10-16 18:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-02 13:48 [PATCH 1/2] rpc: change BUG to WARN in gss_encode_v1_msg J. Bruce Fields
2013-10-02 13:48 ` [PATCH 2/2] sunrpc: comment typo fix J. Bruce Fields
2013-10-16 18:17 ` Myklebust, Trond [this message]
2013-10-16 18:37 ` [PATCH 1/2] rpc: change BUG to WARN in gss_encode_v1_msg J. Bruce Fields
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=1381947473.17178.2.camel@leira.trondhjem.org \
--to=trond.myklebust@netapp.com \
--cc=bfields@redhat.com \
--cc=linux-nfs@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).