summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorNorbert Manthey2019-07-05 15:06:00 +0200
committerKees Cook2019-07-09 06:04:42 +0200
commit4c6d80e1144bdf48cae6b602ae30d41f3e5c76a9 (patch)
tree5bfffd85fa86428abcd5d529f5f38f79a0c43dfd /security
parentpstore: no need to check return value of debugfs_create functions (diff)
downloadkernel-qcow2-linux-4c6d80e1144bdf48cae6b602ae30d41f3e5c76a9.tar.gz
kernel-qcow2-linux-4c6d80e1144bdf48cae6b602ae30d41f3e5c76a9.tar.xz
kernel-qcow2-linux-4c6d80e1144bdf48cae6b602ae30d41f3e5c76a9.zip
pstore: Fix double-free in pstore_mkfile() failure path
The pstore_mkfile() function is passed a pointer to a struct pstore_record. On success it consumes this 'record' pointer and references it from the created inode. On failure, however, it may or may not free the record. There are even two different code paths which return -ENOMEM -- one of which does and the other doesn't free the record. Make the behaviour deterministic by never consuming and freeing the record when returning failure, allowing the caller to do the cleanup consistently. Signed-off-by: Norbert Manthey <nmanthey@amazon.de> Link: https://lore.kernel.org/r/1562331960-26198-1-git-send-email-nmanthey@amazon.de Fixes: 83f70f0769ddd ("pstore: Do not duplicate record metadata") Fixes: 1dfff7dd67d1a ("pstore: Pass record contents instead of copying") Cc: stable@vger.kernel.org [kees: also move "private" allocation location, rename inode cleanup label] Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'security')
0 files changed, 0 insertions, 0 deletions