diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-07-05 11:43:47 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-07-05 11:43:47 -0700 |
commit | 2cc7b4ca7d01a844651d34b79ff8d778c7e9a875 (patch) | |
tree | 5bd92864d02c4d4b6edb02a313fbeb3d1217a58b /fs/pstore/pmsg.c | |
parent | e24dd9ee5399747b71c1d982a484fc7601795f31 (diff) | |
parent | 0752e4028c003fba1e2b44c4b3cf6a4482e931b6 (diff) | |
download | talos-op-linux-2cc7b4ca7d01a844651d34b79ff8d778c7e9a875.tar.gz talos-op-linux-2cc7b4ca7d01a844651d34b79ff8d778c7e9a875.zip |
Merge tag 'pstore-v4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
Pull pstore updates from Kees Cook:
"Various fixes and tweaks for the pstore subsystem.
Highlights:
- use memdup_user() instead of open-coded copies (Geliang Tang)
- fix record memory leak during initialization (Douglas Anderson)
- avoid confused compressed record warning (Ankit Kumar)
- prepopulate record timestamp and remove redundant logic from
backends"
* tag 'pstore-v4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
powerpc/nvram: use memdup_user
pstore: use memdup_user
pstore: Fix format string to use %u for record id
pstore: Populate pstore record->time field
pstore: Create common record initializer
efi-pstore: Refactor erase routine
pstore: Avoid potential infinite loop
pstore: Fix leaked pstore_record in pstore_get_backend_records()
pstore: Don't warn if data is uncompressed and type is not PSTORE_TYPE_DMESG
Diffstat (limited to 'fs/pstore/pmsg.c')
-rw-r--r-- | fs/pstore/pmsg.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/pstore/pmsg.c b/fs/pstore/pmsg.c index 209755e0d7c8..24db02de1787 100644 --- a/fs/pstore/pmsg.c +++ b/fs/pstore/pmsg.c @@ -22,16 +22,16 @@ static DEFINE_MUTEX(pmsg_lock); static ssize_t write_pmsg(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { - struct pstore_record record = { - .type = PSTORE_TYPE_PMSG, - .size = count, - .psi = psinfo, - }; + struct pstore_record record; int ret; if (!count) return 0; + pstore_record_init(&record, psinfo); + record.type = PSTORE_TYPE_PMSG; + record.size = count; + /* check outside lock, page in any data. write_user also checks */ if (!access_ok(VERIFY_READ, buf, count)) return -EFAULT; |