Thread (2 messages) 2 messages, 2 authors, 2025-06-09

Re: [PATCH] vhost-scsi: Fix check for inline_sg_cnt exceeding preallocated limit

From: Stefan Hajnoczi <stefanha@redhat.com>
Date: 2025-06-09 13:49:26
Also in: kvm, lkml, virtualization

On Sat, Jun 07, 2025 at 12:40:29PM -0700, Alok Tiwari wrote:
The condition comparing ret to VHOST_SCSI_PREALLOC_SGLS was incorrect,
as ret holds the result of kstrtouint() (typically 0 on success),
not the parsed value. Update the check to use cnt, which contains the
actual user-provided value.

prevents silently accepting values exceeding the maximum inline_sg_cnt.

Fixes: bca939d5bcd0 ("vhost-scsi: Dynamically allocate scatterlists")
Signed-off-by: Alok Tiwari <redacted>
---
 drivers/vhost/scsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help