+ kasan-arm64-untag-address-in-_virt_addr_is_linear.patch added to -mm tree

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

 



The patch titled
     Subject: kasan, arm64: untag address in _virt_addr_is_linear
has been added to the -mm tree.  Its filename is
     kasan-arm64-untag-address-in-_virt_addr_is_linear.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/kasan-arm64-untag-address-in-_virt_addr_is_linear.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/kasan-arm64-untag-address-in-_virt_addr_is_linear.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Andrey Konovalov <andreyknvl@xxxxxxxxxx>
Subject: kasan, arm64: untag address in _virt_addr_is_linear

virt_addr_is_linear (which is used by virt_addr_valid) assumes that the
top byte of the address is 0xff, which isn't always the case with
tag-based KASAN.

This patch resets the tag in this macro.

Link: http://lkml.kernel.org/r/dd9cda296c70ca6b1839cf4de3ee3137cf5030e7.1543337629.git.andreyknvl@xxxxxxxxxx
Signed-off-by: Andrey Konovalov <andreyknvl@xxxxxxxxxx>
Reviewed-by: Andrey Ryabinin <aryabinin@xxxxxxxxxxxxx>
Reviewed-by: Dmitry Vyukov <dvyukov@xxxxxxxxxx>
Cc: Mark Rutland <mark.rutland@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---


--- a/arch/arm64/include/asm/memory.h~kasan-arm64-untag-address-in-_virt_addr_is_linear
+++ a/arch/arm64/include/asm/memory.h
@@ -322,9 +322,10 @@ static inline void *phys_to_virt(phys_ad
 #endif
 #endif
 
-#define _virt_addr_is_linear(kaddr)	(((u64)(kaddr)) >= PAGE_OFFSET)
-#define virt_addr_valid(kaddr)		(_virt_addr_is_linear(kaddr) && \
-					 _virt_addr_valid(kaddr))
+#define _virt_addr_is_linear(kaddr)	\
+	(__tag_reset((u64)(kaddr)) >= PAGE_OFFSET)
+#define virt_addr_valid(kaddr)		\
+	(_virt_addr_is_linear(kaddr) && _virt_addr_valid(kaddr))
 
 #include <asm-generic/memory_model.h>
 
_

Patches currently in -mm which might be from andreyknvl@xxxxxxxxxx are

kasan-mm-change-hooks-signatures.patch
kasan-slub-handle-pointer-tags-in-early_kmem_cache_node_alloc.patch
kasan-move-common-generic-and-tag-based-code-to-commonc.patch
kasan-rename-source-files-to-reflect-the-new-naming-scheme.patch
kasan-add-config_kasan_generic-and-config_kasan_sw_tags.patch
kasan-arm64-adjust-shadow-size-for-tag-based-mode.patch
kasan-rename-kasan_zero_page-to-kasan_early_shadow_page.patch
kasan-initialize-shadow-to-0xff-for-tag-based-mode.patch
arm64-move-untagged_addr-macro-from-uaccessh-to-memoryh.patch
kasan-add-tag-related-helper-functions.patch
kasan-arm64-untag-address-in-_virt_addr_is_linear.patch
kasan-preassign-tags-to-objects-with-ctors-or-slab_typesafe_by_rcu.patch
kasan-arm64-fix-up-fault-handling-logic.patch
kasan-arm64-enable-top-byte-ignore-for-the-kernel.patch
kasan-mm-perform-untagged-pointers-comparison-in-krealloc.patch
kasan-split-out-generic_reportc-from-reportc.patch
kasan-add-bug-reporting-routines-for-tag-based-mode.patch
mm-move-obj_to_index-to-include-linux-slab_defh.patch
kasan-add-hooks-implementation-for-tag-based-mode.patch
kasan-arm64-add-brk-handler-for-inline-instrumentation.patch
kasan-mm-arm64-tag-non-slab-memory-allocated-via-pagealloc.patch
kasan-add-__must_check-annotations-to-kasan-hooks.patch
kasan-arm64-select-have_arch_kasan_sw_tags.patch
kasan-update-documentation.patch
kasan-add-spdx-license-identifier-mark-to-source-files.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux