> Commit 333c515d1896 ("vhost-net: allow configuring extended features")
> added VHOST_SET_FEATURES_ARRAY. The ioctl reads the number of feature
> words from user space, copies the words it supports, and then reads
> every remaining word, one at a time, to check that it is zero.
> 
> That loop has no upper bound and no scheduling point. A caller can pass
> a count of U64_MAX and a pointer into a large zero-filled mapping. The
> ioctl then stays in the kernel for as long as the mapping is readable,
> and a fatal signal is not handled until it ends. On a v6.18 debug kernel
> booted with preempt=none, two such calls from a non-root user, each on a
> 4 GiB mapping, froze a 2-CPU VM for 56 s with soft lockup reports.
> 
> The check is not needed: the extra words can only hold features that
> this kernel does not know about, and they are never stored. Drop the
> loop and ignore them. A nonzero extra word is now ignored instead of
> failing with EOPNOTSUPP. Unsupported bits in the words the kernel knows
> still fail with EOPNOTSUPP.
> 
> Fixes: 333c515d1896 ("vhost-net: allow configuring extended features")
> Cc: [email protected] # v6.17+
> Suggested-by: Michael S. Tsirkin <[email protected]>
> Signed-off-by: Hengyu Liang <[email protected]>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=1

Reply via email to