On Wed, Jun 19, 2024 at 5:45 PM Ilya Leoshkevich <i...@linux.ibm.com> wrote: > > Avoid false KMSAN negatives with SLUB_DEBUG by allowing > kmsan_slab_free() to poison the freed memory, and by preventing > init_object() from unpoisoning new allocations by using __memset(). > > There are two alternatives to this approach. First, init_object() > can be marked with __no_sanitize_memory. This annotation should be used > with great care, because it drops all instrumentation from the > function, and any shadow writes will be lost. Even though this is not a > concern with the current init_object() implementation, this may change > in the future. > > Second, kmsan_poison_memory() calls may be added after memset() calls. > The downside is that init_object() is called from > free_debug_processing(), in which case poisoning will erase the > distinction between simply uninitialized memory and UAF. > > Signed-off-by: Ilya Leoshkevich <i...@linux.ibm.com> Reviewed-by: Alexander Potapenko <gli...@google.com>
- [PATCH v5 00/37] kmsan: Enable on s390 Ilya Leoshkevich
- [PATCH v5 08/37] kmsan: Remove an x86-specific #i... Ilya Leoshkevich
- [PATCH v5 11/37] kmsan: Allow disabling KMSAN che... Ilya Leoshkevich
- [PATCH v5 03/37] kmsan: Disable KMSAN when DEFERR... Ilya Leoshkevich
- [PATCH v5 24/37] s390/checksum: Add a KMSAN check Ilya Leoshkevich
- [PATCH v5 21/37] s390/boot: Turn off KMSAN Ilya Leoshkevich
- [PATCH v5 10/37] kmsan: Export panic_on_kmsan Ilya Leoshkevich
- [PATCH v5 07/37] kmsan: Remove a useless assignme... Ilya Leoshkevich
- [PATCH v5 13/37] kmsan: Support SLAB_POISON Ilya Leoshkevich
- Re: [PATCH v5 13/37] kmsan: Support SLAB_POIS... Alexander Potapenko
- [PATCH v5 25/37] s390/cpacf: Unpoison the results... Ilya Leoshkevich
- [PATCH v5 12/37] kmsan: Introduce memset_no_sanit... Ilya Leoshkevich
- Re: [PATCH v5 12/37] kmsan: Introduce memset_... Alexander Potapenko
- [PATCH v5 06/37] kmsan: Fix kmsan_copy_to_user() ... Ilya Leoshkevich
- [PATCH v5 02/37] kmsan: Make the tests compatible... Ilya Leoshkevich
- [PATCH v5 31/37] s390/string: Add KMSAN support Ilya Leoshkevich
- [PATCH v5 26/37] s390/cpumf: Unpoison STCCTM outp... Ilya Leoshkevich
- [PATCH v5 17/37] mm: slub: Disable KMSAN when che... Ilya Leoshkevich
- Re: [PATCH v5 17/37] mm: slub: Disable KMSAN ... Alexander Potapenko
- [PATCH v5 37/37] kmsan: Enable on s390 Ilya Leoshkevich