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]
Date:   Sat, 24 Dec 2022 11:26:27 +0800
From:   Liu Shixin <liushixin2@...wei.com>
To:     Soichiro Ueda <the.latticeheart@...il.com>, <mst@...hat.com>,
        <david@...hat.com>, <jasowang@...hat.com>,
        <akpm@...ux-foundation.org>
CC:     <virtualization@...ts.linux-foundation.org>,
        <linux-kernel@...r.kernel.org>, <linux-mm@...ck.org>,
        <kalutes@...gle.com>, <mhiramat@...nel.org>, <cwd@...gle.com>
Subject: Re: [PATCH] virtio_balloon: high order allocation

Hi, Soichiro:

I'm interested with your patch. I'm looking at it and found some possible issues.


On 2022/12/23 17:35, Soichiro Ueda wrote:
> +			for (i = 0; i < num_pfns; i++) {
> +				set_page_pfns(vb, vb->pfns + vb->num_pfns + i,
> +					      nth_page(page, i));
> +			}
Since the interval of vb->num_pfns is VIRTIO_BALLOON_PAGES_PER_PAGE,
it seems that the pfns[] should be vb->pfns + vb->num_pfns + i * VIRTIO_BALLOON_PAGES_PER_PAGE.
> +			vb->num_pages +=
> +				num_pfns * VIRTIO_BALLOON_PAGES_PER_PAGE;
> +			if (!virtio_has_feature(
> +				    vb->vdev, VIRTIO_BALLOON_F_DEFLATE_ON_OOM))
> +				adjust_managed_page_count(page, -num_pfns);
num_pfns is of the unsigned int type so need be to converted to long manually.

root@...kaller:~# free -m
              total        used        free      shared  buff/cache   available
Mem:           1975          78        1822           2          74        1869
Swap:             0           0           0
root@...kaller:~# QEMU 7.2.0 monitor - type 'help' for more information
(qemu) info balloon
balloon: actual=2048
(qemu) balloon 2046
(qemu)

root@...kaller:~# free -m
              total        used        free      shared  buff/cache   available
Mem:       33556405    33554510        1819           2          74        1867
Swap:             0           0           0
> +
> +		num_pfns = (1 << order);
> +		for (i = 0; i < num_pfns; i++)
> +			set_page_pfns(vb, vb->pfns + vb->num_pfns + i, nth_page(page, i));
The same problem mentioned above.


thanks,

Liu Shixin

.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ