qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PULL 08/16] linux-user: don't use MAP_FIXED in pgd_find_hole_fallba


From: Peter Maydell
Subject: Re: [PULL 08/16] linux-user: don't use MAP_FIXED in pgd_find_hole_fallback
Date: Tue, 28 Jul 2020 17:18:55 +0100

On Tue, 28 Jul 2020 at 17:04, Alex Bennée <alex.bennee@linaro.org> wrote:
> Peter Maydell <peter.maydell@linaro.org> writes:
> > Hi; Coverity thinks this conditional expression is suspicious
> > (CID 1431059):
> >
> >>              if (mmap_start != MAP_FAILED) {
> >>                  munmap((void *) align_start, guest_size);
> >> -                return (uintptr_t) mmap_start + offset;
> >> +                if (MAP_FIXED_NOREPLACE || mmap_start == (void *) 
> >> align_start) {
> >
> > because it's performing a logical OR operation where the left
> > operand is an integer constant that's neither 0 nor 1
> > (it's 1048576). What was this intended to be?
>
> It's 0 if the header doesn't provide it. If it's !0 we don't need to
> check the address because it should have been in the correct place.

OK. "if (MAP_FIXED_NOREPLACE != 0 || ...)" will probably satisfy
Coverity then.

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]