All of lore.kernel.org
 help / color / mirror / Atom feed
From: coverity-bot <keescook@chromium.org>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	linux-next@vger.kernel.org
Subject: Coverity: compat_ksys_shmctl(): Uninitialized variables
Date: Wed, 22 Apr 2020 11:13:31 -0700	[thread overview]
Message-ID: <202004221111.DD985EB@keescook> (raw)

Hello!

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

  Sat Jul 8 22:52:47 2017 -0400
    553f770ef71b ("ipc: move compat shmctl to native")

Coverity reported the following:

*** CID 1492708:  Uninitialized variables  (UNINIT)
/ipc/shm.c: 1347 in compat_ksys_shmctl()
1341     	}
1342     	case SHM_INFO: {
1343     		struct shm_info shm_info;
1344     		err = shmctl_shm_info(ns, &shm_info);
1345     		if (err < 0)
1346     			return err;
vvv     CID 1492708:  Uninitialized variables  (UNINIT)
vvv     Using uninitialized value "shm_info.swap_successes" when calling "put_compat_shm_info".
1347     		if (put_compat_shm_info(&shm_info, uptr))
1348     			err = -EFAULT;
1349     		return err;
1350     	}
1351     	case IPC_STAT:
1352     	case SHM_STAT_ANY:

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):

Human edit:
This is technically a false-positive, but it's a weird one in that
everything else in the call graph checks for "err" being "!= 0", but
line 1345 checks for "< 0". Maybe this deserves a change to "if (err)"
there just for robustness?

Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Addresses-Coverity-ID: 1492708 ("Uninitialized variables")
Fixes: 553f770ef71b ("ipc: move compat shmctl to native")

Thanks for your attention!

-- 
Coverity-bot

                 reply	other threads:[~2020-04-22 18:13 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=202004221111.DD985EB@keescook \
    --to=keescook@chromium.org \
    --cc=gustavo@embeddedor.com \
    --cc=linux-next@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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.