[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] load_elf: fix iterator type in glue
|
From: |
Peter Maydell |
|
Subject: |
Re: [PATCH] load_elf: fix iterator type in glue |
|
Date: |
Thu, 4 Jan 2024 11:24:40 +0000 |
On Tue, 26 Dec 2023 at 12:04, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> Hi,
>
> On 21/12/23 09:08, Anastasia Belova wrote:
> > file_size is uint32_t, so j < file_size should be
> > uint32_t too.
>
> file_size is of elf_word type, which is either uint32_t
> or uint64_t.
>
> Your explanation is not very clear... Maybe you want an unsigned type?
> In that case, does the following makes your sanitizer happier?
Since file_size is type 'elf_word', the iterator 'j' should
be the matching type. In practice nobody is loading 2GB ELF
files, so we don't really run into this, but it is a bug.
I agree with Philippe that it would be helpful if the
commit message:
* is clear about the problem it is fixing
* describes whether there are any real-world consequences
of the issue and how severe (or not) they are
thanks
-- PMM
- Re: [PATCH] load_elf: fix iterator type in glue,
Peter Maydell <=