Skip to content
Tree: 199a02db1f
Commits on Apr 10, 2019
  1. kmsan: fix metadata_is_contiguous()

    ramosian-glider committed Apr 8, 2019
    For n-byte accesses to |addr| we used to check bytes from |addr| to
    |addr+n|, which sometimes hit unmapped memory.
    Fix this by subtracting 1 from the size.
    Also fix some compiler warnings in kmsan.c
  2. kmsan: don't enter runtime in kmsan_vmap_page_range_noflush()

    ramosian-glider committed Apr 4, 2019
    Turns out one can't flush TLBs with interrupts disabled.
  3. kmsan: support for vmap in modules region

    ramosian-glider committed Apr 4, 2019
    Let KMSAN vmap shadow and origins for
    Also, make sure page tables for vmalloc/modules metadata are properly
    synced on every page fault.
  4. [UPSTREAM] netfilter: conntrack: initialize ct->timeout

    ramosian-glider committed Mar 28, 2019
    KMSAN started reporting an error when accessing ct->timeout for the
    first time without initialization:
     BUG: KMSAN: uninit-value in __nf_ct_refresh_acct+0x1ae/0x470 net/netfilter/nf_conntrack_core.c:1765
     dump_stack+0x173/0x1d0 lib/dump_stack.c:113
     kmsan_report+0x131/0x2a0 mm/kmsan/kmsan.c:624
     __msan_warning+0x7a/0xf0 mm/kmsan/kmsan_instr.c:310
     __nf_ct_refresh_acct+0x1ae/0x470 net/netfilter/nf_conntrack_core.c:1765
     nf_ct_refresh_acct ./include/net/netfilter/nf_conntrack.h:201
     nf_conntrack_udp_packet+0xb44/0x1040 net/netfilter/nf_conntrack_proto_udp.c:122
     nf_conntrack_handle_packet net/netfilter/nf_conntrack_core.c:1605
     nf_conntrack_in+0x1250/0x26c9 net/netfilter/nf_conntrack_core.c:1696
     Uninit was created at:
     kmsan_save_stack_with_flags mm/kmsan/kmsan.c:205
     kmsan_internal_poison_shadow+0x92/0x150 mm/kmsan/kmsan.c:159
     kmsan_kmalloc+0xa9/0x130 mm/kmsan/kmsan_hooks.c:173
     kmem_cache_alloc+0x554/0xb10 mm/slub.c:2789
     __nf_conntrack_alloc+0x16f/0x690 net/netfilter/nf_conntrack_core.c:1342
     init_conntrack+0x6cb/0x2490 net/netfilter/nf_conntrack_core.c:1421
    Signed-off-by: Alexander Potapenko <>
    Fixes: cc16921 ("netfilter: conntrack: avoid same-timeout update")
    Cc: Florian Westphal <>
  5. kmsan: don't unpoison memory in dma_map_sg_attrs()

    ramosian-glider committed Mar 27, 2019
    Looks like we don't need to do that anymore.
  6. fix compilation?

    ramosian-glider committed Mar 25, 2019
  7. kmsan: drop an unnecessary call to kmsan_free_page()

    ramosian-glider committed Mar 22, 2019
    It's being already called from kmem_freepages() via __free_pages()
  8. kmsan: more casts

    ramosian-glider committed Mar 19, 2019
  9. kmsan: hide accesses to struct page fields behind macros

    ramosian-glider committed Mar 15, 2019
    This is a step towards dropping page->{shadow,origin}
  10. kmsan: uaccess.h: fix variable name conflicts

    ramosian-glider committed Mar 14, 2019
    This is a bit silly and straightforward, but we'll be throwing away this
    version of uaccess.h once Clang supports asm-goto properly.
    The problem is that nested macros declare variables with the same name,
    which results in constructs like:
      __pu_val = (signo);
      do {
        __typeof__(*((&infop->si_signo))) __pu_val;
        __pu_val = __pu_val;
      } while (0)
    , leading to false positives.
  11. kmsan: another attempt to fix vmalloc

    ramosian-glider committed Mar 13, 2019
    Turned out that metadata_is_contiguous() never checked vmalloc()-ed
    memory ranges. Moreover, kmsan_get_metadata_or_null() and
    kmsan_get_shadow_origin_ptr() used to return pointers to physical pages
    for such memory ranges, which resulted in shadow and origin being
    non-contiguous. This led to corrupted metadata in certain cases.
    The new implementation makes vmalloc area 4 times smaller, so it's now
    possible to keep shadow and origin pages in the two following quarters
    of the vmalloc area.
    The shadow and origin addresses are now calculated by simply adding
    We've implemented vmap() and ioremap() support accordingly, but this
    patch doesn't enable them, so the kernel may be broken here.
You can’t perform that action at this time.