lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2023062702-frosty-winking-9257@gregkh>
Date:   Tue, 27 Jun 2023 19:35:31 +0200
From:   Greg KH <gregkh@...uxfoundation.org>
To:     Yuxiao Zhang <yuxiaozhang@...gle.com>
Cc:     "yuxiaozh.zhang@...il.com" <yuxiaozh.zhang@...il.com>,
        keescook@...omium.org, tony.luck@...el.com, gpiccoli@...lia.com,
        linux-hardening@...r.kernel.org,
        William Kennington <wak@...gle.com>,
        linux-kernel@...r.kernel.org
Subject: Re: support pmsg record size larger than kmalloc limitation

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ