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: <5B3F3AD1.9010101@huawei.com>
Date:   Fri, 6 Jul 2018 17:48:01 +0800
From:   jiangyiwen <jiangyiwen@...wei.com>
To:     piaojun <piaojun@...wei.com>,
        "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
        <ericvh@...il.com>, <rminnich@...dia.gov>, <lucho@...kov.net>
CC:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        <v9fs-developer@...ts.sourceforge.net>
Subject: Re: [PATCH] net/9p/client.c: put refcount of trans_mod in error case
 in parse_opts()

On 2018/7/6 17:42, piaojun wrote:
>>>From my test, the second mount will fail after umounting successfully.
> The reason is that we put refcount of trans_mod in the correct case rather
> than the error case in parse_opts() at last. That will cause the refcount
> decrease to -1, and when we try to get trans_mod again in
> try_module_get(), we could only increase refcount to 0 which will cause
> failure as follows:
> parse_opts
>   v9fs_get_trans_by_name
>     try_module_get : return NULL to caller which cause error
> 
> So we should put refcount of trans_mod in error case.
> 
> Fixes: 9421c3e64137ec ("net/9p/client.c: fix potential refcnt problem of trans module")
> 
> Signed-off-by: Jun Piao <piaojun@...wei.com>

It looks good to me.

Reviewed-by: Yiwen Jiang <jiangyiwen@...wei.com>

> ---
>  net/9p/client.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/net/9p/client.c b/net/9p/client.c
> index 18c5271..5c13431 100644
> --- a/net/9p/client.c
> +++ b/net/9p/client.c
> @@ -225,7 +225,8 @@ static int parse_opts(char *opts, struct p9_client *clnt)
>  	}
> 
>  free_and_return:
> -	v9fs_put_trans(clnt->trans_mod);
> +	if (ret)
> +		v9fs_put_trans(clnt->trans_mod);
>  	kfree(tmp_options);
>  	return ret;
>  }
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ