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]
Message-ID: <CAOi1vP9ekX47XqJXmsc0CAEmgtLmqDXReUipL+GpAJpWnvufBQ@mail.gmail.com>
Date:   Mon, 17 Jul 2017 15:17:34 +0200
From:   Ilya Dryomov <idryomov@...il.com>
To:     Dan Carpenter <dan.carpenter@...cle.com>
Cc:     Alex Elder <elder@...tank.com>, "Yan, Zheng" <zyan@...hat.com>,
        Sage Weil <sage@...hat.com>,
        "David S. Miller" <davem@...emloft.net>,
        Ceph Development <ceph-devel@...r.kernel.org>,
        netdev <netdev@...r.kernel.org>, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] libceph: potential NULL dereference in ceph_msg_data_create()

On Mon, Jul 17, 2017 at 10:13 AM, Dan Carpenter
<dan.carpenter@...cle.com> wrote:
> If kmem_cache_zalloc() returns NULL then the INIT_LIST_HEAD(&data->links);
> will Oops.  The callers aren't really prepared for NULL returns so it
> doesn't make a lot of difference in real life.
>
> Fixes: 5240d9f95dfe ("libceph: replace message data pointer with list")
> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
>
> diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
> index 0c31035bbfee..b7cc615d42ef 100644
> --- a/net/ceph/messenger.c
> +++ b/net/ceph/messenger.c
> @@ -3203,8 +3203,10 @@ static struct ceph_msg_data *ceph_msg_data_create(enum ceph_msg_data_type type)
>                 return NULL;
>
>         data = kmem_cache_zalloc(ceph_msg_data_cache, GFP_NOFS);
> -       if (data)
> -               data->type = type;
> +       if (!data)
> +               return NULL;
> +
> +       data->type = type;
>         INIT_LIST_HEAD(&data->links);
>
>         return data;

Applied.

Thanks,

                Ilya

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ