- 08 3月, 2017 10 次提交
-
-
由 Kees Cook 提交于
Currently, pstore_mkfile() performs a memcpy() of the record contents, so it can live anywhere. However, this is needlessly wasteful. In preparation of pstore_mkfile() keeping the record contents, always allocate a buffer for the contents. Signed-off-by: NKees Cook <keescook@chromium.org>
-
由 Kees Cook 提交于
Similar to the pstore_info read() callback, there were too many arguments. This switches to the new struct pstore_record pointer instead. This adds "reason" and "part" to the record structure as well. Signed-off-by: NKees Cook <keescook@chromium.org>
-
由 Kees Cook 提交于
The argument list for the pstore_read() interface is unwieldy. This changes passes the new struct pstore_record instead. The erst backend was already doing something similar internally. Signed-off-by: NKees Cook <keescook@chromium.org>
-
由 Kees Cook 提交于
Instead of the long list of arguments, just pass the new record struct. Signed-off-by: NKees Cook <keescook@chromium.org>
-
由 Kees Cook 提交于
This moves the record decompression logic out to a separate function to avoid the deep indentation. Signed-off-by: NKees Cook <keescook@chromium.org>
-
由 Kees Cook 提交于
The read/mkfile pair pass the same arguments and should be cleared between calls. Move to a structure and wipe it after every loop. Signed-off-by: NKees Cook <keescook@chromium.org>
-
由 Kees Cook 提交于
Uncommon errors are better to get reported to dmesg so developers can more easily figure out why pstore is unhappy with a backend attempting to register. Signed-off-by: NKees Cook <keescook@chromium.org>
-
由 Kees Cook 提交于
Technically, it might be possible for struct pstore_info to go out of scope after the module_put(), so report the backend name first. Signed-off-by: NKees Cook <keescook@chromium.org>
-
由 Kees Cook 提交于
When built as a module and running with update_ms >= 0, pstore will Oops during module unload since the work timer is still running. This makes sure the worker is stopped before unloading. Signed-off-by: NKees Cook <keescook@chromium.org> Cc: stable@vger.kernel.org
-
由 Bhumika Goyal 提交于
The references of pstore_zbackend structures are stored into the pointer zbackend of type struct pstore_zbackend. The pointer zbackend can be made const as it is only dereferenced. After making this change the pstore_zbackend structures whose references are stored into the pointer zbackend can be made const too. File size before: text data bss dec hex filename 4817 541 172 5530 159a fs/pstore/platform.o File size after: text data bss dec hex filename 4865 477 172 5514 158a fs/pstore/platform.o Signed-off-by: NBhumika Goyal <bhumirks@gmail.com> Signed-off-by: NKees Cook <keescook@chromium.org>
-
- 25 2月, 2017 1 次提交
-
-
由 Sven Schmidt 提交于
Update fs/pstore and fs/squashfs to use the updated functions from the new LZ4 module. Link: http://lkml.kernel.org/r/1486321748-19085-5-git-send-email-4sschmid@informatik.uni-hamburg.deSigned-off-by: NSven Schmidt <4sschmid@informatik.uni-hamburg.de> Cc: Bongkyu Kim <bongkyu.kim@lge.com> Cc: Rui Salvaterra <rsalvaterra@gmail.com> Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Herbert Xu <herbert@gondor.apana.org.au> Cc: David S. Miller <davem@davemloft.net> Cc: Anton Vorontsov <anton@enomsg.org> Cc: Colin Cross <ccross@android.com> Cc: Kees Cook <keescook@chromium.org> Cc: Tony Luck <tony.luck@intel.com> Signed-off-by: NAndrew Morton <akpm@linux-foundation.org> Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
-
- 16 11月, 2016 1 次提交
-
-
由 Namhyung Kim 提交于
Maybe I'm missing something, but I don't know why it needs to copy the input buffer to psinfo->buf and then write. Instead we can write the input buffer directly. The only implementation that supports console message (i.e. ramoops) already does it for ftrace messages. For the upcoming virtio backend driver, it needs to protect psinfo->buf overwritten from console messages. If it could use ->write_buf method instead of ->write, the problem will be solved easily. Cc: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: NNamhyung Kim <namhyung@kernel.org> Signed-off-by: NKees Cook <keescook@chromium.org>
-
- 09 11月, 2016 1 次提交
-
-
由 Li Pengcheng 提交于
Without a return after the pr_err(), dumps will collide when two threads call pstore_dump() at the same time. Signed-off-by: NLiu Hailong <liuhailong5@huawei.com> Signed-off-by: NLi Pengcheng <lipengcheng8@huawei.com> Signed-off-by: NLi Zhong <lizhong11@hisilicon.com> [kees: improved commit message] Signed-off-by: NKees Cook <keescook@chromium.org>
-
- 09 9月, 2016 2 次提交
-
-
由 Mark Salyzyn 提交于
Removing a bounce buffer copy operation in the pmsg driver path is always better. We also gain in overall performance by not requesting a vmalloc on every write as this can cause precious RT tasks, such as user facing media operation, to stall while memory is being reclaimed. Added a write_buf_user to the pstore functions, a backup platform write_buf_user that uses the small buffer that is part of the instance, and implemented a ramoops write_buf_user that only supports PSTORE_TYPE_PMSG. Signed-off-by: NMark Salyzyn <salyzyn@android.com> Signed-off-by: NKees Cook <keescook@chromium.org>
-
由 Namhyung Kim 提交于
This patch adds new PSTORE_FLAGS for each pstore type so that they can be enabled separately. This is a preparation for ongoing virtio-pstore work to support those types flexibly. The PSTORE_FLAGS_FRAGILE is changed to PSTORE_FLAGS_DMESG to preserve the original behavior. Cc: Anton Vorontsov <anton@enomsg.org> Cc: Colin Cross <ccross@android.com> Cc: Kees Cook <keescook@chromium.org> Cc: Tony Luck <tony.luck@intel.com> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net> Cc: Len Brown <lenb@kernel.org> Cc: Matt Fleming <matt@codeblueprint.co.uk> Cc: linux-acpi@vger.kernel.org Cc: linux-efi@vger.kernel.org Signed-off-by: NNamhyung Kim <namhyung@kernel.org> [kees: retained "FRAGILE" for now to make merges easier] Signed-off-by: NKees Cook <keescook@chromium.org>
-
- 03 6月, 2016 1 次提交
-
-
由 Geliang Tang 提交于
Like zlib compression in pstore, this patch added lzo and lz4 compression support so that users can have more options and better compression ratio. The original code treats the compressed data together with the uncompressed ECC correction notice by using zlib decompress. The ECC correction notice is missing in the decompression process. The treatment also makes lzo and lz4 not working. So I treat them separately by using pstore_decompress() to treat the compressed data, and memcpy() to treat the uncompressed ECC correction notice. Signed-off-by: NGeliang Tang <geliangtang@163.com> Signed-off-by: NKees Cook <keescook@chromium.org>
-
- 01 6月, 2016 3 次提交
-
-
由 Namhyung Kim 提交于
The code is duplicate between compression is enabled or not. Signed-off-by: NNamhyung Kim <namhyung@kernel.org> Signed-off-by: NKees Cook <keescook@chromium.org>
-
由 Namhyung Kim 提交于
The commit f0e2efcf ("pstore: do not use message compression without lock") added a check to 'is_locked' to avoid breakage in concurrent accesses. But it has a side-effect of disabling compression on normal path since 'is_locked' variable is not set. As normal path always takes the lock, it should be initialized to 1. This also makes the unlock code a bit simpler. Signed-off-by: NNamhyung Kim <namhyung@kernel.org> Signed-off-by: NKees Cook <keescook@chromium.org>
-
由 Kees Cook 提交于
While none of the "fragile" pstore backends unregister yet, if they ever did, the unregistering code for the non-dump targets might get confused. This adds a check for fragile backends on unregister. Signed-off-by: NKees Cook <keescook@chromium.org>
-
- 03 11月, 2015 1 次提交
-
-
由 Geliang Tang 提交于
Fix code comment about kmsg_dump register so it matches the code. Signed-off-by: NGeliang Tang <geliangtang@163.com> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
- 22 10月, 2015 2 次提交
-
-
由 Geliang Tang 提交于
pstore doesn't support unregistering yet. It was marked as TODO. This patch adds some code to fix it: 1) Add functions to unregister kmsg/console/ftrace/pmsg. 2) Add a function to free compression buffer. 3) Unmap the memory and free it. 4) Add a function to unregister pstore filesystem. Signed-off-by: NGeliang Tang <geliangtang@163.com> Acked-by: NKees Cook <keescook@chromium.org> [Removed __exit annotation from ramoops_remove(). Reported by Arnd Bergmann] Signed-off-by: NTony Luck <tony.luck@intel.com>
-
由 Geliang Tang 提交于
Add a new wrapper function pstore_register_kmsg to keep the consistency with other similar pstore_register_* functions. Signed-off-by: NGeliang Tang <geliangtang@163.com> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
- 22 5月, 2015 2 次提交
-
-
由 Wang Long 提交于
This patch update the module parameter backend, so it is visible through /sys/module/pstore/parameters/backend. For example: if pstore backend is ramoops, with this patch: # cat /sys/module/pstore/parameters/backend ramoops and without this patch: # cat /sys/module/pstore/parameters/backend (null) Signed-off-by: NWang Long <long.wanglong@huawei.com> Acked-by: NMark Salyzyn <salyzyn@android.com> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
由 Konstantin Khlebnikov 提交于
pstore_compress() uses static stream buffer for zlib-deflate which easily crashes when several concurrent threads use one shared state. Signed-off-by: NKonstantin Khlebnikov <khlebnikov@yandex-team.ru> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
- 17 1月, 2015 2 次提交
-
-
由 alex chen 提交于
We should use sprintf format specifier "%u" instead of "%d" for argument of type 'unsigned int' in pstore_dump(). Signed-off-by: NAlex Chen <alex.chen@huawei.com> Reviewed-by: NJoseph Qi <joseph.qi@huawei.com> Acked-by: NKees Cook <keescook@chromium.org> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
由 Mark Salyzyn 提交于
A secured user-space accessible pstore object. Writes to /dev/pmsg0 are appended to the buffer, on reboot the persistent contents are available in /sys/fs/pstore/pmsg-ramoops-[ID]. One possible use is syslogd, or other daemon, can write messages, then on reboot provides a means to triage user-space activities leading up to a panic as a companion to the pstore dmesg or console logs. Signed-off-by: NMark Salyzyn <salyzyn@android.com> Acked-by: NKees Cook <keescook@chromium.org> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
- 07 6月, 2014 1 次提交
-
-
由 Fabian Frederick 提交于
- Define pr_fmt in plateform.c and ram_core.c for global prefix. - Coalesce format fragments. - Separate format/arguments on lines > 80 characters. Note: Some pr_foo() were initially declared without prefix and therefore this could break existing log analyzer. [akpm@linux-foundation.org: missed a couple of prefix removals] Signed-off-by: NFabian Frederick <fabf@skynet.be> Cc: Joe Perches <joe@perches.com> Cc: Anton Vorontsov <anton@enomsg.org> Cc: Colin Cross <ccross@android.com> Signed-off-by: NAndrew Morton <akpm@linux-foundation.org> Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
-
- 18 3月, 2014 1 次提交
-
-
由 Liu ShuoX 提交于
After sucessful decompressing, the buffer which pointed by 'buf' will be lost as 'buf' is overwrite by 'big_oops_buf' and will never be freed. Signed-off-by: NLiu ShuoX <shuox.liu@intel.com> Acked-by: NKees Cook <keescook@chromium.org> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
- 21 12月, 2013 1 次提交
-
-
由 Luck, Tony 提交于
Some pstore backing devices use on board flash as persistent storage. These have limited numbers of write cycles so it is a poor idea to use them from high frequency operations. Signed-off-by: NTony Luck <tony.luck@intel.com> Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
-
- 17 9月, 2013 3 次提交
-
-
由 Aruna Balakrishnaiah 提交于
Remove the messages indicating compression failure as it will add to the space during panic path. Reported-by: NSeiji Aguchi <seiji.aguchi@hds.com> Tested-by: NSeiji Aguchi <seiji.aguchi@hds.com> Signed-off-by: NAruna Balakrishnaiah <aruna@linux.vnet.ibm.com> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
由 Aruna Balakrishnaiah 提交于
Since zlib_deflateInit2() is used for specifying window bit during compression, zlib_inflateInit2() is appropriate for decompression. Reported-by: NSeiji Aguchi <seiji.aguchi@hds.com> Tested-by: NSeiji Aguchi <seiji.aguchi@hds.com> Signed-off-by: NAruna Balakrishnaiah <aruna@linux.vnet.ibm.com> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
由 Aruna Balakrishnaiah 提交于
When backends (ex: efivars) have smaller registered buffers, the big_oops_buf is too big for them as number of repeated occurences in the text captured will be less. What happens is that pstore takes too big a bite from the dmesg log and then finds it cannot compress it enough to meet the backend block size. Patch takes care of adjusting the buffer size based on the registered buffer size. cmpr values have been arrived after doing experiments with plain text for buffers of size 1k - 4k (Smaller the buffer size repeated occurence will be less) and with sample crash log for buffers ranging from 4k - 10k. Reported-by: NSeiji Aguchi <seiji.aguchi@hds.com> Tested-by: NSeiji Aguchi <seiji.aguchi@hds.com> Signed-off-by: NAruna Balakrishnaiah <aruna@linux.vnet.ibm.com> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
- 20 8月, 2013 5 次提交
-
-
由 Aruna Balakrishnaiah 提交于
In case decompression fails, add a ".enc.z" to indicate the file has compressed data. This will help user space utilities to figure out the file contents. Signed-off-by: NAruna Balakrishnaiah <aruna@linux.vnet.ibm.com> Reviewed-by: NKees Cook <keescook@chromium.org> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
由 Aruna Balakrishnaiah 提交于
Based on the flag 'compressed' set or not, pstore will decompress the data returning a plain text file. If decompression fails for a particular record it will have the compressed data in the file which can be decompressed with 'openssl' command line tool. Signed-off-by: NAruna Balakrishnaiah <aruna@linux.vnet.ibm.com> Reviewed-by: NKees Cook <keescook@chromium.org> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
由 Aruna Balakrishnaiah 提交于
Backends will set the flag 'compressed' after reading the log from persistent store to indicate the data being returned to pstore is compressed or not. Signed-off-by: NAruna Balakrishnaiah <aruna@linux.vnet.ibm.com> Reviewed-by: NKees Cook <keescook@chromium.org> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
由 Aruna Balakrishnaiah 提交于
Add compression support to pstore which will help in capturing more data. Initially, pstore will make a call to kmsg_dump with a bigger buffer and will pass the size of bigger buffer to kmsg_dump and then compress the data to registered buffer of registered size. In case compression fails, pstore will capture the uncompressed data by making a call again to kmsg_dump with registered_buffer of registered size. Pstore will indicate the data is compressed or not with a flag in the write callback. Signed-off-by: NAruna Balakrishnaiah <aruna@linux.vnet.ibm.com> Reviewed-by: NKees Cook <keescook@chromium.org> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
由 Aruna Balakrishnaiah 提交于
Addition of new argument 'compressed' in the write call back will help the backend to know if the data passed from pstore is compressed or not (In case where compression fails.). If compressed, the backend can add a tag indicating the data is compressed while writing to persistent store. Signed-off-by: NAruna Balakrishnaiah <aruna@linux.vnet.ibm.com> Reviewed-by: NKees Cook <keescook@chromium.org> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
- 01 7月, 2013 1 次提交
-
-
由 Aruna Balakrishnaiah 提交于
Header size is needed to distinguish between header and the dump data. Incorporate the addition of new argument (hsize) in the pstore write callback. Signed-off-by: NAruna Balakrishnaiah <aruna@linux.vnet.ibm.com> Acked-by: NKees Cook <keescook@chromium.org> Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
-
- 29 6月, 2013 1 次提交
-
-
由 Lenny Szubowicz 提交于
This is patch 1/3 of a patch set that avoids what misleadingly appears to be a error during boot: ERST: Could not register with persistent store This message is displayed if the system has a valid ACPI ERST table and the pstore.backend kernel parameter has been used to disable use of ERST by pstore. But this same message is used for errors that preclude registration. As part of fixing this, return a unique error status from pstore_register if the pstore.backend kernel parameter selects a specific facility other than the requesting facility and check for this condition before any others. This allows the caller to distinquish this benign case from the other failure cases. Also, print an informational console message about which facility successfully registered as the pstore backend. Since there are various kernel parameters, config build options, and boot-time errors that can influence which facility registers with pstore, it's useful to have a positive indication. Signed-off-by: NLenny Szubowicz <lszubowi@redhat.com> Reported-by: NNaotaka Hamaguchi <n.hamaguchi@jp.fujitsu.com> Signed-off-by: NTony Luck <tony.luck@intel.com>
-
- 12 1月, 2013 1 次提交
-
-
由 Seiji Aguchi 提交于
[Issue] When pstore is in panic and emergency-restart paths, it may be blocked in those paths because it simply takes spin_lock. This is an example scenario which pstore may hang up in a panic path: - cpuA grabs psinfo->buf_lock - cpuB panics and calls smp_send_stop - smp_send_stop sends IRQ to cpuA - after 1 second, cpuB gives up on cpuA and sends an NMI instead - cpuA is now in an NMI handler while still holding buf_lock - cpuB is deadlocked This case may happen if a firmware has a bug and cpuA is stuck talking with it more than one second. Also, this is a similar scenario in an emergency-restart path: - cpuA grabs psinfo->buf_lock and stucks in a firmware - cpuB kicks emergency-restart via either sysrq-b or hangcheck timer. And then, cpuB is deadlocked by taking psinfo->buf_lock again. [Solution] This patch avoids the deadlocking issues in both panic and emergency_restart paths by introducing a function, is_non_blocking_path(), to check if a cpu can be blocked in current path. With this patch, pstore is not blocked even if another cpu has taken a spin_lock, in those paths by changing from spin_lock_irqsave to spin_trylock_irqsave. In addition, according to a comment of emergency_restart() in kernel/sys.c, spin_lock shouldn't be taken in an emergency_restart path to avoid deadlock. This patch fits the comment below. <snip> /** * emergency_restart - reboot the system * * Without shutting down any hardware or taking any locks * reboot the system. This is called when we know we are in * trouble so this is our best effort to reboot. This is * safe to call in interrupt context. */ void emergency_restart(void) <snip> Signed-off-by: NSeiji Aguchi <seiji.aguchi@hds.com> Acked-by: NDon Zickus <dzickus@redhat.com> Signed-off-by: NTony Luck <tony.luck@intel.com>
-