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:   Tue, 5 Jun 2018 19:41:11 +1000
From:   "Alastair D'Silva" <alastair@...ilva.org>
To:     "'Wei Yongjun'" <weiyongjun1@...wei.com>,
        "'Frederic Barrat'" <fbarrat@...ux.vnet.ibm.com>,
        "'Andrew Donnellan'" <andrew.donnellan@....ibm.com>,
        "'Arnd Bergmann'" <arnd@...db.de>,
        "'Greg Kroah-Hartman'" <gregkh@...uxfoundation.org>
Cc:     <linuxppc-dev@...ts.ozlabs.org>, <linux-kernel@...r.kernel.org>,
        <kernel-janitors@...r.kernel.org>
Subject: RE: [PATCH -next] ocxl: Fix missing unlock on error in afu_ioctl_enable_p9_wait()

> -----Original Message-----
> From: Wei Yongjun <weiyongjun1@...wei.com>
> Sent: Tuesday, 5 June 2018 7:16 PM
> To: Frederic Barrat <fbarrat@...ux.vnet.ibm.com>; Andrew Donnellan
> <andrew.donnellan@....ibm.com>; Arnd Bergmann <arnd@...db.de>;
> Greg Kroah-Hartman <gregkh@...uxfoundation.org>; Alastair D'Silva
> <alastair@...ilva.org>
> Cc: Wei Yongjun <weiyongjun1@...wei.com>; linuxppc-
> dev@...ts.ozlabs.org; linux-kernel@...r.kernel.org; kernel-
> janitors@...r.kernel.org
> Subject: [PATCH -next] ocxl: Fix missing unlock on error in
> afu_ioctl_enable_p9_wait()
> 
> Add the missing unlock before return from function
> afu_ioctl_enable_p9_wait() in the error handling case.
> 
> Fixes: e948e06fc63a ("ocxl: Expose the thread_id needed for wait on
> POWER9")
> Signed-off-by: Wei Yongjun <weiyongjun1@...wei.com>
> ---
>  drivers/misc/ocxl/file.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/misc/ocxl/file.c b/drivers/misc/ocxl/file.c index
> 33ae46c..e6a6074 100644
> --- a/drivers/misc/ocxl/file.c
> +++ b/drivers/misc/ocxl/file.c
> @@ -139,8 +139,10 @@ static long afu_ioctl_enable_p9_wait(struct
> ocxl_context *ctx,
>  		// Locks both status & tidr
>  		mutex_lock(&ctx->status_mutex);
>  		if (!ctx->tidr) {
> -			if (set_thread_tidr(current))
> +			if (set_thread_tidr(current)) {
> +				mutex_unlock(&ctx->status_mutex);
>  				return -ENOENT;
> +			}
> 
>  			ctx->tidr = current->thread.tidr;
>  		}


Thanks for picking that up!

Reviewed-by: Alastair D'Silva <alastair@...ilva.org>

-- 
Alastair D'Silva           mob: 0423 762 819
skype: alastair_dsilva     msn: alastair@...ilva.org
blog: http://alastair.d-silva.org    Twitter: @EvilDeece


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ