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: <87d1lz5ky1.fsf@gmail.com>
Date:	Wed, 27 Jul 2016 14:23:18 +0200
From:	Nicolai Stange <nicstange@...il.com>
To:	"Gaurav Jindal \(Gaurav Jindal\)" <Gaurav.Jindal@...eadtrum.com>
Cc:	"tglx\@linutronix.de" <tglx@...utronix.de>,
	"linux-kernel\@vger.kernel.org" <linux-kernel@...r.kernel.org>,
	"Sanjeev Yadav \(Sanjeev Kumar Yadav\)" 
	<Sanjeev.Yadav@...eadtrum.com>
Subject: Re: [PATCH]optimize error handling in tick_check_new_device

"Gaurav Jindal (Gaurav Jindal)" <Gaurav.Jindal@...eadtrum.com> writes:
> diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c
> index 4fcd99e..23faf4a 100644
> --- a/kernel/time/tick-common.c
> +++ b/kernel/time/tick-common.c
> @@ -307,6 +307,9 @@ void tick_check_new_device(struct clock_event_device *newdev)
>  	td = &per_cpu(tick_cpu_device, cpu);
>  	curdev = td->evtdev;


>
> +	if (!try_module_get(newdev->owner))
> +		return;
> +

Doesn't this leak a reference to newdev->owner if one of the following
conditions hold?

>  	/* cpu local device ? */
>  	if (!tick_check_percpu(curdev, newdev, cpu))
>  		goto out_bc;
> @@ -315,8 +318,6 @@ void tick_check_new_device(struct clock_event_device *newdev)
>  	if (!tick_check_preferred(curdev, newdev))
>  		goto out_bc;



> -	if (!try_module_get(newdev->owner))
> -		return;
>

Thanks,

Nicolai

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ