On Wed, Jun 19, 2024 at 5:45 PM Ilya Leoshkevich <i...@linux.ibm.com> wrote: > > Even though the KMSAN warnings generated by memchr_inv() are suppressed > by metadata_access_enable(), its return value may still be poisoned. > > The reason is that the last iteration of memchr_inv() returns > `*start != value ? start : NULL`, where *start is poisoned. Because of > this, somewhat counterintuitively, the shadow value computed by > visitSelectInst() is equal to `(uintptr_t)start`. > > One possibility to fix this, since the intention behind guarding > memchr_inv() behind metadata_access_enable() is to touch poisoned > metadata without triggering KMSAN, is to unpoison its return value. > However, this approach is too fragile. So simply disable the KMSAN > checks in the respective functions. > > Signed-off-by: Ilya Leoshkevich <i...@linux.ibm.com> Reviewed-by: Alexander Potapenko <gli...@google.com>
- [PATCH v5 07/37] kmsan: Remove a useless assignment fr... Ilya Leoshkevich
- [PATCH v5 13/37] kmsan: Support SLAB_POISON Ilya Leoshkevich
- [PATCH v5 25/37] s390/cpacf: Unpoison the results of c... Ilya Leoshkevich
- [PATCH v5 12/37] kmsan: Introduce memset_no_sanitize_m... Ilya Leoshkevich
- Re: [PATCH v5 12/37] kmsan: Introduce memset_no_s... Alexander Potapenko
- [PATCH v5 06/37] kmsan: Fix kmsan_copy_to_user() on ar... Ilya Leoshkevich
- [PATCH v5 02/37] kmsan: Make the tests compatible with... Ilya Leoshkevich
- [PATCH v5 31/37] s390/string: Add KMSAN support Ilya Leoshkevich
- [PATCH v5 26/37] s390/cpumf: Unpoison STCCTM output bu... Ilya Leoshkevich
- [PATCH v5 17/37] mm: slub: Disable KMSAN when checking... Ilya Leoshkevich
- Re: [PATCH v5 17/37] mm: slub: Disable KMSAN when... Alexander Potapenko
- [PATCH v5 37/37] kmsan: Enable on s390 Ilya Leoshkevich
- [PATCH v5 36/37] s390/kmsan: Implement the architectur... Ilya Leoshkevich
- Re: [PATCH v5 36/37] s390/kmsan: Implement the ar... Alexander Gordeev
- Re: [PATCH v5 36/37] s390/kmsan: Implement th... Ilya Leoshkevich
- Re: [PATCH v5 36/37] s390/kmsan: Implemen... Alexander Potapenko
- Re: [PATCH v5 36/37] s390/kmsan: Impl... Alexander Potapenko
- Re: [PATCH v5 36/37] s390/kmsan: Implement the ar... Alexander Gordeev
- [PATCH v5 28/37] s390/ftrace: Unpoison ftrace_regs in ... Ilya Leoshkevich
- [PATCH v5 01/37] ftrace: Unpoison ftrace_regs in ftrac... Ilya Leoshkevich
- [PATCH v5 30/37] s390/mm: Define KMSAN metadata for vm... Ilya Leoshkevich