[PATCH] lib: sbi_domain: reject overflowing address range in check_addr_range()

Takumi Hara takumihara1226 at gmail.com
Thu Mar 26 20:48:22 PDT 2026


Thanks for the review, Rahul.

When size == 0, max == addr, so the overflow guard is skipped
(it's not an overflow), and the while(addr < max) loop is also
skipped since addr == max. The function returns true.

This is the existing behavior and is intentional -- a zero-length
range has no bytes to validate, so returning true is correct.

This patch only targets the overflow case where a non-zero size
wraps max around to <= addr, which silently skips all permission
checks on a range that actually covers memory.

Best regards,
Takumi Hara



More information about the opensbi mailing list