linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: coverity-bot <keescook@chromium.org>
To: Kent Overstreet <kent.overstreet@linux.dev>
Cc: linux-bcachefs@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Darrick J. Wong" <djwong@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Brian Foster <bfoster@redhat.com>,
	"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	linux-next@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Coverity: darray_vprintf(): API usage errors
Date: Tue, 13 Feb 2024 16:03:37 -0800	[thread overview]
Message-ID: <202402131603.E953E2CF@keescook> (raw)

Hello!

This is an experimental semi-automated report about issues detected by
Coverity from a scan of next-20240213 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:

  Mon Feb 12 13:55:16 2024 -0500
    ead021e0fe5b ("thread_with_file: Lift from bcachefs")

Coverity reported the following:

*** CID 1583634:  API usage errors  (VARARGS)
lib/thread_with_file.c:123 in darray_vprintf()
117     		va_copy(args2, args);
118
119     		len = vsnprintf(out->data + out->nr, darray_room(*out), fmt, args2);
120     	} while (len + 1 > darray_room(*out) && !darray_make_room_gfp(out, len + 1, gfp));
121
122     	out->nr += min(len, darray_room(*out));
vvv     CID 1583634:  API usage errors  (VARARGS)
vvv     "va_end" was not called for "args2".
123     }
124
125     void stdio_redirect_vprintf(struct stdio_redirect *stdio, bool nonblocking,
126     			    const char *fmt, va_list args)
127     {
128     	struct stdio_buf *buf = &stdio->output;

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: 1583634 ("API usage errors")
Fixes: ead021e0fe5b ("thread_with_file: Lift from bcachefs")

Thanks for your attention!

-- 
Coverity-bot

                 reply	other threads:[~2024-02-14  0:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202402131603.E953E2CF@keescook \
    --to=keescook@chromium.org \
    --cc=akpm@linux-foundation.org \
    --cc=bfoster@redhat.com \
    --cc=djwong@kernel.org \
    --cc=gustavo@embeddedor.com \
    --cc=kent.overstreet@linux.dev \
    --cc=linux-bcachefs@vger.kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@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).