On 8/16/24 15:57, Philippe Mathieu-Daudé wrote:
On 15/8/24 23:32, Richard Henderson wrote:
In particular, if an image has a large bss, we can hit
EOF before reading all host_len bytes of the mapping.

Cc: [email protected]
Fixes: eb5027ac618 ("linux-user: Split out mmap_h_gt_g")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2504
Signed-off-by: Richard Henderson <[email protected]>
---
  linux-user/mmap.c | 19 +++++++++++++++----
  1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index 6418e811f6..de9ab13754 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -853,10 +853,21 @@ static abi_long mmap_h_gt_g(abi_ulong start, abi_ulong 
len,
      }
      if (misaligned_offset) {
-        /* TODO: The read could be short. */

I note there are other short reads in {linux,bsd}-user/mmap.c.

Ah, via mmap_frag.  Hmm, yes.  Worth fixing at the same time.


r~

Reply via email to