Skip to content

Commit

Permalink
mm: remove kzfree() compatibility definition
Browse files Browse the repository at this point in the history
Commit 453431a ("mm, treewide: rename kzfree() to
kfree_sensitive()") renamed kzfree() to kfree_sensitive(),
but it left a compatibility definition of kzfree() to avoid
being too disruptive.

Since then a few more instances of kzfree() have slipped in.

Just get rid of them and remove the compatibility definition
once and for all.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
ebiggers authored and torvalds committed Oct 25, 2020
1 parent 0f7f635 commit 23224e4
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion drivers/staging/rtl8192e/rtllib_crypt_tkip.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ static void rtllib_tkip_deinit(void *priv)
crypto_free_shash(_priv->tx_tfm_michael);
crypto_free_shash(_priv->rx_tfm_michael);
}
kzfree(priv);
kfree_sensitive(priv);
}


Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/rtl8192e/rtllib_crypt_wep.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static void *prism2_wep_init(int keyidx)

static void prism2_wep_deinit(void *priv)
{
kzfree(priv);
kfree_sensitive(priv);
}

/* Perform WEP encryption on given skb that has at least 4 bytes of headroom
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ static void ieee80211_tkip_deinit(void *priv)
crypto_free_shash(_priv->tx_tfm_michael);
crypto_free_shash(_priv->rx_tfm_michael);
}
kzfree(priv);
kfree_sensitive(priv);
}


Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static void *prism2_wep_init(int keyidx)

static void prism2_wep_deinit(void *priv)
{
kzfree(priv);
kfree_sensitive(priv);
}

/* Perform WEP encryption on given skb that has at least 4 bytes of headroom
Expand Down
2 changes: 0 additions & 2 deletions include/linux/slab.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,6 @@ void kfree_sensitive(const void *);
size_t __ksize(const void *);
size_t ksize(const void *);

#define kzfree(x) kfree_sensitive(x) /* For backward compatibility */

#ifdef CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR
void __check_heap_object(const void *ptr, unsigned long n, struct page *page,
bool to_user);
Expand Down
4 changes: 2 additions & 2 deletions net/tipc/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ static void tipc_aead_free(struct rcu_head *rp)
kfree(head);
}
free_percpu(aead->tfm_entry);
kzfree(aead->key);
kfree_sensitive(aead->key);
kfree(aead);
}

Expand Down Expand Up @@ -2452,7 +2452,7 @@ static void tipc_crypto_work_tx(struct work_struct *work)
tipc_crypto_key_init(tx, skey, PER_NODE_KEY, false);
if (likely(rc > 0))
rc = tipc_crypto_key_distr(tx, rc, NULL);
kzfree(skey);
kfree_sensitive(skey);
}

if (unlikely(rc))
Expand Down

0 comments on commit 23224e4

Please sign in to comment.