From: Greg KH <gregkh@linuxfoundation.org>
To: Yuxiao Zhang <yuxiaozhang@google.com>
Cc: "yuxiaozh.zhang@gmail.com" <yuxiaozh.zhang@gmail.com>,
keescook@chromium.org, tony.luck@intel.com, gpiccoli@igalia.com,
linux-hardening@vger.kernel.org,
William Kennington <wak@google.com>,
linux-kernel@vger.kernel.org
Subject: Re: support pmsg record size larger than kmalloc limitation
Date: Tue, 27 Jun 2023 19:35:31 +0200 [thread overview]
Message-ID: <2023062702-frosty-winking-9257@gregkh> (raw)
In-Reply-To: <CAOOoKeSxJzJEwX2aVsn_jcqK7gsgEVpB3VdhoKjJPCJgdNf9Mg@mail.gmail.com>
On Tue, Jun 27, 2023 at 10:05:04AM -0700, Yuxiao Zhang wrote:
> kfree(record->priv);
> kfree(record);
> if (rc != -EEXIST || !quiet)
> diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
> index ade66dbe5f39..296465b14fa9 100644
> --- a/fs/pstore/ram.c
> +++ b/fs/pstore/ram.c
> @@ -20,6 +20,7 @@
> #include <linux/compiler.h>
> #include <linux/of.h>
> #include <linux/of_address.h>
> +#include <linux/mm.h>
>
> #include "internal.h"
> #include "ram_internal.h"
> @@ -268,7 +269,7 @@ static ssize_t ramoops_pstore_read(struct
> pstore_record *record)
> /* ECC correction notice */
> record->ecc_notice_size = persistent_ram_ecc_string(prz, NULL, 0);
>
> - record->buf = kmalloc(size + record->ecc_notice_size + 1, GFP_KERNEL);
> + record->buf = kvmalloc(size + record->ecc_notice_size + 1, GFP_KERNEL);
> if (record->buf == NULL) {
> size = -ENOMEM;
> goto out;
Please try emailing a patch to yourself and see if you can apply it
afterwards. The kernel documentation has a section for how to handle
email clients, perhaps you should read it?
thanks,
greg k-h
next prev parent reply other threads:[~2023-06-27 17:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-27 1:20 support pmsg record size larger than kmalloc limitation Yuxiao Zhang
2023-06-27 6:20 ` Greg KH
2023-06-27 17:05 ` Yuxiao Zhang
2023-06-27 17:35 ` Greg KH [this message]
2023-06-27 20:28 ` Yuxiao Zhang
[not found] ` <A82AEA54-16EC-4965-B024-D4D47C200D9D@gmail.com>
2023-06-27 17:37 ` Greg KH
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=2023062702-frosty-winking-9257@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=gpiccoli@igalia.com \
--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=yuxiaozh.zhang@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.