All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: coverity-bot <keescook@chromium.org>
Cc: Nicolin Chen <nicolinc@nvidia.com>,
	"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	linux-next@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: Coverity: iommufd_vfio_iommu_get_info(): Code maintainability issues
Date: Wed, 2 Nov 2022 17:06:00 -0300	[thread overview]
Message-ID: <Y2LNqO2jpDGw41oM@nvidia.com> (raw)
In-Reply-To: <202211021255.505A44F5@keescook>

On Wed, Nov 02, 2022 at 12:55:21PM -0700, coverity-bot wrote:

> /drivers/iommu/iommufd/vfio_compat.c: 411 in iommufd_vfio_iommu_get_info()
> 405     	 */
> 406     	if (info.argsz >= total_cap_size)
> 407     		info.cap_offset = sizeof(info);
> 408     	info.argsz = total_cap_size;
> 409     	info.flags |= VFIO_IOMMU_INFO_CAPS;
> 410     	if (copy_to_user(arg, &info, minsz))
> vvv     CID 1527093:  Code maintainability issues  (UNUSED_VALUE)
> vvv     Assigning value "-14" to "rc" here, but that stored value is overwritten before it can be used.
> 411     		rc = -EFAULT;
> 412     	rc = 0;
> 413
> 414     out_put:
> 415     	up_read(&ioas->iopt.iova_rwsem);
> 416     	iommufd_put_object(&ioas->obj);
> 
> 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):

Yes, this is legit, we already fixed it

Thanks,
Jason

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

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-02 19:55 Coverity: iommufd_vfio_iommu_get_info(): Code maintainability issues coverity-bot
2022-11-02 20:06 ` Jason Gunthorpe [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=Y2LNqO2jpDGw41oM@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=gustavo@embeddedor.com \
    --cc=keescook@chromium.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=nicolinc@nvidia.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 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.