Patch "compiler.h, kasan: Avoid duplicating __read_once_size_nocheck()" has been added to the 4.4-stable tree

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

 



This is a note to let you know that I've just added the patch titled

    compiler.h, kasan: Avoid duplicating __read_once_size_nocheck()

to the 4.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     compiler.h-kasan-avoid-duplicating-__read_once_size_nocheck.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From foo@baz Thu Oct 22 03:56:50 PM CEST 2020
From: Andrey Ryabinin <aryabinin@xxxxxxxxxxxxx>
Date: Thu, 1 Feb 2018 21:00:48 +0300
Subject: compiler.h, kasan: Avoid duplicating __read_once_size_nocheck()

From: Andrey Ryabinin <aryabinin@xxxxxxxxxxxxx>

commit bdb5ac801af3d81d36732c2f640d6a1d3df83826 upstream.

Instead of having two identical __read_once_size_nocheck() functions
with different attributes, consolidate all the difference in new macro
__no_kasan_or_inline and use it. No functional changes.

Signed-off-by: Andrey Ryabinin <aryabinin@xxxxxxxxxxxxx>
Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Ben Hutchings <ben.hutchings@xxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 include/linux/compiler.h |   14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -241,23 +241,21 @@ void __read_once_size(const volatile voi
 
 #ifdef CONFIG_KASAN
 /*
- * This function is not 'inline' because __no_sanitize_address confilcts
+ * We can't declare function 'inline' because __no_sanitize_address confilcts
  * with inlining. Attempt to inline it may cause a build failure.
  * 	https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368
  * '__maybe_unused' allows us to avoid defined-but-not-used warnings.
  */
-static __no_sanitize_address __maybe_unused
-void __read_once_size_nocheck(const volatile void *p, void *res, int size)
-{
-	__READ_ONCE_SIZE;
-}
+# define __no_kasan_or_inline __no_sanitize_address __maybe_unused
 #else
-static __always_inline
+# define __no_kasan_or_inline __always_inline
+#endif
+
+static __no_kasan_or_inline
 void __read_once_size_nocheck(const volatile void *p, void *res, int size)
 {
 	__READ_ONCE_SIZE;
 }
-#endif
 
 static __always_inline void __write_once_size(volatile void *p, void *res, int size)
 {


Patches currently in stable-queue which might be from aryabinin@xxxxxxxxxxxxx are

queue-4.4/x86-mm-ptdump-fix-soft-lockup-in-page-table-walker.patch
queue-4.4/mm-kasan-add-api-to-check-memory-regions.patch
queue-4.4/compiler.h-add-read_word_at_a_time-function.patch
queue-4.4/compiler.h-kasan-avoid-duplicating-__read_once_size_nocheck.patch
queue-4.4/mm-kasan-print-name-of-mem-caller-in-report.patch
queue-4.4/lib-strscpy-shut-up-kasan-false-positives-in-strscpy.patch



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux