Patch "ARM: 9142/1: kasan: work around LPAE build warning" has been added to the 5.14-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

    ARM: 9142/1: kasan: work around LPAE build warning

to the 5.14-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:
     arm-9142-1-kasan-work-around-lpae-build-warning.patch
and it can be found in the queue-5.14 subdirectory.

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



commit 45d78733b9fa4ae63771128537f4df0d3a1e83f3
Author: Arnd Bergmann <arnd@xxxxxxxx>
Date:   Mon Oct 18 15:30:38 2021 +0100

    ARM: 9142/1: kasan: work around LPAE build warning
    
    [ Upstream commit c2e6df3eaaf120cde5e7c3a70590dd82e427458a ]
    
    pgd_page_vaddr() returns an 'unsigned long' address, causing a warning
    with the memcpy() call in kasan_init():
    
    arch/arm/mm/kasan_init.c: In function 'kasan_init':
    include/asm-generic/pgtable-nop4d.h:44:50: error: passing argument 2 of '__memcpy' makes pointer from integer without a cast [-Werror=int-conversion]
       44 | #define pgd_page_vaddr(pgd)                     ((unsigned long)(p4d_pgtable((p4d_t){ pgd })))
          |                                                 ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          |                                                  |
          |                                                  long unsigned int
    arch/arm/include/asm/string.h:58:45: note: in definition of macro 'memcpy'
       58 | #define memcpy(dst, src, len) __memcpy(dst, src, len)
          |                                             ^~~
    arch/arm/mm/kasan_init.c:229:16: note: in expansion of macro 'pgd_page_vaddr'
      229 |                pgd_page_vaddr(*pgd_offset_k(KASAN_SHADOW_START)),
          |                ^~~~~~~~~~~~~~
    arch/arm/include/asm/string.h:21:47: note: expected 'const void *' but argument is of type 'long unsigned int'
       21 | extern void *__memcpy(void *dest, const void *src, __kernel_size_t n);
          |                                   ~~~~~~~~~~~~^~~
    
    Avoid this by adding an explicit typecast.
    
    Link: https://lore.kernel.org/all/CACRpkdb3DMvof3-xdtss0Pc6KM36pJA-iy=WhvtNVnsDpeJ24Q@xxxxxxxxxxxxxx/
    
    Fixes: 5615f69bc209 ("ARM: 9016/2: Initialize the mapping of KASan shadow memory")
    Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
    Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
    Signed-off-by: Russell King (Oracle) <rmk+kernel@xxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/arm/mm/kasan_init.c b/arch/arm/mm/kasan_init.c
index 9c348042a7244..4b1619584b23c 100644
--- a/arch/arm/mm/kasan_init.c
+++ b/arch/arm/mm/kasan_init.c
@@ -226,7 +226,7 @@ void __init kasan_init(void)
 	BUILD_BUG_ON(pgd_index(KASAN_SHADOW_START) !=
 		     pgd_index(KASAN_SHADOW_END));
 	memcpy(tmp_pmd_table,
-	       pgd_page_vaddr(*pgd_offset_k(KASAN_SHADOW_START)),
+	       (void*)pgd_page_vaddr(*pgd_offset_k(KASAN_SHADOW_START)),
 	       sizeof(tmp_pmd_table));
 	set_pgd(&tmp_pgd_table[pgd_index(KASAN_SHADOW_START)],
 		__pgd(__pa(tmp_pmd_table) | PMD_TYPE_TABLE | L_PGD_SWAPPER));



[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