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: <CAOOoKeSxJzJEwX2aVsn_jcqK7gsgEVpB3VdhoKjJPCJgdNf9Mg@mail.gmail.com>
Date:   Tue, 27 Jun 2023 10:05:04 -0700
From:   Yuxiao Zhang <yuxiaozhang@...gle.com>
To:     Greg KH <gregkh@...uxfoundation.org>,
        "yuxiaozh.zhang@...il.com" <yuxiaozh.zhang@...il.com>
Cc:     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

  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;
@@ -282,7 +283,7 @@ static ssize_t ramoops_pstore_read(struct
pstore_record *record)

 out:
  if (free_prz) {
- kfree(prz->old_log);
+ kvfree(prz->old_log);
  kfree(prz);
  }

diff --git a/fs/pstore/ram_core.c b/fs/pstore/ram_core.c
index 966191d3a5ba..3453d493ec27 100644
--- a/fs/pstore/ram_core.c
+++ b/fs/pstore/ram_core.c
@@ -17,6 +17,7 @@
 #include <linux/slab.h>
 #include <linux/uaccess.h>
 #include <linux/vmalloc.h>
+#include <linux/mm.h>
 #include <asm/page.h>

 #include "ram_internal.h"
@@ -385,7 +386,7 @@ void *persistent_ram_old(struct persistent_ram_zone *prz)

 void persistent_ram_free_old(struct persistent_ram_zone *prz)
 {
- kfree(prz->old_log);
+ kvfree(prz->old_log);
  prz->old_log = NULL;
  prz->old_log_size = 0;
 }
--




On Mon, Jun 26, 2023 at 11:20 PM Greg KH <gregkh@...uxfoundation.org> wrote:
>
> On Mon, Jun 26, 2023 at 06:20:29PM -0700, Yuxiao Zhang wrote:
> > @@ -730,7 +731,7 @@ static void decompress_record(struct pstore_record *record)
> >   return;
> >
> >   /* Swap out compressed contents with decompressed contents. */
> > - kfree(record->buf);
> > + kvfree(record->buf);
> >   record->buf = unzipped;
> >   record->size = unzipped_len;
> >   record->compressed = false;
> > @@ -783,7 +784,7 @@ void pstore_get_backend_records(struct pstore_info *psi,
>
> Patch is corrupted and can not be applied at all, please fix up your
> email client to not do this.
>
> thanks,
>
> greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ