From: Trond Myklebust <trondmy@hammerspace.com>
To: "bfields@fieldses.org" <bfields@fieldses.org>,
"fuzzybritches0@gmail.com" <fuzzybritches0@gmail.com>,
"skhan@linuxfoundation.org" <skhan@linuxfoundation.org>,
"anna.schumaker@netapp.com" <anna.schumaker@netapp.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"chuck.lever@oracle.com" <chuck.lever@oracle.com>,
"kuba@kernel.org" <kuba@kernel.org>
Cc: "linux-kernel-mentees@lists.linuxfoundation.org"
<linux-kernel-mentees@lists.linuxfoundation.org>,
"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"syzbot+ba2e91df8f74809417fa@syzkaller.appspotmail.com"
<syzbot+ba2e91df8f74809417fa@syzkaller.appspotmail.com>
Subject: Re: [PATCH] net: sunrpc: xprt.c: fix shift-out-of-bounds in xprt_calc_majortimeo
Date: Mon, 19 Apr 2021 16:58:05 +0000 [thread overview]
Message-ID: <5850f8a65c59436b607c9d1ac088402d14873577.camel@hammerspace.com> (raw)
In-Reply-To: <20210419163603.7-1-fuzzybritches0@gmail.com>
On Mon, 2021-04-19 at 16:36 +0000, Kurt Manucredo wrote:
> Fix shift-out-of-bounds in xprt_calc_majortimeo().
>
> UBSAN: shift-out-of-bounds in net/sunrpc/xprt.c:658:14
> shift exponent 536871232 is too large for 64-bit type 'long u
>
> Reported-by: syzbot+ba2e91df8f74809417fa@syzkaller.appspotmail.com
> Signed-off-by: Kurt Manucredo <fuzzybritches0@gmail.com>
> ---
> net/sunrpc/xprt.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
> index 691ccf8049a4..07128ac3d51d 100644
> --- a/net/sunrpc/xprt.c
> +++ b/net/sunrpc/xprt.c
> @@ -655,7 +655,10 @@ static unsigned long xprt_calc_majortimeo(struct
> rpc_rqst *req)
> unsigned long majortimeo = req->rq_timeout;
>
> if (to->to_exponential)
> - majortimeo <<= to->to_retries;
> + if (to->to_retries >= sizeof(majortimeo) * 8)
> + majortimeo = to->to_maxval;
> + else
> + majortimeo <<= to->to_retries;
> else
> majortimeo += to->to_increment * to->to_retries;
> if (majortimeo > to->to_maxval || majortimeo == 0)
I've already stated on the mailing list that I'm not accepting any
changes to xprt_calc_majortimeo() for this problem. There is a fix to
the NFS mount code that addresses this bounds issue, and that commit is
already being tested in linux-next.
--
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com
prev parent reply other threads:[~2021-04-19 16:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-19 16:36 Kurt Manucredo
2021-04-19 16:58 ` Trond Myklebust [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=5850f8a65c59436b607c9d1ac088402d14873577.camel@hammerspace.com \
--to=trondmy@hammerspace.com \
--cc=anna.schumaker@netapp.com \
--cc=bfields@fieldses.org \
--cc=chuck.lever@oracle.com \
--cc=davem@davemloft.net \
--cc=fuzzybritches0@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=kuba@kernel.org \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=syzbot+ba2e91df8f74809417fa@syzkaller.appspotmail.com \
/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
all inboxes | Powered by JetHome®