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, 27 Sep 2017 15:29:57 +0200 (CEST)
From:   Thomas Gleixner <tglx@...utronix.de>
To:     Jeffy Chen <jeffy.chen@...k-chips.com>
cc:     linux-kernel@...r.kernel.org
Subject: Re: [PATCH] irq/generic-chip: Fix memory leak of domain->name

On Wed, 27 Sep 2017, Jeffy Chen wrote:

> Free domain->name when IRQ_DOMAIN_NAME_ALLOCATED been set.

I can see that from the patch, but you fail to explain what the problem
is.

It's actually more than just a memory leak. If the domain gets destroyed
then the domain free code would try to free d->name which might be a string
constant .....

> +	if (d->flags & IRQ_DOMAIN_NAME_ALLOCATED) {
> +		kfree(d->name);
> +		d->flags &= ~IRQ_DOMAIN_NAME_ALLOCATED;
> +	}
>  	d->name = name;

I don't think that this is the proper thing to do. There is no reason why
the domain should have the same name as the irq chip. So we rather should
do:

	if (!d->name)
		d->name = name;

Along with a proper comment.

Thanks,

	tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ