Patch "crypto: hisilicon: Wipe entire pool on error" has been added to the 5.10-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

    crypto: hisilicon: Wipe entire pool on error

to the 5.10-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:
     crypto-hisilicon-wipe-entire-pool-on-error.patch
and it can be found in the queue-5.10 subdirectory.

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



commit 404867695a72ed4f6978604fa8cb1bf9529f3520
Author: Kees Cook <keescook@xxxxxxxxxxxx>
Date:   Thu Jan 5 20:19:48 2023 -0800

    crypto: hisilicon: Wipe entire pool on error
    
    [ Upstream commit aa85923a954e7704bc9d3847dabeb8540aa98d13 ]
    
    To work around a Clang __builtin_object_size bug that shows up under
    CONFIG_FORTIFY_SOURCE and UBSAN_BOUNDS, move the per-loop-iteration
    mem_block wipe into a single wipe of the entire pool structure after
    the loop.
    
    Reported-by: Nathan Chancellor <nathan@xxxxxxxxxx>
    Link: https://github.com/ClangBuiltLinux/linux/issues/1780
    Cc: Weili Qian <qianweili@xxxxxxxxxx>
    Cc: Zhou Wang <wangzhou1@xxxxxxxxxxxxx>
    Cc: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
    Cc: "David S. Miller" <davem@xxxxxxxxxxxxx>
    Cc: linux-crypto@xxxxxxxxxxxxxxx
    Signed-off-by: Kees Cook <keescook@xxxxxxxxxxxx>
    Tested-by: Nathan Chancellor <nathan@xxxxxxxxxx> # build
    Link: https://lore.kernel.org/r/20230106041945.never.831-kees@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/crypto/hisilicon/sgl.c b/drivers/crypto/hisilicon/sgl.c
index 725a739800b0a..ce77826c7fb05 100644
--- a/drivers/crypto/hisilicon/sgl.c
+++ b/drivers/crypto/hisilicon/sgl.c
@@ -113,9 +113,8 @@ struct hisi_acc_sgl_pool *hisi_acc_create_sgl_pool(struct device *dev,
 	for (j = 0; j < i; j++) {
 		dma_free_coherent(dev, block_size, block[j].sgl,
 				  block[j].sgl_dma);
-		memset(block + j, 0, sizeof(*block));
 	}
-	kfree(pool);
+	kfree_sensitive(pool);
 	return ERR_PTR(-ENOMEM);
 }
 EXPORT_SYMBOL_GPL(hisi_acc_create_sgl_pool);



[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