All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	qemu block <qemu-block@nongnu.org>,
	qemu-stable <qemu-stable@nongnu.org>
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] scsi-generic: prevent guest from exceeding SG_IO limits
Date: Thu, 18 Apr 2019 12:47:37 +0200	[thread overview]
Message-ID: <20190418104737.GC5242@linux.fritz.box> (raw)
In-Reply-To: <cf51d357-d9c0-3a20-1d23-7f6671d7948a@redhat.com>

Am 18.04.2019 um 11:48 hat Paolo Bonzini geschrieben:
> On 17/04/19 14:30, Stefan Hajnoczi wrote:
> > On Wed, Apr 17, 2019 at 12:54 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
> >> Linux places a limit of UIO_MAXIOV pages on SG_IO ioctls (and if the limit
> >> is exceeded, a confusing ENOMEM error is returned[1]).  Prevent the guest
> >> from exceeding these limits, by capping the maximum transfer length to
> >> that value in the block limits VPD page.
> >>
> >> [1] Oh well, at least it was easier to follow the kernel source knowing
> >>     it had to end as ENOMEM...
> >>
> >> Cc: qemu-stable@nongnu.org
> >> Cc: qemu-block@nongnu.org
> >> Cc: Stefan Hajnoczi <stefanha@redhat.com>
> >> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> >> ---
> >>  hw/scsi/scsi-generic.c | 17 +++++++++++++----
> >>  1 file changed, 13 insertions(+), 4 deletions(-)
> > 
> > Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> > 
> 
> This is acually only an issue with kernels prior to 4.5, so it should be
> fixed downstream instead.

I don't think that upstream QEMU has kernels > 4.5 as an official
requirement, though? We try to be compatible with quite old libs, so we
should stay compatible with old kernels, too.

Kevin

WARNING: multiple messages have this Message-ID (diff)
From: Kevin Wolf <kwolf@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>,
	qemu block <qemu-block@nongnu.org>,
	qemu-devel <qemu-devel@nongnu.org>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	qemu-stable <qemu-stable@nongnu.org>
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] scsi-generic: prevent guest from exceeding SG_IO limits
Date: Thu, 18 Apr 2019 12:47:37 +0200	[thread overview]
Message-ID: <20190418104737.GC5242@linux.fritz.box> (raw)
Message-ID: <20190418104737.iyOaLOJtU9YNhG_eHTR7D9YRmyv-bER5eLfjEcNpOmU@z> (raw)
In-Reply-To: <cf51d357-d9c0-3a20-1d23-7f6671d7948a@redhat.com>

Am 18.04.2019 um 11:48 hat Paolo Bonzini geschrieben:
> On 17/04/19 14:30, Stefan Hajnoczi wrote:
> > On Wed, Apr 17, 2019 at 12:54 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
> >> Linux places a limit of UIO_MAXIOV pages on SG_IO ioctls (and if the limit
> >> is exceeded, a confusing ENOMEM error is returned[1]).  Prevent the guest
> >> from exceeding these limits, by capping the maximum transfer length to
> >> that value in the block limits VPD page.
> >>
> >> [1] Oh well, at least it was easier to follow the kernel source knowing
> >>     it had to end as ENOMEM...
> >>
> >> Cc: qemu-stable@nongnu.org
> >> Cc: qemu-block@nongnu.org
> >> Cc: Stefan Hajnoczi <stefanha@redhat.com>
> >> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> >> ---
> >>  hw/scsi/scsi-generic.c | 17 +++++++++++++----
> >>  1 file changed, 13 insertions(+), 4 deletions(-)
> > 
> > Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> > 
> 
> This is acually only an issue with kernels prior to 4.5, so it should be
> fixed downstream instead.

I don't think that upstream QEMU has kernels > 4.5 as an official
requirement, though? We try to be compatible with quite old libs, so we
should stay compatible with old kernels, too.

Kevin


  reply	other threads:[~2019-04-18 10:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-17 11:53 [Qemu-devel] [PATCH] scsi-generic: prevent guest from exceeding SG_IO limits Paolo Bonzini
2019-04-17 11:53 ` Paolo Bonzini
2019-04-17 12:30 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2019-04-17 12:30   ` Stefan Hajnoczi
2019-04-18  9:48   ` Paolo Bonzini
2019-04-18  9:48     ` Paolo Bonzini
2019-04-18 10:47     ` Kevin Wolf [this message]
2019-04-18 10:47       ` Kevin Wolf
2019-04-18 11:01       ` Paolo Bonzini
2019-04-18 11:01         ` Paolo Bonzini
2019-04-18 11:23         ` Kevin Wolf
2019-04-18 11:23           ` Kevin Wolf
2019-04-18 11:32       ` Daniel P. Berrangé
2019-04-18 11:32         ` Daniel P. Berrangé

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=20190418104737.GC5242@linux.fritz.box \
    --to=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=stefanha@gmail.com \
    --cc=stefanha@redhat.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.