From: Alex Williamson <alex@shazbot.org>
To: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Cc: jgg@ziepe.ca, yishaih@nvidia.com, skolothumtho@nvidia.com,
kevin.tian@intel.com, kvm@vger.kernel.org, qat-linux@intel.com,
Ahsan Atta <ahsan.atta@intel.com>,
alex@shazbot.org
Subject: Re: [PATCH] vfio/qat: fix f_pos race in qat_vf_resume_write()
Date: Fri, 12 Jun 2026 10:56:14 -0600 [thread overview]
Message-ID: <20260612105614.5c21afea@shazbot.org> (raw)
In-Reply-To: <20260608151317.136613-1-giovanni.cabiddu@intel.com>
On Mon, 8 Jun 2026 16:12:57 +0100
Giovanni Cabiddu <giovanni.cabiddu@intel.com> wrote:
> qat_vf_resume_write() checks filp->f_pos before taking migf->lock, but
> copies into the migration-state buffer after taking the lock and
> re-reading the shared file position.
>
> Two concurrent writers could therefore pass the bounds check with the
> old offset, then have the second writer copy after the first advanced
> f_pos, writing past the end of the migration-state buffer.
>
> Take migf->lock before doing the boundary checks.
>
> Fixes: bb208810b1ab ("vfio/qat: Add vfio_pci driver for Intel QAT SR-IOV VF devices")
> Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
> Reviewed-by: Ahsan Atta <ahsan.atta@intel.com>
> ---
> drivers/vfio/pci/qat/main.c | 18 +++++++++++-------
> 1 file changed, 11 insertions(+), 7 deletions(-)
Applied to vfio next branch for v7.2. Thanks,
Alex
prev parent reply other threads:[~2026-06-12 16:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-08 15:12 [PATCH] vfio/qat: fix f_pos race in qat_vf_resume_write() Giovanni Cabiddu
2026-06-08 15:38 ` sashiko-bot
2026-06-12 16:56 ` Alex Williamson [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=20260612105614.5c21afea@shazbot.org \
--to=alex@shazbot.org \
--cc=ahsan.atta@intel.com \
--cc=giovanni.cabiddu@intel.com \
--cc=jgg@ziepe.ca \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=qat-linux@intel.com \
--cc=skolothumtho@nvidia.com \
--cc=yishaih@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox