> Add a case to tools/virtio/vringh_test.c that builds a top-level > indirect descriptor whose NEXT points back at itself and checks that > vringh_getdesc_user() rejects it with -ELOOP. > > Without the preceding fix, the walk re-enters the same top-level > descriptor without making forward progress: count stays flat, so the > traversal limit is never reached and -ELOOP is never returned. With the > fix, the top-level count advances on each re-entry and > vringh_getdesc_user() returns -ELOOP once the traversal limit is reached. > > Use index 1 rather than 0 for the self-cycle, since returning from an > indirect table is only performed for a positive up_next value. A > self-cycle at index 0 would instead terminate the walk and would not > reproduce the bug. > > Assisted-by: Hawkeye:GLM-5.3-flash > Assisted-by: Qoder:Qwen3.8-Max > Signed-off-by: Fang Xieyan <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great! -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=2
