Re: [PATCH v2] mm: kfence: Improve the performance of __kfence_alloc() and __kfence_free()

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

 



> >
> >         /* Apply to left of object. */
> > -       for (addr = pageaddr; addr < meta->addr; addr++) {
> > -               if (!fn((u8 *)addr))
> > +       for (; meta->addr - addr >= sizeof(u64); addr += sizeof(u64)) {
> > +               if (unlikely(*((u64 *)addr) != KFENCE_CANARY_PATTERN_U64))
> >                         break;
> >         }
> I am confused. Right now this loop either runs from pageaddr to
> meta_addr if there's no corruption, or breaks at the first corrupted
> byte.
> Regardless of that, we are applying check_canary_byte() to every byte
> of that range in the following loop.
> Shouldn't the two be nested, like in the case of the canary bytes to
> the right of the object?
>
Please disregard my comment. This loop is fine, it just speeds up
finding the first corrupted byte.




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux