Archive-only list for patches
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: iommu@lists.linux.dev, Joerg Roedel <joro@8bytes.org>,
	Will Deacon <will@kernel.org>
Cc: Joao Martins <joao.m.martins@oracle.com>,
	Kevin Tian <kevin.tian@intel.com>, Matt Ochs <mochs@nvidia.com>,
	patches@lists.linux.dev
Subject: Re: [PATCH] iommufd/selftest: Fix buffer read overrrun in the dirty test
Date: Tue, 27 Aug 2024 09:47:32 -0300	[thread overview]
Message-ID: <20240827124732.GO3468552@ziepe.ca> (raw)
In-Reply-To: <0-v1-113e8d9e7861+5ae-iommufd_kasan_jgg@nvidia.com>

On Thu, Aug 22, 2024 at 11:47:09AM -0300, Jason Gunthorpe wrote:
> test_bit() is used to read the memory storing the bitmap, however
> test_bit() always uses a unsigned long 8 byte access.
> 
> If the bitmap is not an aligned size of 64 bits this will now trigger a
> KASAN warning reading past the end of the buffer.
> 
> Properly round the buffer allocation to an unsigned long size. Continue to
> copy_from_user() using a byte granularity.
> 
> Fixes: 9560393b830b ("iommufd/selftest: Fix iommufd_test_dirty() to handle <u8 bitmaps")
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
> ---
>  drivers/iommu/iommufd/selftest.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)

Applied to for-next

Jason

      parent reply	other threads:[~2024-08-27 12:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-22 14:47 [PATCH] iommufd/selftest: Fix buffer read overrrun in the dirty test Jason Gunthorpe
2024-08-22 16:52 ` Joao Martins
2024-08-22 16:59   ` Jason Gunthorpe
2024-08-22 17:03     ` Joao Martins
2024-08-22 17:06       ` Jason Gunthorpe
2024-08-26  6:10 ` Tian, Kevin
2024-08-27 12:47 ` 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=20240827124732.GO3468552@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=iommu@lists.linux.dev \
    --cc=joao.m.martins@oracle.com \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=mochs@nvidia.com \
    --cc=patches@lists.linux.dev \
    --cc=will@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