From: Kees Cook <keescook@chromium.org>
To: Geliang Tang <geliangtang@163.com>
Cc: Anton Vorontsov <anton@enomsg.org>,
Colin Cross <ccross@android.com>, Tony Luck <tony.luck@intel.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/3] pstore: check PSTORE_FLAGS_FRAGILE in pstore_unregister
Date: Thu, 2 Jun 2016 11:17:53 -0700 [thread overview]
Message-ID: <CAGXu5jKxX3Mzru-0C2s=0RE_dKUkppvXPZX68iot8uJgiYs-hg@mail.gmail.com> (raw)
In-Reply-To: <337377a3fbcf855d6a5217e06fcd8c8a979f2853.1446869434.git.geliangtang@163.com>
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
prev parent reply other threads:[~2016-06-02 18:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-07 4:43 [PATCH v2 0/3] pstore: resend three patches Geliang Tang
2015-11-07 4:43 ` [PATCH v2 1/3] pstore: check PSTORE_FLAGS_FRAGILE in pstore_unregister Geliang Tang
2015-11-07 4:43 ` [PATCH v2 2/3] efi-pstore: implement efivars_pstore_exit() Geliang Tang
2015-11-07 4:43 ` [PATCH v2 3/3] pstore: drop file opened reference count Geliang Tang
2015-11-11 16:59 ` [PATCH v2 2/3] efi-pstore: implement efivars_pstore_exit() Matt Fleming
2015-11-11 23:08 ` Kees Cook
2015-11-11 23:23 ` Luck, Tony
2015-11-11 23:24 ` Kees Cook
2016-06-02 7:26 ` Geliang Tang, Kees Cook
2016-06-02 18:26 ` Kees Cook
2015-11-12 12:22 ` Matt Fleming
2016-06-02 18:17 ` Kees Cook [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAGXu5jKxX3Mzru-0C2s=0RE_dKUkppvXPZX68iot8uJgiYs-hg@mail.gmail.com' \
--to=keescook@chromium.org \
--cc=anton@enomsg.org \
--cc=ccross@android.com \
--cc=geliangtang@163.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tony.luck@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).