[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-stable] [Qemu-block] [PATCH] scsi-generic: prevent guest from
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-stable] [Qemu-block] [PATCH] scsi-generic: prevent guest from exceeding SG_IO limits |
Date: |
Thu, 18 Apr 2019 11:48:21 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 |
On 17/04/19 14:30, Stefan Hajnoczi wrote:
> On Wed, Apr 17, 2019 at 12:54 PM Paolo Bonzini <address@hidden> 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: address@hidden
>> Cc: address@hidden
>> Cc: Stefan Hajnoczi <address@hidden>
>> Signed-off-by: Paolo Bonzini <address@hidden>
>> ---
>> hw/scsi/scsi-generic.c | 17 +++++++++++++----
>> 1 file changed, 13 insertions(+), 4 deletions(-)
>
> Reviewed-by: Stefan Hajnoczi <address@hidden>
>
This is acually only an issue with kernels prior to 4.5, so it should be
fixed downstream instead.
Paolo