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: <20160816173603.GA18078@cmpxchg.org>
Date:	Tue, 16 Aug 2016 13:36:03 -0400
From:	Johannes Weiner <hannes@...xchg.org>
To:	Oleg Nesterov <oleg@...hat.com>
Cc:	Brenden Blanco <bblanco@...mgrid.com>,
	Michal Hocko <mhocko@...nel.org>,
	Vladimir Davydov <vdavydov@...tuozzo.com>,
	linux-kernel@...r.kernel.org,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...hat.com>,
	Arnaldo Carvalho de Melo <acme@...nel.org>,
	Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
	Alexei Starovoitov <alexei.starovoitov@...il.com>
Subject: Re: uprobes: memory leak in enable/disable loop

On Tue, Aug 16, 2016 at 04:34:08PM +0200, Oleg Nesterov wrote:
> @@ -172,8 +172,10 @@ static int __replace_page(struct vm_area
>  	mmu_notifier_invalidate_range_start(mm, mmun_start, mmun_end);
>  	err = -EAGAIN;
>  	ptep = page_check_address(page, mm, addr, &ptl, 0);
> -	if (!ptep)
> +	if (!ptep) {
> +		mem_cgroup_cancel_charge(kpage, memcg, false);
>  		goto unlock;
> +	}
>  
>  	get_page(kpage);
>  	page_add_new_anon_rmap(kpage, vma, addr, false);
> @@ -200,7 +202,6 @@ static int __replace_page(struct vm_area
>  
>  	err = 0;
>   unlock:
> -	mem_cgroup_cancel_charge(kpage, memcg, false);

Ouch. I must have mistaken this for an exclusive error path.

The patch looks good, thank you.

Reviewed-by: Johannes Weiner <hannes@...xchg.org>
Fixes: 00501b531c47 ("mm: memcontrol: rewrite charge API")
Cc: stable@...r.kernel.org # 3.17+

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ