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:	Wed, 13 Oct 2010 17:10:25 -0700
From:	Dan Williams <dan.j.williams@...el.com>
To:	"Michael S. Tsirkin" <mst@...hat.com>
Cc:	Tejun Heo <tj@...nel.org>, linux-kernel@...r.kernel.org,
	Maciej Sosnowski <maciej.sosnowski@...el.com>,
	"David S. Miller" <davem@...emloft.net>, stable@...nel.org
Subject: Re: [PATCH] dma: fix error handling on out of memory

On Mon, Oct 11, 2010 at 2:44 AM, Michael S. Tsirkin <mst@...hat.com> wrote:
> get_user_pages might return less pages than requested. If this happens
> for the first iovec in dma_pin_iovec_pages, then nr_iovecs is 0 and so
> dma_unpin_iovec_pages will not unpin any pages, leaking pinned memory.
> A similar off by one would trigger for any of the following entries.
>
> Fix by updating nr_iovecs and nr_pages in this case.
>
> Signed-off-by: Michael S. Tsirkin <mst@...hat.com>
> ---
>
> Error handling in dma_pin_iovec_pages still looks wrong to me.  Am I
> missing something?

Still looks wrong it what way?  You make sure that nr_iovecs is
incremented so that the partial page list is freed, and we only walk
the initialized entries in pinned_list.

--
Dan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ