From: "Guilherme G. Piccoli" <gpiccoli@igalia.com>
To: Yuxiao Zhang <yuxiaozhang@google.com>
Cc: Kees Cook <keescook@chromium.org>,
Greg KH <gregkh@linuxfoundation.org>,
Tony Luck <tony.luck@intel.com>,
linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org,
wak@google.com
Subject: Re: [PATCH] pstore: ramoops: support pmsg size larger than kmalloc limitation
Date: Wed, 28 Jun 2023 15:12:10 -0300 [thread overview]
Message-ID: <28718037-ccf1-c36b-4eb6-716c518ca98f@igalia.com> (raw)
In-Reply-To: <20230628171055.1312737-1-yuxiaozhang@google.com>
On 28/06/2023 19:10, Yuxiao Zhang wrote:
> Thanks for reviewing the patch.
>
> On 28 Jun 2023 07:30:16 +0200, Greg KH wrote:
>> What is that max size?
>
> The max size is arch dependent, it should be 2^(PAGE_SIZE+MAX_ORDER). In our environment it is 4M.
>
>> what in-kernel user is hitting this in the pstore implementation?
>
> We are trying to use pmsg to hold a core dump file, so we have pmsg-size=32M and thus hit this issue.
>
> Other than us, here is one I found that trying to save dmesg beyond kmalloc limitaton:
> https://lore.kernel.org/lkml/b2d66d9f-15a6-415c-2485-44649027a1d5@igalia.com/T/
Hi Yuxiao Zhang, thanks for the improvement! And also, thanks for
mentioning the thread above - I tested your patch today and was soon to
write you this message heh
So, first of all, the patch works for the Steam Deck case - kernel 6.4
with or without your patch behaved the same, i.e., pstore/ramoops worked
and it was possible to collect the dmesg.
But when I tried to increase the record size in ramoops, I got this
error: https://termbin.com/b12e
This is the same error as mentioned in the thread above. And it happens
when I try to bump the record size to 4MB, the biggest working value is
still 2MB. Maybe a missing spot, which remained using kmalloc() instead
of the virtual variant?
Also - Kees certainly knows that way better, but - are we 100% sure that
the region for pstore can be non-contiguous? For some reason, I always
thought this was a requirement - grepping the code, I found this
(wrong?) comment:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/pstore/zone.c#n3
Cheers,
Guilherme
next prev parent reply other threads:[~2023-06-28 18:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-27 20:25 [PATCH] pstore: ramoops: support pmsg size larger than kmalloc limitation Yuxiao Zhang
2023-06-28 5:30 ` Greg KH
2023-06-28 17:10 ` Yuxiao Zhang
2023-06-28 18:12 ` Guilherme G. Piccoli [this message]
2023-06-28 23:24 ` Kees Cook
2023-06-29 19:22 ` Guilherme G. Piccoli
2023-06-28 17:55 ` Kees Cook
2023-06-30 20:50 ` Yuxiao Zhang
2023-06-30 20:53 ` Yuxiao Zhang
2023-07-18 20:23 ` Yuxiao Zhang
2023-08-17 23:40 ` Kees Cook
[not found] <b2d66d9f-15a6-415c-2485-44649027a1d5@igalia.com>
2023-06-28 18:48 ` Yuxiao Zhang
2023-06-28 19:05 ` Guilherme G. Piccoli
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=28718037-ccf1-c36b-4eb6-716c518ca98f@igalia.com \
--to=gpiccoli@igalia.com \
--cc=gregkh@linuxfoundation.org \
--cc=keescook@chromium.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tony.luck@intel.com \
--cc=wak@google.com \
--cc=yuxiaozhang@google.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).