public inbox for linux-next@vger.kernel.org
 help / color / mirror / Atom feed
From: coverity-bot <keescook@chromium.org>
To: Ondrej Mosnacek <omosnace@redhat.com>
Cc: Stephen Smalley <sds@tycho.nsa.gov>,
	Paul Moore <paul@paul-moore.com>,
	"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	linux-next@vger.kernel.org
Subject: Coverity: filename_trans_read_one(): Resource leaks
Date: Mon, 13 Apr 2020 09:17:50 -0700	[thread overview]
Message-ID: <202004130917.435ED43FDB@keescook> (raw)

Hello!

This is an experimental automated report about issues detected by Coverity
from a scan of next-20200413 as part of the linux-next weekly 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:

  Tue Feb 18 12:27:34 2020 +0100
    c3a276111ea2 ("selinux: optimize storage of filename transitions")

Coverity reported the following:

*** CID 1461665:  Resource leaks  (RESOURCE_LEAK)
/security/selinux/ss/policydb.c: 1862 in filename_trans_read_one()
1856     		return rc;
1857     	len = le32_to_cpu(buf[0]);
1858
1859     	/* path component string */
1860     	rc = str_read(&name, GFP_KERNEL, fp, len);
1861     	if (rc)
vvv     CID 1461665:  Resource leaks  (RESOURCE_LEAK)
vvv     Variable "name" going out of scope leaks the storage it points to.
1862     		return rc;
1863
1864     	rc = next_entry(buf, fp, sizeof(u32) * 4);
1865     	if (rc)
1866     		goto out;
1867

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: 1461665 ("Resource leaks")
Fixes: c3a276111ea2 ("selinux: optimize storage of filename transitions")

Thanks for your attention!

-- 
Coverity-bot

             reply	other threads:[~2020-04-13 16:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-13 16:17 coverity-bot [this message]
2020-04-13 17:48 ` Coverity: filename_trans_read_one(): Resource leaks Ondrej Mosnacek

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=202004130917.435ED43FDB@keescook \
    --to=keescook@chromium.org \
    --cc=gustavo@embeddedor.com \
    --cc=linux-next@vger.kernel.org \
    --cc=omosnace@redhat.com \
    --cc=paul@paul-moore.com \
    --cc=sds@tycho.nsa.gov \
    /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