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: <87k2bxe194.fsf@ashishki-desk.ger.corp.intel.com>
Date:   Mon, 21 Nov 2016 09:32:55 +0200
From:   Alexander Shishkin <alexander.shishkin@...ux.intel.com>
To:     Quentin Lambert <lambert.quentin@...il.com>,
        linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Cc:     Quentin Lambert <lambert.quentin@...il.com>
Subject: Re: [PATCH] stm class: Add a missing call to put_device

Quentin Lambert <lambert.quentin@...il.com> writes:

> Most error branches following the call to class_find_device contain
> a call to put_device. This patch add calls to put_device where
> they are missing.
>
> This issue was found with Hector.
>
> Signed-off-by: Quentin Lambert <lambert.quentin@...il.com>
>
> ---
>  drivers/hwtracing/stm/core.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> --- a/drivers/hwtracing/stm/core.c
> +++ b/drivers/hwtracing/stm/core.c
> @@ -368,8 +368,10 @@ static int stm_char_open(struct inode *i
>  		return -ENODEV;
>  
>  	stmf = kzalloc(sizeof(*stmf), GFP_KERNEL);
> -	if (!stmf)
> +	if (!stmf) {
> +		put_device(dev);
>  		return -ENOMEM;
> +	}

There is a goto label at the bottom of this function which is supposed
 to deal with this. See the fix that we already have [1] for this issue.

[1] https://git.kernel.org/cgit/linux/kernel/git/ash/stm.git/commit/?h=stm-for-greg-20161118&id=a0ebf519b8a2666438d999c62995618c710573e5

Regards,
--
alex

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ