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: <565C06C9.7040906@nextfour.com>
Date:	Mon, 30 Nov 2015 10:20:25 +0200
From:	Mika Penttilä <mika.penttila@...tfour.com>
To:	Minchan Kim <minchan@...nel.org>,
	Andrew Morton <akpm@...ux-foundation.org>
CC:	<linux-kernel@...r.kernel.org>, <linux-mm@...ck.org>,
	Michael Kerrisk <mtk.manpages@...il.com>,
	<linux-api@...r.kernel.org>, Hugh Dickins <hughd@...gle.com>,
	Johannes Weiner <hannes@...xchg.org>,
	Rik van Riel <riel@...hat.com>, Mel Gorman <mgorman@...e.de>,
	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
	Jason Evans <je@...com>, Daniel Micay <danielmicay@...il.com>,
	"Kirill A. Shutemov" <kirill@...temov.name>,
	"Shaohua Li" <shli@...nel.org>, Michal Hocko <mhocko@...e.cz>,
	<yalin.wang2010@...il.com>, Andy Lutomirski <luto@...capital.net>,
	"Michal Hocko" <mhocko@...e.com>
Subject: Re: [PATCH v5 01/12] mm: support madvise(MADV_FREE)

> +		 * If pmd isn't transhuge but the page is THP and
> +		 * is owned by only this process, split it and
> +		 * deactivate all pages.
> +		 */
> +		if (PageTransCompound(page)) {
> +			if (page_mapcount(page) != 1)
> +				goto out;
> +			get_page(page);
> +			if (!trylock_page(page)) {
> +				put_page(page);
> +				goto out;
> +			}
> +			pte_unmap_unlock(orig_pte, ptl);
> +			if (split_huge_page(page)) {
> +				unlock_page(page);
> +				put_page(page);
> +				pte_offset_map_lock(mm, pmd, addr, &ptl);
> +				goto out;
> +			}
> +			pte = pte_offset_map_lock(mm, pmd, addr, &ptl);
> +			pte--;
> +			addr -= PAGE_SIZE;
> +			continue;
> +		}

looks like this leaks page count if split_huge_page() is succesfull
(returns zero).

--Mika

--
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