From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: [merged] mm-slab-use-memzero_explicit-in-kzfree.patch removed from -mm tree Date: Fri, 26 Jun 2020 20:33:25 -0700 Message-ID: <20200627033325.LQpE9C2F1%akpm@linux-foundation.org> References: <20200625202807.b630829d6fa55388148bee7d@linux-foundation.org> Reply-To: linux-kernel@vger.kernel.org Return-path: Received: from mail.kernel.org ([198.145.29.99]:45094 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725913AbgF0Dd0 (ORCPT ); Fri, 26 Jun 2020 23:33:26 -0400 In-Reply-To: <20200625202807.b630829d6fa55388148bee7d@linux-foundation.org> Sender: mm-commits-owner@vger.kernel.org List-Id: mm-commits@vger.kernel.org To: dan.carpenter@oracle.com, dhowells@redhat.com, hannes@cmpxchg.org, jarkko.sakkinen@linux.intel.com, Jason@zx2c4.com, jmorris@namei.org, joe@perches.com, longman@redhat.com, mhocko@suse.com, mm-commits@vger.kernel.org, rientjes@google.com, serge@hallyn.com, stable@vger.kernel.org, willy@infradead.org The patch titled Subject: mm/slab: use memzero_explicit() in kzfree() has been removed from the -mm tree. Its filename was mm-slab-use-memzero_explicit-in-kzfree.patch This patch was dropped because it was merged into mainline or a subsystem tree ------------------------------------------------------ From: Waiman Long Subject: mm/slab: use memzero_explicit() in kzfree() The kzfree() function is normally used to clear some sensitive information, like encryption keys, in the buffer before freeing it back to the pool. Memset() is currently used for buffer clearing. However unlikely, there is still a non-zero probability that the compiler may choose to optimize away the memory clearing especially if LTO is being used in the future. To make sure that this optimization will never happen, memzero_explicit(), which is introduced in v3.18, is now used in kzfree() to future-proof it. Link: http://lkml.kernel.org/r/20200616154311.12314-2-longman@redhat.com Fixes: 3ef0e5ba4673 ("slab: introduce kzfree()") Signed-off-by: Waiman Long Acked-by: Michal Hocko Cc: David Howells Cc: Jarkko Sakkinen Cc: James Morris Cc: "Serge E. Hallyn" Cc: Joe Perches Cc: Matthew Wilcox Cc: David Rientjes Cc: Johannes Weiner Cc: Dan Carpenter Cc: "Jason A . Donenfeld" Cc: Signed-off-by: Andrew Morton --- mm/slab_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/slab_common.c~mm-slab-use-memzero_explicit-in-kzfree +++ a/mm/slab_common.c @@ -1726,7 +1726,7 @@ void kzfree(const void *p) if (unlikely(ZERO_OR_NULL_PTR(mem))) return; ks = ksize(mem); - memset(mem, 0, ks); + memzero_explicit(mem, ks); kfree(mem); } EXPORT_SYMBOL(kzfree); _ Patches currently in -mm which might be from longman@redhat.com are mm-treewide-rename-kzfree-to-kfree_sensitive.patch sched-mm-optimize-current_gfp_context.patch