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] [day] [month] [year] [list]
Date:   Mon, 29 Jan 2018 17:42:41 +0100
From:   Ilya Dryomov <idryomov@...il.com>
To:     Chengguang Xu <cgxu519@...oud.com>
Cc:     Ceph Development <ceph-devel@...r.kernel.org>,
        "Yan, Zheng" <zyan@...hat.com>, Sage Weil <sage@...hat.com>,
        "David S. Miller" <davem@...emloft.net>,
        netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH] ceph: Check memory allocation result

On Fri, Jan 26, 2018 at 7:54 AM, Chengguang Xu <cgxu519@...oud.com> wrote:
> Should check result of kstrndup() in case of memory allocation failure.
>
> Signed-off-by: Chengguang Xu <cgxu519@...oud.com>
> ---
>  net/ceph/ceph_common.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c
> index 5c036d2..1e492ef 100644
> --- a/net/ceph/ceph_common.c
> +++ b/net/ceph/ceph_common.c
> @@ -421,6 +421,10 @@ struct ceph_options *
>                         opt->name = kstrndup(argstr[0].from,
>                                               argstr[0].to-argstr[0].from,
>                                               GFP_KERNEL);
> +                       if (!opt->name) {
> +                               err = -ENOMEM;
> +                               goto out;
> +                       }
>                         break;
>                 case Opt_secret:
>                         opt->key = kzalloc(sizeof(*opt->key), GFP_KERNEL);

Applied.

Thanks,

                Ilya

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ