public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Geliang Tang <geliangtang@163.com>
To: Kees Cook <keescook@chromium.org>
Cc: Anton Vorontsov <anton@enomsg.org>,
	Colin Cross <ccross@android.com>, Tony Luck <tony.luck@intel.com>,
	Geliang Tang <geliangtang@163.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 0/3] pstore: add pstore unregister
Date: Tue, 20 Oct 2015 21:11:48 -0700	[thread overview]
Message-ID: <20151021041148.GA8995@ubuntu> (raw)
In-Reply-To: <CAGXu5jKjmHGDgQLbipXzz-WXfChXrhYCwW9n+hTGR=-UKN+Dpg@mail.gmail.com>

On Tue, Oct 20, 2015 at 08:01:20PM -0700, Kees Cook wrote:
> On Tue, Oct 20, 2015 at 7:52 PM, Geliang Tang <geliangtang@163.com> wrote:
> > On Tue, Oct 20, 2015 at 10:19:09AM -0700, Kees Cook wrote:
> >> On Tue, Oct 20, 2015 at 12:39 AM, Geliang Tang <geliangtang@163.com> wrote:
> >> > On Mon, Oct 19, 2015 at 10:56:54PM +0000, Luck, Tony wrote:
> >> >> Thanks for looking to close out this TODO item.
> >> >>
> >> >> The thing that scared me about unloading pstore was what happens to
> >> >> a process that is in the middle of reading some /sys/fs/pstore/file-name-here
> >>
> >> Were you able to verify that this reading-while-rmmod case works correctly?
> >>
> >> -Kees
> >
> > $ sudo insmod zlib_deflate.ko
> > $ sudo insmod pstore.ko
> > $ lsmod
> > Module                  Size  Used by
> > pstore                 11225  0
> > zlib_deflate           18292  1 pstore
> >
> > $ sudo mount -t pstore pstore /sys/fs/pstore
> > $ lsmod
> > Module                  Size  Used by
> > pstore                 11225  1
> > zlib_deflate           18292  1 pstore
> >
> > $ sudo insmod reed_solomon.ko
> > $ sudo insmod ramoops.ko mem_address=0x40000000 mem_size=0x400000
> > $ lsmod
> > Module                  Size  Used by
> > ramoops                 9638  0
> > reed_solomon            5150  1 ramoops
> > pstore                 11225  2 ramoops
> > zlib_deflate           18292  1 pstore
> >
> > $ tail -f /sys/fs/pstore/console-ramoops-0 &
> > [1] 3483
> > $ lsmod
> > Module                  Size  Used by
> > ramoops                 9638  0
> > reed_solomon            5150  1 ramoops
> > pstore                 11225  3 ramoops
> > zlib_deflate           18292  1 pstore
> >
> > $ kill -9 3483
> > $ lsmod
> > Module                  Size  Used by
> > ramoops                 9638  0
> > reed_solomon            5150  1 ramoops
> > pstore                 11225  2 ramoops
> > zlib_deflate           18292  1 pstore
> >
> > $ sudo rmmod ramoops
> > $ lsmod
> > Module                  Size  Used by
> > reed_solomon            5150  0
> > pstore                 11225  1
> > zlib_deflate           18292  1 pstore
> 
> What happens if you leave the tail running and try to rmmod ramoops?
> (I assume it'll just refuse.)
> 

It'll refuse if we try to unload pstore module. But we can unload
ramoops module. Because we only increase a reference count of pstore
module when the file is opened. We didn't increase ramoops module's
reference count.

Thanks.
Geliang Tang


  reply	other threads:[~2015-10-21  4:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-16 15:25 [PATCH 1/3] pstore: add vmalloc error check Geliang Tang
2015-10-16 15:25 ` [PATCH 2/3] pstore: add a helper function pstore_register_kmsg Geliang Tang
2015-10-16 15:25   ` [PATCH 3/3] pstore: add 'rmmod ramoops' support Geliang Tang
2015-10-16 15:50     ` Kees Cook
2015-10-18 10:49       ` [PATCH v2 0/3] pstore: add pstore unregister Geliang Tang
2015-10-18 10:49         ` [PATCH v2 1/3] pstore: add vmalloc error check Geliang Tang
2015-10-18 10:49           ` [PATCH v2 2/3] pstore: add a helper function pstore_register_kmsg Geliang Tang
2015-10-18 10:49             ` [PATCH v2 3/3] pstore: add pstore unregister Geliang Tang
2015-10-19 22:56               ` Luck, Tony
2015-10-20  7:39                 ` [PATCH v3 0/3] " Geliang Tang
2015-10-20  7:39                   ` [PATCH v3 1/3] pstore: add vmalloc error check Geliang Tang
2015-10-20  7:39                     ` [PATCH v3 2/3] pstore: add a helper function pstore_register_kmsg Geliang Tang
2015-10-20  7:39                       ` [PATCH v3 3/3] pstore: add pstore unregister Geliang Tang
2015-10-20 17:19                   ` [PATCH v3 0/3] " Kees Cook
2015-10-21  2:52                     ` Geliang Tang
2015-10-21  3:01                       ` Kees Cook
2015-10-21  4:11                         ` Geliang Tang [this message]
2015-10-21 16:38                           ` Luck, Tony

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=20151021041148.GA8995@ubuntu \
    --to=geliangtang@163.com \
    --cc=anton@enomsg.org \
    --cc=ccross@android.com \
    --cc=keescook@chromium.org \
    --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