Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1412482

Re: [PATCH v2 1/3] pstore: check PSTORE_FLAGS_FRAGILE in pstore_unregister

From Kees Cook <keescook@chromium.org>
Newsgroups linux.kernel
Subject Re: [PATCH v2 1/3] pstore: check PSTORE_FLAGS_FRAGILE in pstore_unregister
Date 2016-06-02 20:20 +0200
Message-ID <rFFnQ-13m-25@gated-at.bofh.it> (permalink)
References <qs3Lz-608-5@gated-at.bofh.it> <qs3Lz-608-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Nov 6, 2015 at 8:43 PM, Geliang Tang <geliangtang@163.com> wrote:
> When PSTORE_FLAGS_FRAGILE flag is set, only kmsg is registered in
> pstore_register. So, under these circumstances, only kmsg needs to
> be unregistered in pstore_unregister.
>
> Signed-off-by: Geliang Tang <geliangtang@163.com>

I actually did the exact same thing recently, sorry to missing this
earlier version.

-Kees

> ---
>  fs/pstore/platform.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
> index 588461b..5b8f1eb 100644
> --- a/fs/pstore/platform.c
> +++ b/fs/pstore/platform.c
> @@ -497,9 +497,12 @@ EXPORT_SYMBOL_GPL(pstore_register);
>
>  void pstore_unregister(struct pstore_info *psi)
>  {
> -       pstore_unregister_pmsg();
> -       pstore_unregister_ftrace();
> -       pstore_unregister_console();
> +       if ((psi->flags & PSTORE_FLAGS_FRAGILE) == 0) {
> +               pstore_unregister_pmsg();
> +               pstore_unregister_ftrace();
> +               pstore_unregister_console();
> +       }
> +
>         pstore_unregister_kmsg();
>
>         free_buf_for_compression();
> --
> 2.5.0
>
>



-- 
Kees Cook
Chrome OS & Brillo Security

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH v2 1/3] pstore: check PSTORE_FLAGS_FRAGILE in pstore_unregister Kees Cook <keescook@chromium.org> - 2016-06-02 20:20 +0200

csiph-web