google / kernel-sanitizers

Linux Kernel Sanitizers, fast bug-detectors for the Linux kernel
https://google.github.io/kernel-sanitizers/
442 stars 87 forks source link

(Cosmetic) kt_shadow_clear is dead code and seems broken #212

Open kimgr opened 6 years ago

kimgr commented 6 years ago

kt_shadow_clear appears to be getting the end of the shadow region wrong:

void kt_shadow_clear(uptr_t addr, size_t size)
{
    void *shadow_beg;
    void *shadow_end;
    size_t shadow_size;

    shadow_beg = kt_shadow_get(addr);
    shadow_end = kt_shadow_get(addr);

I'm guessing it should say something like shadow_end = shadow_begin + size; or shadow_end = kt_shadow_get(addr + size); instead. But in either case it's never called, so maybe just scrap it?

dvyukov commented 6 years ago

Hi @kimgr,

I guess we need to drop it if it's unused. This code is currently on hold, we will take care of this when we revive work on KTSAN.

Thanks