Skip to contentSkip to conversation

Patch "crypto: drbg - fix freeing of resources" has been added to the 4.13-stable tree

PATCH [email protected] 1 participant 1 message Oct 2, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

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

crypto: drbg - fix freeing of resources

to the 4.13-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-drbg-fix-freeing-of-resources.patch
and it can be found in the queue-4.13 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From bd6227a150fdb56e7bb734976ef6e53a2c1cb334 Mon Sep 17 00:00:00 2001

From: Stephan Mueller <[email protected]>
Date: Thu, 14 Sep 2017 17:10:28 +0200
Subject: crypto: drbg - fix freeing of resources

From: Stephan Mueller <[email protected]>

commit bd6227a150fdb56e7bb734976ef6e53a2c1cb334 upstream.

During the change to use aligned buffers, the deallocation code path was not updated correctly. The current code tries to free the aligned buffer pointer and not the original buffer pointer as it is supposed to.

Thus, the code is updated to free the original buffer pointer and set the aligned buffer pointer that is used throughout the code to NULL.

Fixes 3cfc3b9721123 ("crypto: drbg - use aligned buffers")
CC Herbert Xu <[email protected]>
---
 crypto/drbg.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
crypto/drbg.c +4 -4
@@ -1133,10 +1133,10 @@ static inline void drbg_dealloc_state(st
 {
 	if (!drbg)
 		return;
-	kzfree(drbg->V);
-	drbg->Vbuf = NULL;
-	kzfree(drbg->C);
-	drbg->Cbuf = NULL;
+	kzfree(drbg->Vbuf);
+	drbg->V = NULL;
+	kzfree(drbg->Cbuf);
+	drbg->C = NULL;
 	kzfree(drbg->scratchpadbuf);
 	drbg->scratchpadbuf = NULL;
 	drbg->reseed_ctr = 0;

Patches currently in stable-queue which might be from [email protected] are

queue-4.13/crypto-drbg-fix-freeing-of-resources.patch queue-4.13/crypto-af_alg-remove-sgl-terminator-indicator-when-chaining.patch