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


Groups > linux.kernel > #1252444

Re: [PATCH v3 0/3] pstore: add pstore unregister

From Kees Cook <keescook@chromium.org>
Newsgroups linux.kernel
Subject Re: [PATCH v3 0/3] pstore: add pstore unregister
Date 2015-10-21 05:10 +0200
Message-ID <qlRWO-706-15@gated-at.bofh.it> (permalink)
References <qlrzk-1Mv-9@gated-at.bofh.it> <qlzQd-5Bb-9@gated-at.bofh.it> <qlIJQ-1Ol-3@gated-at.bofh.it> <qlRN7-6zC-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.)

Nice!

Acked-by: Kees Cook <keescook@chromium.org>

-Kees

>
> $ sudo umount /sys/fs/pstore/
> $ lsmod
> Module                  Size  Used by
> reed_solomon            5150  0
> pstore                 11225  0
> zlib_deflate           18292  1 pstore
>
> $ sudo rmmod pstore
> $ lsmod
> Module                  Size  Used by
> reed_solomon            5150  0
> zlib_deflate           18292  0
>
> Thanks.
> Geliang Tang
>



-- 
Kees Cook
Chrome OS Security
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


Thread

[PATCH v2 3/3] pstore: add pstore unregister Geliang Tang <geliangtang@163.com> - 2015-10-18 13:00 +0200
  RE: [PATCH v2 3/3] pstore: add pstore unregister "Luck, Tony" <tony.luck@intel.com> - 2015-10-20 01:00 +0200
    [PATCH v3 0/3] pstore: add pstore unregister Geliang Tang <geliangtang@163.com> - 2015-10-20 09:50 +0200
      [PATCH v3 2/3] pstore: add a helper function pstore_register_kmsg Geliang Tang <geliangtang@163.com> - 2015-10-20 09:50 +0200
      [PATCH v3 1/3] pstore: add vmalloc error check Geliang Tang <geliangtang@163.com> - 2015-10-20 09:50 +0200
      [PATCH v3 3/3] pstore: add pstore unregister Geliang Tang <geliangtang@163.com> - 2015-10-20 10:00 +0200
      Re: [PATCH v3 0/3] pstore: add pstore unregister Kees Cook <keescook@chromium.org> - 2015-10-20 19:20 +0200
        Re: [PATCH v3 0/3] pstore: add pstore unregister Geliang Tang <geliangtang@163.com> - 2015-10-21 05:00 +0200
          Re: [PATCH v3 0/3] pstore: add pstore unregister Kees Cook <keescook@chromium.org> - 2015-10-21 05:10 +0200
            Re: [PATCH v3 0/3] pstore: add pstore unregister Geliang Tang <geliangtang@163.com> - 2015-10-21 06:30 +0200
              RE: [PATCH v3 0/3] pstore: add pstore unregister "Luck, Tony" <tony.luck@intel.com> - 2015-10-21 18:40 +0200

csiph-web