memory: Fix addr/len for flatview_access_allowed()
flatview_access_allowed() should pass in the address offset of the memory
region, rather than the global address space. Shouldn't be a major issue
yet, since the addr is only used in an error log.
Cc: Philippe Mathieu-Daudé <philmd@linaro.org>
Fixes: 3ab6fdc91b ("softmmu/physmem: Introduce MemTxAttrs::memory field and MEMTX_ACCESS_ERROR")
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Link: https://lore.kernel.org/r/20250903142932.1038765-1-peterx@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
This commit is contained in:
parent
190d5d7fd7
commit
c75847f9eb
1 changed files with 2 additions and 2 deletions
|
|
@ -3027,7 +3027,7 @@ static MemTxResult flatview_write(FlatView *fv, hwaddr addr, MemTxAttrs attrs,
|
|||
|
||||
l = len;
|
||||
mr = flatview_translate(fv, addr, &mr_addr, &l, true, attrs);
|
||||
if (!flatview_access_allowed(mr, attrs, addr, len)) {
|
||||
if (!flatview_access_allowed(mr, attrs, mr_addr, l)) {
|
||||
return MEMTX_ACCESS_ERROR;
|
||||
}
|
||||
return flatview_write_continue(fv, addr, attrs, buf, len,
|
||||
|
|
@ -3118,7 +3118,7 @@ static MemTxResult flatview_read(FlatView *fv, hwaddr addr,
|
|||
|
||||
l = len;
|
||||
mr = flatview_translate(fv, addr, &mr_addr, &l, false, attrs);
|
||||
if (!flatview_access_allowed(mr, attrs, addr, len)) {
|
||||
if (!flatview_access_allowed(mr, attrs, mr_addr, l)) {
|
||||
return MEMTX_ACCESS_ERROR;
|
||||
}
|
||||
return flatview_read_continue(fv, addr, attrs, buf, len,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue