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

2025-06-09 Thread Stefan Hajnoczi
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 va

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

2025-06-07 Thread Mike Christie
On 6/7/25 2:40 PM, 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 sile

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

2025-06-07 Thread Alok Tiwari
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