All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Benjamin Coddington" <bcodding@redhat.com>
To: "Chuck Lever" <chuck.lever@oracle.com>
Cc: anna.schumaker@netapp.com, linux-nfs@vger.kernel.org
Subject: Re: [PATCH] SUNRPC: Fix another issue with MIC buffer space
Date: Fri, 15 Nov 2019 09:35:44 -0500	[thread overview]
Message-ID: <5CD994B4-61B0-4C76-BBB5-BE824AE955B4@redhat.com> (raw)
In-Reply-To: <20191115133907.15900.51854.stgit@manet.1015granger.net>

On 15 Nov 2019, at 8:39, Chuck Lever wrote:

> xdr_shrink_pagelen() BUG's when @len is larger than buf->page_len.
> This can happen when xdr_buf_read_mic() is given an xdr_buf with
> a small page array (like, only a few bytes).

Hi Chuck,

Seems like a bug in xdr_buf_read_mic to me, but I'm not seeing how this 
can
happen.. unless perhaps xdr->page_len is 0?  Or maybe xdr_shift_buf has 
bug?

I'd prefer to keep the BUG_ON.  How can I reproduce it?

diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c
index 14ba9e72a204..71d754fc780e 100644
--- a/net/sunrpc/xdr.c
+++ b/net/sunrpc/xdr.c
@@ -1262,6 +1262,8 @@ int xdr_buf_read_mic(struct xdr_buf *buf, struct 
xdr_netobj *mic, unsigned int o
         if (offset < boundary && (offset + mic->len) > boundary)
                 xdr_shift_buf(buf, boundary - offset);

+       trace_printk("boundary %d, offset %d, page_len %d\n", boundary, 
offset, buf->page_len);
+
         /* Is the mic partially in the pages? */
         boundary += buf->page_len;
         if (offset < boundary && (offset + mic->len) > boundary)

^^ that should be enough for me to try to figure out what's doing wrong.

Ben


  reply	other threads:[~2019-11-15 14:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-15 13:39 [PATCH] SUNRPC: Fix another issue with MIC buffer space Chuck Lever
2019-11-15 14:35 ` Benjamin Coddington [this message]
2019-11-15 14:41   ` Chuck Lever
2019-11-15 14:44     ` Chuck Lever
2019-11-15 14:51       ` Benjamin Coddington
2019-11-15 14:54         ` Chuck Lever
2019-11-15 15:51   ` Chuck Lever
2019-11-15 17:31     ` Benjamin Coddington
2019-11-15 17:34       ` Chuck Lever
2019-11-15 18:04         ` Benjamin Coddington
2019-11-18 15:24 Chuck Lever

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=5CD994B4-61B0-4C76-BBB5-BE824AE955B4@redhat.com \
    --to=bcodding@redhat.com \
    --cc=anna.schumaker@netapp.com \
    --cc=chuck.lever@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.