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: <alpine.DEB.2.11.1601290930000.3886@nanos>
Date:	Fri, 29 Jan 2016 09:30:41 +0100 (CET)
From:	Thomas Gleixner <tglx@...utronix.de>
To:	Shanker Donthineni <shankerd@...eaurora.org>
cc:	Marc Zyngier <marc.zyngier@....com>, linux-kernel@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org,
	Jason Cooper <jason@...edaemon.net>,
	Vikram Sethi <vikrams@...eaurora.org>
Subject: Re: [PATCH v2] irqchip: gicv3-its: Fix memory leak in
 its_free_tables()

On Thu, 28 Jan 2016, Shanker Donthineni wrote:
> @@ -807,9 +810,10 @@ static void its_free_tables(struct its_node *its)
>  	int i;
>  
>  	for (i = 0; i < GITS_BASER_NR_REGS; i++) {
> -		if (its->tables[i]) {
> -			free_page((unsigned long)its->tables[i]);
> -			its->tables[i] = NULL;
> +		if (its->tables[i].base) {
> +			free_pages((unsigned long)its->tables[i].base,
> +				   get_order(its->tables[i].size));
> +			its->tables[i].base = NULL;
>  		}
>  	}
>  }
> @@ -880,6 +884,7 @@ retry_alloc_baser:
>  		if (alloc_pages > GITS_BASER_PAGES_MAX) {
>  			alloc_pages = GITS_BASER_PAGES_MAX;
>  			order = get_order(GITS_BASER_PAGES_MAX * psz);
> +			alloc_size = (1 << order) * PAGE_SIZE;

Why don't you record the order instead of converting back and forth ?

Thanks,

	tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ