1
0
Fork 0
Fork of alistair23 Linux kernel for reMarkable from https://github.com/alistair23/linux
 
 
 
 
 
 
Go to file
Waiman Long 0b11ec4ae5 mm: add kvfree_sensitive() for freeing sensitive data objects
[ Upstream commit d4eaa28378 ]

For kvmalloc'ed data object that contains sensitive information like
cryptographic keys, we need to make sure that the buffer is always cleared
before freeing it.  Using memset() alone for buffer clearing may not
provide certainty as the compiler may compile it away.  To be sure, the
special memzero_explicit() has to be used.

This patch introduces a new kvfree_sensitive() for freeing those sensitive
data objects allocated by kvmalloc().  The relevant places where
kvfree_sensitive() can be used are modified to use it.

Fixes: 4f0882491a ("KEYS: Avoid false positive ENOMEM error on key read")
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Waiman Long <longman@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Acked-by: David Howells <dhowells@redhat.com>
Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Cc: James Morris <jmorris@namei.org>
Cc: "Serge E. Hallyn" <serge@hallyn.com>
Cc: Joe Perches <joe@perches.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Uladzislau Rezki <urezki@gmail.com>
Link: http://lkml.kernel.org/r/20200407200318.11711-1-longman@redhat.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-17 16:40:23 +02:00
Documentation x86/speculation: Add Ivy Bridge to affected list 2020-06-10 20:24:58 +02:00
LICENSES
arch KVM: x86: only do L1TF workaround on affected processors 2020-06-17 16:40:23 +02:00
block Revert "block: end bio with BLK_STS_AGAIN in case of non-mq devs and REQ_NOWAIT" 2020-06-03 08:21:27 +02:00
certs
crypto gcc-10: avoid shadowing standard library 'free()' in crypto 2020-05-20 08:20:29 +02:00
drivers PCI/PM: Adjust pcie_wait_for_link_delay() for caller delay 2020-06-17 16:40:23 +02:00
fs gfs2: Even more gfs2_find_jhead fixes 2020-06-17 16:40:21 +02:00
include mm: add kvfree_sensitive() for freeing sensitive data objects 2020-06-17 16:40:23 +02:00
init x86: Fix early boot crash on gcc-10, third try 2020-05-20 08:20:34 +02:00
ipc ipc/util.c: sysvipc_find_ipc() incorrectly updates position index 2020-05-20 08:20:16 +02:00
kernel padata: add separate cpuhp node for CPUHP_PADATA_DEAD 2020-06-17 16:40:22 +02:00
lib vsprintf: don't obfuscate NULL and error pointers 2020-05-27 17:46:43 +02:00
mm mm: add kvfree_sensitive() for freeing sensitive data objects 2020-06-17 16:40:23 +02:00
net bridge: Avoid infinite loop when suppressing NS messages with invalid options 2020-06-17 16:40:20 +02:00
samples samples: bpf: Fix build error 2020-06-03 08:21:15 +02:00
scripts bpf: Support llvm-objcopy for vmlinux BTF 2020-06-17 16:40:20 +02:00
security mm: add kvfree_sensitive() for freeing sensitive data objects 2020-06-17 16:40:23 +02:00
sound ASoC: intel - fix the card names 2020-06-07 13:18:49 +02:00
tools perf probe: Accept the instance number of kretprobe event 2020-06-17 16:40:23 +02:00
usr initramfs: restore default compression behavior 2020-04-08 09:08:38 +02:00
virt KVM: arm: vgic: Synchronize the whole guest on GIC{D,R}_I{S,C}ACTIVER read 2020-05-20 08:20:04 +02:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile Linux 5.4.46 2020-06-10 20:24:58 +02:00
README

README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.