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:   Fri, 15 Mar 2019 11:24:26 +0000
From:   Luis Henriques <lhenriques@...e.com>
To:     Aditya Pakki <pakki001@....edu>
Cc:     kjlu@....edu, Ilya Dryomov <idryomov@...il.com>,
        "Yan\, Zheng" <zyan@...hat.com>, Sage Weil <sage@...hat.com>,
        "David S. Miller" <davem@...emloft.net>,
        ceph-devel@...r.kernel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] libceph: Avoid a NULL pointer dereference

Aditya Pakki <pakki001@....edu> writes:

> kmalloc allocates memory for dest->name and attempts to call
> memcpy without a check for failure. This patch avoids such a scenario.

Since kmalloc is being invoked with the __GFP_NOFAIL flag, it will never
fail.  Thus, there's no point in checking for NULL in this case.

Cheers,
-- 
Luis


>
> Signed-off-by: Aditya Pakki <pakki001@....edu>
> ---
>  net/ceph/osdmap.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/net/ceph/osdmap.c b/net/ceph/osdmap.c
> index 48a31dc9161c..c76a7c7e6a77 100644
> --- a/net/ceph/osdmap.c
> +++ b/net/ceph/osdmap.c
> @@ -1901,6 +1901,8 @@ void ceph_oid_copy(struct ceph_object_id *dest,
>  	} else {
>  		dest->name = dest->inline_name;
>  	}
> +	if (!dest->name)
> +		return;
>  	memcpy(dest->name, src->name, src->name_len + 1);
>  	dest->name_len = src->name_len;
>  }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ