diff options
| author | Takumi Hara <[email protected]> | 2026-03-19 22:22:32 +0900 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2026-05-11 19:42:38 +0530 |
| commit | 9595829a336793744f56b978b2651350d0a1723b (patch) | |
| tree | 1bdcf69b69f986b985e3d5342e9f216498fcb354 /scripts | |
| parent | d9637d00bf47a3cc17306fc62e71652c8a83c289 (diff) | |
lib: sbi_domain: reject overflowing address range in check_addr_range()
sbi_domain_check_addr_range() computes `max = addr + size` without
checking for integer overflow. When a caller passes a size large enough
to wrap around (e.g. addr=0x80000000, size=0xFFFFFFFF80000000), max
becomes less than addr, causing the while(addr < max) validation loop
to be skipped entirely. The function then returns true without
performing any permission checks.
This allows an S-mode caller to bypass domain memory protection and
access M-mode memory through SBI extensions that use address range
validation (e.g. DBCN console write/read).
Add an overflow check after computing max: if size is non-zero and
max wrapped to a value <= addr, reject the request.
Signed-off-by: Takumi Hara <[email protected]>
Reviewed-by: Rahul Pathak <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Anup Patel <[email protected]>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions
