All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever III <chuck.lever@oracle.com>
To: Dai Ngo <dai.ngo@oracle.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Jeff Layton <jlayton@kernel.org>,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
	"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	Linux Next Mailing List <linux-next@vger.kernel.org>,
	"linux-hardening@vger.kernel.org"
	<linux-hardening@vger.kernel.org>,
	coverity-bot <keescook@chromium.org>
Subject: Re: Coverity: encode_cb_recallany4args(): Error handling issues
Date: Fri, 18 Nov 2022 18:01:41 +0000	[thread overview]
Message-ID: <CCDFCD7E-8844-4F13-B160-E9867B3D8AC2@oracle.com> (raw)
In-Reply-To: <202211180900.6F94436@keescook>



> On Nov 18, 2022, at 12:00 PM, coverity-bot <keescook@chromium.org> wrote:
> 
> Hello!
> 
> This is an experimental semi-automated report about issues detected by
> Coverity from a scan of next-20221118 as part of the linux-next scan project:
> https://scan.coverity.com/projects/linux-next-weekly-scan
> 
> You're getting this email because you were associated with the identified
> lines of code (noted below) that were touched by commits:
> 
>  Thu Nov 17 11:55:28 2022 -0500
>    32dce0f9611b ("NFSD: add support for sending CB_RECALL_ANY")
> 
> Coverity reported the following:
> 
> *** CID 1527365:  Error handling issues  (CHECKED_RETURN)
> fs/nfsd/nfs4callback.c:344 in encode_cb_recallany4args()
> 338      */
> 339     static void
> 340     encode_cb_recallany4args(struct xdr_stream *xdr,
> 341     	struct nfs4_cb_compound_hdr *hdr, struct nfsd4_cb_recall_any *ra)
> 342     {
> 343     	encode_nfs_cb_opnum4(xdr, OP_CB_RECALL_ANY);
> vvv     CID 1527365:  Error handling issues  (CHECKED_RETURN)
> vvv     Calling "xdr_stream_encode_u32" without checking return value (as is done elsewhere 23 out of 24 times).
> 344     	xdr_stream_encode_u32(xdr, ra->ra_keep);
> 345     	xdr_stream_encode_uint32_array(xdr, ra->ra_bmval,
> 346     				       ARRAY_SIZE(ra->ra_bmval));
> 347     	hdr->nops++;
> 348     }
> 349
> 
> If this is a false positive, please let us know so we can mark it as
> such, or teach the Coverity rules to be smarter. If not, please make
> sure fixes get into linux-next. :) For patches fixing this, please
> include these lines (but double-check the "Fixes" first):
> 
> Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
> Addresses-Coverity-ID: 1527365 ("Error handling issues")
> Fixes: 32dce0f9611b ("NFSD: add support for sending CB_RECALL_ANY")
> 
> Thanks for your attention!

My fault. I removed the WARN_ON_ONCE() wrappers, which are clutter
(though they are clutter that is already used elsewhere).

I will update linux-next with a fix.


--
Chuck Lever




      reply	other threads:[~2022-11-18 18:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-18 17:00 Coverity: encode_cb_recallany4args(): Error handling issues coverity-bot
2022-11-18 18:01 ` Chuck Lever III [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=CCDFCD7E-8844-4F13-B160-E9867B3D8AC2@oracle.com \
    --to=chuck.lever@oracle.com \
    --cc=dai.ngo@oracle.com \
    --cc=gustavo@embeddedor.com \
    --cc=jlayton@kernel.org \
    --cc=keescook@chromium.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --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.